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

enhancement(report): include/exclude dev deps in analyzers #7476

Open
DmitriyLewen opened this issue Sep 10, 2024 Discussed in #7466 · 12 comments · May be fixed by #7484
Open

enhancement(report): include/exclude dev deps in analyzers #7476

DmitriyLewen opened this issue Sep 10, 2024 Discussed in #7466 · 12 comments · May be fixed by #7484
Assignees
Milestone

Comments

@DmitriyLewen
Copy link
Contributor

DmitriyLewen commented Sep 10, 2024

Description

We detect all dependencies and exclude dev dependencies in scanner.
This worked well.
But we added test scope for pom.xml files - #7414.
And this is a problem for pom.xml files, because pom.xml file can contain many dependencies, and users always expect all dependencies to be parsed, even if --iclude-dev-deps flag is missing.
More details - #7466

We used this logic to avoid splitting caches.
But --icnlude-dev-deps flag is only available for fs mode. We use memore cache for fs mode, so this is not problem.

So we need to include/exclude dev deps in analyzers.

Discussed in #7466

@DmitriyLewen DmitriyLewen added the kind/bug Categorizes issue or PR as related to a bug. label Sep 10, 2024
@DmitriyLewen DmitriyLewen self-assigned this Sep 10, 2024
@knqyf263
Copy link
Collaborator

I don't think it's a bug, but an enhancement.

@DmitriyLewen DmitriyLewen removed the kind/bug Categorizes issue or PR as related to a bug. label Sep 10, 2024
@DmitriyLewen DmitriyLewen changed the title bug(report): include/exclude dev deps in analyzers enhancement(report): include/exclude dev deps in analyzers Sep 10, 2024
@DmitriyLewen DmitriyLewen linked a pull request Sep 11, 2024 that will close this issue
6 tasks
@coheigea
Copy link
Contributor

coheigea commented Sep 11, 2024

Hello,

As I commented on #7484, 2d97700 introduced a regression in that it is flagging CVEs in test dependencies by default with no way to turn it off.

@knqyf263
Copy link
Collaborator

As I commented on #7484, 2d97700 introduced a regression in that it is flagging CVEs in test dependencies by default with no way to turn it off.

It's weird. Test dependencies should not be shown unless --include-dev-deps is passed.
@DmitriyLewen Do you know anything?

@DmitriyLewen
Copy link
Contributor Author

DmitriyLewen commented Sep 11, 2024

Yeah, i also found this problem.
I made a mistake and didn't mark the child dependencies of test dependency as Dev.

I added fix for that in #7484 (see dba9f9f)

@knqyf263
Copy link
Collaborator

I think that bugfix should be another PR and backported to v0.55.1, while excluding them in analyzers is an enhancement.

@DmitriyLewen
Copy link
Contributor Author

despite this being an improvement - i would also suggest adding #7484 to the backport, because the speed of Trivy for pom.xml files is now significantly lower than in the previous version.

I think that bugfix should be another PR

I am creating new PR

@DmitriyLewen
Copy link
Contributor Author

@knqyf263 Created #7486

@knqyf263
Copy link
Collaborator

#7484 needs some time to review as it is not a small change. We may want to revert the change and cut v0.55.1.

@DmitriyLewen
Copy link
Contributor Author

Looks like you are right...

@knqyf263
Copy link
Collaborator

I am afraid of merging fixes in a hurry and causing new problems, so it is better to revert once and add fixes carefully, IMHO.

@DmitriyLewen
Copy link
Contributor Author

DmitriyLewen commented Sep 12, 2024

Yes. You are right. Rushing can create more bugs.
I created #7488 to revert #7414.

@DmitriyLewen
Copy link
Contributor Author

Hello @coheigea
We have decided to roll back the changes and release v0.55.1

We will try to fix all the issues related to this and bring this functionality back in version v0.56.0.

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

Successfully merging a pull request may close this issue.

3 participants