-
Notifications
You must be signed in to change notification settings - Fork 587
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
Upgrade generic cataloger #1281
Merged
Merged
Conversation
This file contains 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
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Benchmark Test ResultsBenchmark results from the latest changes vs base branch
|
Signed-off-by: Alex Goodman <[email protected]>
kzantow
approved these changes
Oct 24, 2022
This was referenced Oct 24, 2022
This was referenced Nov 2, 2022
GijsCalis
pushed a commit
to GijsCalis/syft
that referenced
this pull request
Feb 19, 2024
* add second generation of generic cataloger Signed-off-by: Alex Goodman <[email protected]> * upgrade aplm cataloger to use generic.Cataloger Signed-off-by: Alex Goodman <[email protected]> * remove pacakge found-by attribute from the definition of a package ID Signed-off-by: Alex Goodman <[email protected]> Signed-off-by: Alex Goodman <[email protected]>
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.
This PR introduces a second
generic.Cataloger
that is meant to eventually replace thecommon.GenericCataloger
that exists today. Along with the new cataloger, this PR ports thealpm
cataloger to use the new generic cataloger to illustrate intended usage.Why make a new generic cataloger at all?
While working on #1063 and #572 it became apparent that catalogers should attempt to emit packages that should be immutable in order to simplify assumptions about the underlying objects for relationship objects. In the end package immutability won't be strictly followed, but the goal is to do this for all fields that may affect the ID of the package.
A very common limitation of the generic cataloger today is parser functions not having access to the
source.FileResolver
that the cataloger has. This comes up in the DPKG cataloger, the javascript cataloger, and others, specifically when the file being parsed needs to parse other files to complete the definition of the package. Allowing access to thesource.FileResolver
from the parser function solves this case for most (all?) catalogers.Why put this in a new
generic
cataloger package instead of the currentcommon
package?This would make it consistent with refinement notes from #558 . The goal would be to remove the
common
package altogether.What differences are there for the
alpm
cataloger (and future catalogers)?migrate CPE generation assignment to occur within the catalogerthis will be done as a separate effortpkg.*Metadata
structsWhy remove the
FoundBy
attribute from the definition of a package identifier (hash:ignore
)?The ID is meant to represent what makes up a package as well as the context to where it was found. "Who" found the package does not qualify within this criteria. Additionally, as we start moving back the line where a package elements are assigned by the cataloger and identifying elements should never be assigned after the function that creates the package it would be wrong to assign the
FoundBy
within the generic cataloger. These two things hint at removingFoundBy
from the consideration of the package ID.