Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_repo_url and get_download_url give no result #107

Open
vargenau opened this issue Dec 1, 2022 · 7 comments
Open

get_repo_url and get_download_url give no result #107

vargenau opened this issue Dec 1, 2022 · 7 comments

Comments

@vargenau
Copy link

vargenau commented Dec 1, 2022

from packageurl.contrib import purl2url
purl2url.get_repo_url("pkg:golang/xorm.io/[email protected]")
purl2url.get_download_url("pkg:golang/xorm.io/[email protected]")
purl2url.get_repo_url("pkg:golang/gopkg.in/[email protected]")
purl2url.get_download_url("pkg:golang/gopkg.in/[email protected]")
purl2url.get_repo_url("pkg:alpine/[email protected]?arch=x86_64&upstream=zlib&distro=alpine-3.14.3")
purl2url.get_download_url("pkg:alpine/[email protected]?arch=x86_64&upstream=zlib&distro=alpine-3.14.3")

get_repo_url and get_download_url give no result for the PURLs above. Why?

@tdruez
Copy link
Collaborator

tdruez commented Feb 15, 2023

Why?

@vargenau golang and alpine types are not yet supported by purl2url.
Could you please provide the expected output for each of your examples, this would help to add support for those types.

@vargenau
Copy link
Author

Hello @tdruez,

purl2url.get_repo_url("pkg:golang/xorm.io/[email protected]")
could return
https://pkg.go.dev/xorm.io/[email protected]

purl2url.get_download_url("pkg:golang/xorm.io/[email protected]")
could return
https://pkg.go.dev/xorm.io/[email protected]#section-sourcefiles
This is not optimal, I do not know whether there exists a URL to download the whole source code of the package.

For Alpine I have no idea, https://pkgs.alpinelinux.org/packages only gives the latest release of the package.

Perhaps we could find something in https://archive.softwareheritage.org/

tdruez added a commit that referenced this issue Mar 24, 2023
@tdruez
Copy link
Collaborator

tdruez commented Apr 10, 2023

@vargenau I've added golang support for the get_repo_url in fffc8ac#diff-2f9af27ff6ddefbfe1bd9790a393d43c19fd1f4c5325be411898a260517ca164R241

It is available in the latest version.

purl2url.get_download_url("pkg:golang/xorm.io/[email protected]")
could return
https://pkg.go.dev/xorm.io/[email protected]#section-sourcefiles
This is not optimal, I do not know whether there exists a URL to download the whole source code of the package.

This is inconsistent with the current get_download_url implementations that return a proper URL to a downloadable file.

@vargenau
Copy link
Author

Thank you @tdruez

@CsatariGergely
Copy link

@tdruez unfortunatelly go package management is a bit more complex than this. I started pr #113 for the support, but it is not complete yet.

@tdruez
Copy link
Collaborator

tdruez commented Apr 13, 2023

@CsatariGergely could you provide some examples of golang purls that would not be supported at the moment?
I do not see any addition to the test data in your PR.

@CsatariGergely
Copy link

Here is the set what I used for internal testing:

pkg:golang/github.com/mailru/[email protected]
pkg:golang/github.com/matttproud/[email protected]
pkg:golang/github.com/matttproud/[email protected]
pkg:golang/github.com/miekg/[email protected]
pkg:golang/github.com/miekg/[email protected]
pkg:golang/github.com/mitchellh/[email protected]
pkg:golang/github.com/mitchellh/[email protected]
pkg:golang/github.com/mwitkow/[email protected]
pkg:golang/github.com/mwitkow/[email protected]
pkg:golang/github.com/oklog/[email protected]
pkg:golang/github.com/oklog/[email protected]
pkg:golang/github.com/oklog/[email protected]
pkg:golang/github.com/oklog/[email protected]
pkg:golang/github.com/opentracing/[email protected]
pkg:golang/github.com/pkg/[email protected]
pkg:golang/github.com/pkg/[email protected]
pkg:golang/github.com/prometheus/alertmanager@(devel)
pkg:golang/github.com/prometheus/alertmanager@(devel)
pkg:golang/github.com/prometheus/[email protected]
pkg:golang/github.com/prometheus/[email protected]
pkg:golang/github.com/prometheus/[email protected]
pkg:golang/github.com/prometheus/[email protected]
pkg:golang/github.com/prometheus/[email protected]
pkg:golang/github.com/prometheus/[email protected]
pkg:golang/github.com/prometheus/common/[email protected]
pkg:golang/github.com/prometheus/common/[email protected]
pkg:golang/github.com/prometheus/[email protected]
pkg:golang/github.com/prometheus/[email protected]
pkg:golang/github.com/prometheus/[email protected]
pkg:golang/github.com/prometheus/[email protected]
pkg:golang/github.com/rs/[email protected]
pkg:golang/github.com/sean-/[email protected]
pkg:golang/github.com/sean-/[email protected]
pkg:golang/github.com/shurcooL/[email protected]
pkg:golang/github.com/shurcooL/[email protected]
pkg:golang/github.com/shurcooL/[email protected]
pkg:golang/github.com/shurcooL/[email protected]
pkg:golang/github.com/xlab/[email protected]
pkg:golang/go.mongodb.org/[email protected]
pkg:golang/go.mongodb.org/[email protected]
pkg:golang/golang.org/x/[email protected]
pkg:golang/golang.org/x/[email protected]
pkg:golang/golang.org/x/[email protected]
pkg:golang/golang.org/x/[email protected]
pkg:golang/golang.org/x/[email protected]
pkg:golang/golang.org/x/[email protected]
pkg:golang/golang.org/x/[email protected]
pkg:golang/golang.org/x/[email protected]
pkg:golang/golang.org/x/[email protected]
pkg:golang/golang.org/x/[email protected]
pkg:golang/golang.org/x/[email protected]
pkg:golang/google.golang.org/[email protected]
pkg:golang/google.golang.org/[email protected]
pkg:golang/gopkg.in/alecthomas/[email protected]
pkg:golang/gopkg.in/alecthomas/[email protected]
pkg:golang/gopkg.in/[email protected]
pkg:golang/gopkg.in/[email protected]
pkg:golang/gopkg.in/[email protected]

True, one of these per category should be added as a testcase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants