Conversation
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Benchmark Test ResultsBenchmark results from the latest changes vs base branch |
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
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 <alex.goodman@anchore.com> * upgrade aplm cataloger to use generic.Cataloger Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * remove pacakge found-by attribute from the definition of a package ID Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Signed-off-by: Alex Goodman <alex.goodman@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.
This PR introduces a second
generic.Catalogerthat is meant to eventually replace thecommon.GenericCatalogerthat exists today. Along with the new cataloger, this PR ports thealpmcataloger 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.FileResolverthat 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.FileResolverfrom the parser function solves this case for most (all?) catalogers.Why put this in a new
genericcataloger package instead of the currentcommonpackage?This would make it consistent with refinement notes from #558 . The goal would be to remove the
commonpackage altogether.What differences are there for the
alpmcataloger (and future catalogers)?migrate CPE generation assignment to occur within the catalogerthis will be done as a separate effortpkg.*MetadatastructsWhy remove the
FoundByattribute 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
FoundBywithin the generic cataloger. These two things hint at removingFoundByfrom the consideration of the package ID.