-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(cli): add include-dev-deps flag #4700
feat(cli): add include-dev-deps flag #4700
Conversation
I asked someone to list candidates with the CLI flag name.
@itaysk @DmitriyLewen Any preference? I'd vote on |
I think Thinking about SBOM, as you said - |
@DmitriyLewen Let's go for |
@knqyf263 i updated flag name. |
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.
We don't have to update this golden, right?
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 thought the same when i got error.
But we need to fix this golden file.
I added new Dev
boolean field to Package
- https://github.com/aquasecurity/trivy/pull/4700/files#diff-11d06805c304c7fe1d7be3057aede873f853bffbb46c6e997e92b1e7c60f80dfR72
To calculate ID for spdx package we use Package
struct -
trivy/pkg/sbom/spdx/marshal.go
Line 332 in 790c805
pkgID, err := calcPkgID(m.hasher, pkg) |
That is why ID was changed.
About spdx tests - we overwrite hash fucntion. This fucntion only uses Name
and FilePath
-
trivy/pkg/sbom/spdx/marshal_test.go
Line 860 in 790c805
str = v.(ftypes.Package).Name + v.(ftypes.Package).FilePath |
Correctly me, if i missed something.
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.
Yeah, you're right. I forgot about how to calculate the SPDX package IDs. Thanks!
* add Dev field for Package * fix integration test * update docs * feat(cli): add include-dev flag * bump go-dep-parser * update docs * add integration test * refactor * refactor * fix integration test * refactor: rename flag to include-dev-deps * update docs * update docs * filter dev deps when scanning packages * add flag support for server mode * refactor: remove comment that might confuse * refactor: move --include-dev-deps to the scanner flag group * refactor: not return apps * docs: update --------- Co-authored-by: knqyf263 <knqyf263@gmail.com>
Description
aquasecurity/go-dep-parser#237 adds
Dev
field forPackage
to mark dev dependencies.Add
include-dev-deps
flag to work with these field.These changes are currently only supported for
npm
.Related issues
Related PRs
Checklist