-
Notifications
You must be signed in to change notification settings - Fork 8
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
Generated PURL is not providing enough information to derive a valid download URL #149
Comments
The generated download URL is invalid as the tag value is In a way, the generated purl is incorrect as the version Maybe the correct purl here should be
Alternatively, we may want to store the tag as a qualifier, such as: |
for https://github.com/apache/nifi/releases/tag/rel%2Fnifi-1.27.0 where the tag is effectively a weird >>> p=PackageURL.from_string("pkg:github/apache/nifi@rel/nifi-1.27.0")
>>> p
PackageURL(type='github', namespace='apache', name='nifi', version='rel/nifi-1.27.0', qualifiers={}, subpath=None)
>>> print(p)
pkg:github/apache/nifi@rel/nifi-1.27.0 For the m3 tag, we should have this (and this is NOT what works today): >>> from packageurl.contrib import purl2url, url2purl
>>> download_url = "https://github.com/apache/nifi/archive/refs/tags/rel/nifi-2.0.0-M3.tar.gz"
>>> print(url2purl.get_purl(download_url))
pkg:github/apache/nifi@rel/nifi-2.0.0-M3
>>> purl = "pkg:github/apache/[email protected]"
>>> purl2url.get_download_url(purl)
'https://github.com/apache/nifi/archive/2.0.0-M3.tar.gz' # <-- this does not exist alright
# this tag does NOT exist
# this would work with proper URL, this does exist alright
>>> purl = "pkg:github/apache/nifi@rel/nifi-2.0.0-M3"
>>> purl2url.get_download_url(purl)
`https://github.com/apache/nifi/archive/refs/tags/rel/nifi-2.0.0-M3.tar.gz` So to recap:
|
Signed-off-by: tdruez <[email protected]>
* Upgrade packageurl-python to latest 0.15.5 version #153 Signed-off-by: tdruez <[email protected]> * Upgrade packageurl-python to latest 0.15.6 version #149 Signed-off-by: tdruez <[email protected]> --------- Signed-off-by: tdruez <[email protected]>
Fix merged and deployed. |
Fix confirmed. Thanks @tdruez ! |
Here is a valid download URL: https://github.com/apache/nifi/archive/refs/tags/rel/nifi-2.0.0-M3.tar.gz
I successfully created a Package in DejaCode (see attached screenshot) using that download URL and it assigned this PURL to that package: pkg:github/apache/[email protected]
In a different dataspace, I attempted to create a Package using that PURL, and got this error message:
Error: Could not download content: https://github.com/apache/nifi/archive/2.0.0-M3.tar.gz
so it seems that the PURL does not have the information required to derive the complete, valid download URL.
The text was updated successfully, but these errors were encountered: