-
Couldn't load subscription status.
- Fork 727
Replace distro type #742
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
Replace distro type #742
Conversation
Signed-off-by: Alex Goodman <[email protected]>
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]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I'll wait like the notes said for the grype and grype-db branches so we can check it all together but no real notes on this one.
| } | ||
|
|
||
| // importSBOM mirrors all elements found on the syftjson model format object relative to the anchore engine import schema. | ||
| type importSBOM struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see any notes about this in the PR description. Is this type/method needed for internal anchore purposes for when we're changing the schema with breaking changes 2 -> 3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great point, let me update the PR description to reflect this change and why
| pURL := packageurl.NewPackageURL( | ||
| // TODO: replace with `packageurl.TypeDebian` upon merge of https://github.com/package-url/packageurl-go/pull/21 | ||
| // TODO: or, since we're now using an Anchore fork of this module, we could do this sooner. | ||
| "deb", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new release struct do we have enough information to replace this field with information we've pulled from the os-information or do we want to keep this hardcoded for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an upcoming PR is about to change this, I think in the way that you're describing (derive the value directly from the release ID)
|
I'm going to hold off on merging this until the sunsetting of grype-db is completed (since this changes the types shared between grype and grype-db) |
…hub.com/hectorj2f/syft into hectorj2f/add_dependencies_to_cyclonedx * 'hectorj2f/add_dependencies_to_cyclonedx' of https://github.com/hectorj2f/syft: (29 commits) Improve CycloneDX format output (#710) Add additional PHP metadata (#753) Update Syft formats for SyftJson (#752) Add support for "file" source type in syftjson unmarshaling (#750) remove contains file from spdx dependency generation support .sar for java ecosystem (#748) Start developer documentation (#746) Align SPDX export more with SPDX 2.2 specification (#743) Replace distro type (#742) update goreleaser with windows checksums (#740) bump stereoscope version to remove old containerd (#741) Add support for multiple output files in different formats (#732) Add support for searching for jars within archives (#734) 683 windows filepath (#735) Fix CPE encode/decode when it contains special chars (#714) support .par for java ecosystems (#727) Add arm64 support to install script (#729) Revert "bump goreleaser to v1.2 (#720)" (#731) Add a version flag (#722) Add lpkg as java package format (#694) ...
* remove strong distro type Signed-off-by: Alex Goodman <[email protected]> * bump json schema to v3 (breaking distro shape) Signed-off-by: Alex Goodman <[email protected]> * fix linting Signed-off-by: Alex Goodman <[email protected]> * allow for v2 decoding of distro idLikes field in v3 json decoder Signed-off-by: Alex Goodman <[email protected]> * fix casing in simple linux release name Signed-off-by: Alex Goodman <[email protected]> * use discovered name as pretty name in simple linux release Signed-off-by: Alex Goodman <[email protected]> Signed-off-by: fsl <[email protected]>
* remove strong distro type Signed-off-by: Alex Goodman <[email protected]> * bump json schema to v3 (breaking distro shape) Signed-off-by: Alex Goodman <[email protected]> * fix linting Signed-off-by: Alex Goodman <[email protected]> * allow for v2 decoding of distro idLikes field in v3 json decoder Signed-off-by: Alex Goodman <[email protected]> * fix casing in simple linux release name Signed-off-by: Alex Goodman <[email protected]> * use discovered name as pretty name in simple linux release Signed-off-by: Alex Goodman <[email protected]> Signed-off-by: Christopher Phillips <[email protected]>
* remove strong distro type Signed-off-by: Alex Goodman <[email protected]> * bump json schema to v3 (breaking distro shape) Signed-off-by: Alex Goodman <[email protected]> * fix linting Signed-off-by: Alex Goodman <[email protected]> * allow for v2 decoding of distro idLikes field in v3 json decoder Signed-off-by: Alex Goodman <[email protected]> * fix casing in simple linux release name Signed-off-by: Alex Goodman <[email protected]> * use discovered name as pretty name in simple linux release Signed-off-by: Alex Goodman <[email protected]>
* remove strong distro type Signed-off-by: Alex Goodman <[email protected]> * bump json schema to v3 (breaking distro shape) Signed-off-by: Alex Goodman <[email protected]> * fix linting Signed-off-by: Alex Goodman <[email protected]> * allow for v2 decoding of distro idLikes field in v3 json decoder Signed-off-by: Alex Goodman <[email protected]> * fix casing in simple linux release name Signed-off-by: Alex Goodman <[email protected]> * use discovered name as pretty name in simple linux release Signed-off-by: Alex Goodman <[email protected]>
* remove strong distro type Signed-off-by: Alex Goodman <[email protected]> * bump json schema to v3 (breaking distro shape) Signed-off-by: Alex Goodman <[email protected]> * fix linting Signed-off-by: Alex Goodman <[email protected]> * allow for v2 decoding of distro idLikes field in v3 json decoder Signed-off-by: Alex Goodman <[email protected]> * fix casing in simple linux release name Signed-off-by: Alex Goodman <[email protected]> * use discovered name as pretty name in simple linux release Signed-off-by: Alex Goodman <[email protected]>
Removes the
distro.Distroobject in favor for a newlinux.Releasestruct. The existingdistroobject takes part of the raw information that is found during analysis and attempts to identify the release relative to a hard-coded enumeration. The remaining raw information discovered is thrown away. There are problems with this:distro.Typeenumeration, which leads to unnecessary updates of syft to improve grype matches (e.g. adding a new supported distro).The new
linux.Releasestruct raises up information found in/*/os-release, which is extremely common across all distributions.This makes a breaking change to the JSON schema, thus, it is being bumped in this PR from 2 to 3. The existing
.distro.idLikefield is a string. The underlying field is a space-separated list of distribution names which the current linux release is most close to. This field is being transformed into a list to eliminate the need for downstream consumers to split the field on space before use.Closes #342