Skip to content
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

WIP: Add component type to pkg #2146

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

noqcks
Copy link
Contributor

@noqcks noqcks commented Sep 17, 2023

See issue #2145

This PR is failing right now because adding a new field to Pkg recomputes packageIDs (I believe). If this PR were to be deemed appropriate, I would update all tests where needed. Looking for an approval first before I update all the tests.

Signed-off-by: Benji Visser <benji@093b.org>
@tgerla
Copy link
Contributor

tgerla commented Dec 14, 2023

Hey @noqcks, sorry for the delay getting back to you. I will see if we can get a review on this soon, if you are still interested in working on it. Much appreciated!

@noqcks
Copy link
Contributor Author

noqcks commented Jan 3, 2024

Yep, I am!

Although this is only a WIP/example PR for this issue: #2145

I can clean it up if the direction described in the issue makes sense.

Locations file.LocationSet // the locations that lead to the discovery of this package (note: this is not necessarily the locations that make up this package)
Licenses LicenseSet // licenses discovered with the package metadata
Language Language `hash:"ignore" cyclonedx:"language"` // the language ecosystem this package belongs to (e.g. JavaScript, Python, etc)
ComponentType ComponentType `cyclonedx:"type"` // the type of component (e.g. application, library, framework, etc)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @noqcks -- sorry for the delay here, I also left a comment on the related issue, but this gist is that instead of modifying this package, we should modify the DotnetDepsMetadata with the appropriate field(s) here: https://github.com/anchore/syft/blob/main/syft/pkg/dotnet.go#L4-L10

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we able to access DotnetDepsMetadata from the cyclonedx formatter? from my understanding you can only access the package Struct

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you can access the metadata from the formatter, you just need to type assert the metadata field here is an example extracting the author in CycloneDX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants