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

Do not strip VCS tags leading "V" and do not use a "version_prefix" PURL qualifier #153

Closed
pombredanne opened this issue Jul 20, 2024 · 8 comments
Assignees
Labels
bug Something isn't working integration Integration with other applications

Comments

@pombredanne
Copy link
Member

Describe the bug
Do not strip VCS tags leading "V" or "v" as it creates weird and impossible to use PURLs.

See also:

To Reproduce
Steps to reproduce the behavior:

  1. Create a package from https://github.com/elliotchance/orderedmap/archive/refs/tags/v1.6.0.tar.gz
  2. The PURL is pkg:github/elliotchance/[email protected]?version_prefix=v

Expected behavior
PURL should be pkg:github/elliotchance/[email protected]
We should reuse tags as-is.

@pombredanne pombredanne added the bug Something isn't working label Jul 20, 2024
@DennisClark
Copy link
Member

The proposed change in this issue sounds like a good idea to me, but I think it might require some major data upgrades to all the AboutCode projects?

@DennisClark DennisClark added the integration Integration with other applications label Jul 23, 2024
@DennisClark
Copy link
Member

I am going to guess that the stripping of prefix literals from a package version was a conscious decision at some point in order to facilitate version range sorting and comparisons by "normalizing" the version to the numeric value only. In hindsight, that may not have been a good idea, but changing/fixing that to do something else might also have an impact on any of the AboutCode tools that work with versioning.

@mjherzog
Copy link
Member

We need to determine which types of packages are affected - perhaps starting with the set of Packages in the DejaCode reference data. This seems to be characteristic of GitHub (including the AboutCode repos) with a "v" in the Download URL and uncommon for many package types like maven, npm or pypi.
I suggest two follow up actions:

  • For an immediate workaround we should use a download URL qualifier instead of a version qualifier. The download URL will be verbose but it is easy to explain why it is there. It also does not require any additional manipulation to rebuild the URL.
  • The broader question is one that we need to deal with through the emerging ECMA standardization process for PURL and univers.

@pombredanne
Copy link
Member Author

My point is that when the package version comes from a git tag it should NEVER be stripped from a suffix. Tags (and versions in general) should NOT be modified as this does not help with anything but impair portability.

  • Matching tags to versions is something entirely different (as handled in PurlDB purl2vcs)
  • And sorting versions is also something entirely different (as handled by univers).

The tags themselves should not be stored as modified to accommodate either of these concerns.
Only DejaCode has this issue AFAIK, so this impact not much else though this was introduced in https://github.com/package-url/packageurl-python/blob/8fac7180870c9163cb7a3d6446a7a00150990598/CHANGELOG.rst#0104-2022-10-17

@tdruez we need to find a way to revert that change

@DennisClark
Copy link
Member

@tdruez Everything looks good on staging. I tried multiple variants, including a package without release tags, and everything was generated without problems. I also did a number of "round trips" between dataspaces using purl values and that all worked great as well. The re-genned packages are all valid, as far as I can tell. I think it's ready to deploy, and thanks for taking care of this.

@DennisClark
Copy link
Member

On the other hand (and you undoubtedly know this already) the issue reported regarding pkg:github/apache/[email protected] in issue #149 is still a problem.

@pombredanne
Copy link
Member Author

On the other hand (and you undoubtedly know this already) the issue reported regarding pkg:github/apache/[email protected] in issue #149 is still a problem.

@DennisClark the version should be exactly rel/nifi-2.0.0-M3 because this is the tag value per https://github.com/apache/nifi/releases/tag/rel%2Fnifi-2.0.0-M3

The only way out of this would be to track the actual tagging scheme for each and every package which sounds like a wild goose chase. Or just have the logic for all packages in one place which is what https://github.com/nexB/purldb/tree/main/purl2vcs does exactly

tdruez added a commit that referenced this issue Jul 25, 2024
* 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]>
@tdruez
Copy link
Contributor

tdruez commented Jul 25, 2024

Fix merged and deployed.

@tdruez tdruez closed this as completed Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working integration Integration with other applications
Projects
Status: Done
Development

No branches or pull requests

4 participants