Support Normalization of VersionRange#108
Merged
keshav-space merged 31 commits intoJul 24, 2024
Merged
Conversation
97c2de4 to
e001ca7
Compare
1018732 to
b9664ca
Compare
pombredanne
reviewed
Mar 17, 2023
pombredanne
left a comment
Member
There was a problem hiding this comment.
Thanks
LGTM overall! we have likely to find a bettr way than using the native intbitset of at least have a fallback to plain Python, I will review further later this WE!
pombredanne
requested changes
Mar 17, 2023
pombredanne
left a comment
Member
There was a problem hiding this comment.
I think we could:
- extract Span as its own mini library also reused in ScanCode? May be this is overakill though
- have a fallback to a plain builtin set when intbitset is not installed... and have this also in SCTK
cda6c25 to
e387ecb
Compare
Member
Author
Added |
- support normalization of range expression from GitHub, Snyk, GitLab - Discrete range normalization for OSV, DEPS, VulerableCode Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
e387ecb to
d88b80c
Compare
pombredanne
requested changes
Apr 10, 2023
pombredanne
left a comment
Member
There was a problem hiding this comment.
Thanks! See some/many comments for your consideration!
Signed-off-by: Omkar Phansopkar <omkarphansopkar@gmail.com>
Added docs server script, dark mode & copybutton for docs, tracking chmod in git
Reference: aboutcode-org/skeleton#84 Signed-off-by: John M. Horan <johnmhoran@gmail.com>
…rg#84 Reference: aboutcode-org/skeleton#84 Signed-off-by: John M. Horan <johnmhoran@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Update CSS to widen page and handle mobile aboutcode-org#84
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Update CI runners and python version
Replace macos-11 runners with macos-14 runners. Reference: https://github.com/actions/runner-images?tab=readme-ov-file#available-images Reference: aboutcode-org/skeleton#89 Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Replace deprecated macos CI runners
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
3 tasks
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
376110b to
d2904b0
Compare
- Pairwise constraint evaluation misses the case when filtered constraints contains only one item - Fixes aboutcode-org#137 Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
pombredanne
requested changes
Jul 24, 2024
pombredanne
left a comment
Member
There was a problem hiding this comment.
Thanks. See review comments.
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
f3bbf43 to
8f0d727
Compare
pombredanne
approved these changes
Jul 24, 2024
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
2114e7f to
fe35a34
Compare
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
d32c35c to
b12572d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why Normalize VersionRange?
A
VersionRangerepresents set of segments of package versions. Different VersionRange can represent the same set of segments.For example, consider the package
pkg:npm/foobarwith the following versions:["1.0", "2.1", "2.2", "3.0", "3.1", "5.0"].We can represent certain segments using the
versexpressionvers:npm/<=2.2|>=3.0|<3.1|5.0.This can also be represented as:
vers:npm/>=1.0|<3.0|>=3.0|<3.1|5.0vers:npm/<3.1|5.0vers:npm/>=1.0|<=2.2|>=3.0|<3.1|5.0These different representations make it difficult to validate whether two different VersionRange represent the
same versions of a package.
To effectively compare these ranges, we need to normalize them. The idea is that all the
versreferring tothe same set of package versions should normalize to an identical
VersionRange.To achieve this, we take a
versalong with all the versions of the package and generate a newverssuch that it contains not arbitrary version segments but only the longest contiguous segments of versions, leading to the same VersionRange expression which is identical for a particular set of versions.
If we apply this normalization to the above example of
pkg:npm/foobar:vers:npm/<=2.2|>=3.0|<3.1|5.0would normalize tovers:npm/>=1.0|<=3.0|5.0The same normalization applies to other VersionRange since they all refer to the same set of versions,
they will all normalize to the exact same VersionRange:
vers:npm/>=1.0|<3.0|>=3.0|<3.1|5.0=>vers:npm/>=1.0|<=3.0|5.0vers:npm/<3.1|5.0=>vers:npm/>=1.0|<=3.0|5.0vers:npm/>=1.0|<=2.2|>=3.0|<3.1|5.0=>vers:npm/>=1.0|<=3.0|5.0from_gitlab_nativefrom_gitlab_nativecan't properly parse range expressions for Composer, Maven and NuGet #136__contains__resolution in VersionRange #137