Add support for RPM DB package relationships#2872
Merged
Conversation
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
1c0345e to
649b8dc
Compare
42 tasks
spiffcs
approved these changes
May 14, 2024
Contributor
spiffcs
left a comment
There was a problem hiding this comment.
👍 🟢
Just had a question about how we're doing the allocation for relationship filtering here
| func denySelfReferences(pkgs []pkg.Package, rels []artifact.Relationship, err error) ([]pkg.Package, []artifact.Relationship, error) { | ||
| // it can be common for dependency evidence to be self-referential (e.g. bash depends on bash), which is not useful | ||
| // for the dependency graph, thus we remove these cases | ||
| for i := 0; i < len(rels); i++ { |
Contributor
There was a problem hiding this comment.
I see that we're decrementing i to account for the filter. Are we doing the loop this way to avoid doubling the relationship allocations?
Contributor
Author
There was a problem hiding this comment.
exactly -- if there are no self referential package relationships then we aren't allocating another slice
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.
Related to #572
Adds support for tracking RPM to RPM dependencies (from an RPM DB, not from RPM files) as package relationships.
Note: there are several cases where package evidence seems to support self-referential dependencies (e.g. bash depends on bash) however, the RPM/yum/dnf tooling does not support this conclusion. For this reason this cataloger will prune all self-referential RPM DB package relationships.