Skip to content

Introduce "all" and "none" specifiers - #146

Merged
pombredanne merged 6 commits into
aboutcode-org:mainfrom
immqu:main
Jun 11, 2025
Merged

Introduce "all" and "none" specifiers#146
pombredanne merged 6 commits into
aboutcode-org:mainfrom
immqu:main

Conversation

@immqu

@immqu immqu commented Nov 13, 2024

Copy link
Copy Markdown
Collaborator

This PR introduces the possibility to specify all versions, or none using the notation vers:all/* and vers:none/*. To allow this, it simply adds a version check in the contains method that returns true if all is specified, and false if none is specified.
Addresses the spec improvement suggested in package-url/vers-spec#16

@tschmidtb51

Copy link
Copy Markdown

Do we check somewhere that the strings are just vers:all/* or vers:none/* instead of something invalid as vers:all/*|>17.4 or vers:none/!4.2?

@tschmidtb51

Copy link
Copy Markdown

@immqu Please also check that your commits are signed (see DCO fails).

Signed-off-by: Immanuel Kunz <immanuel.kunz@aisec.fraunhofer.de>
Signed-off-by: Kunz, Immanuel <immanuel.kunz@aisec.fraunhofer.de>
Signed-off-by: Immanuel Kunz <immanuel.kunz@aisec.fraunhofer.de>
Signed-off-by: Kunz, Immanuel <immanuel.kunz@aisec.fraunhofer.de>
Signed-off-by: Kunz, Immanuel <immanuel.kunz@aisec.fraunhofer.de>
@immqu

immqu commented Nov 14, 2024

Copy link
Copy Markdown
Collaborator Author

Do we check somewhere that the strings are just vers:all/* or vers:none/* instead of something invalid as vers:all/*|>17.4 or vers:none/!4.2?

Currently, it is checked whether the * constraint is included, and if so, no other constraint is allowed. So, no adjustment is necessary to prevent something like vers:all/*|>17.4 (see https://github.com/aboutcode-org/univers/blob/main/src/univers/version_range.py#L141). However, it is possible to specify something like vers:all/>1.2.3 (without the *).
I have added a strict string equality check now, though.

Comment thread tests/test_version_range.py
Signed-off-by: Kunz, Immanuel <immanuel.kunz@aisec.fraunhofer.de>

@tschmidtb51 tschmidtb51 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Kunz, Immanuel <immanuel.kunz@aisec.fraunhofer.de>
Signed-off-by: Kunz, Immanuel <immanuel.kunz@aisec.fraunhofer.de>
@immqu
immqu marked this pull request as ready for review November 15, 2024 10:41
@immqu

immqu commented Nov 15, 2024

Copy link
Copy Markdown
Collaborator Author

See also the corresponding PR for purl

pombredanne pushed a commit to package-url/purl-spec that referenced this pull request Mar 14, 2025
This introduces the possibility to specify all versions, or no version.

Reference: https://github.com/package-url/purl-spec/issues/267
Reference: aboutcode-org/univers#146
Signed-off-by: Kunz, Immanuel <immanuel.kunz@aisec.fraunhofer.de>
Signed-off-by: Philippe Ombredanne <pombredanne@aboutcode.org>
pombredanne pushed a commit to package-url/purl-spec that referenced this pull request Mar 14, 2025
This introduces the possibility to specify all versions, or no version.

Reference: https://github.com/package-url/purl-spec/issues/267
Reference: aboutcode-org/univers#146
Signed-off-by: Kunz, Immanuel <immanuel.kunz@aisec.fraunhofer.de>
Signed-off-by: Philippe Ombredanne <pombredanne@aboutcode.org>

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All clear. Merging at last!

@pombredanne
pombredanne merged commit 50f83d1 into aboutcode-org:main Jun 11, 2025
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

Successfully merging this pull request may close these issues.

3 participants