WIP: narrow golang match comparison for pseudo versions#1810
Closed
WIP: narrow golang match comparison for pseudo versions#1810
Conversation
…rsion cannot be compared against a semver constraint Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
kzantow
reviewed
Apr 17, 2024
Contributor
Author
|
Quality tests are now failing - let me go check the labels |
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
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.
Summary
This PR attempts to narrow the golang_constraint
Satisfiedlogic as a follow up to #1797#1797 allows grype to proceed with matches when it encounters a package with a
pseudo version. This PR limits those pseudo versions to only be compared against constraints that also contain pseudo versions.This eliminates a case of FP where an incomplete
pseudo version(which doesn't have the correct main module information) is compared against a valid semver constraint.Example of this FP:
In the above case
v0.0.0-20240414223325-7027f264fbb3is not <0.1.29. Syft is unable to determine the main module version for ollama. By comparing the incomplete pseudo version to the semver constraint grype produces a FP.This PR makes it so that packages with versions like
v0.0.0-20240414223325-7027f264fbb3should only be compared to constraints that also have a similar format.