-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Report transitive dependency vulnerability errors for npm, yarn, and pnpm #10282
Conversation
fee7349
to
3ec3c91
Compare
0030239
to
7cd14f8
Compare
577bf65
to
753c586
Compare
bdb06f9
to
e696891
Compare
This change affects the core functionality of Dependabot. @abdulapopoola has already approved the PR. It would be greatly appreciated if one of you could also review it to ensure its accuracy and stability before we proceed with merging. Thank you! |
3dedf27
to
6131ffd
Compare
4f7b82c
to
85a6dac
Compare
Thanks for working on fixing these This solution looks like you're on the right track, but I think we can push the check for a conflicting transitive dependency down into the ecosystem. dependabot-core/npm_and_yarn/lib/dependabot/npm_and_yarn/update_checker.rb Lines 67 to 76 in 85a6dac
I tested returning
So we're already setup to report these as expected errors including the conflicting dependency data. I think the root cause here is In summary, you should be able to add something like |
Thanks @jakecoffman. I see. I will check it and if it relating this error to the it's main dependency I will make changes. I think here only I have a concern regarding we are trying to create PR for |
Thank you @jakecoffman. Just checked and the solution is going to work. Just need to tested it. Thank you. |
969877c
to
6f7c0ce
Compare
@jakecoffman , @abdulapopoola the problem is fixed in the way mentioned in the comment. It is ready for review. |
end | ||
|
||
context "when the dependency is not vulnerable" do | ||
before { allow(checker).to receive(:vulnerable?).and_return(false) } |
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.
It's a bad practice to mock the class you're testing.
I would suggest looking at another test in this file that uses @dependabot-fixtures
. Create a minimal reproduction of the NoChangeError
in that org and use it in this test to verify lowest_resolvable_security_fix_version
returns nil
.
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.
fixed
e09ee27
to
c05f693
Compare
7506ddf
to
ca61ec2
Compare
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.
This is great, nice work!
ca61ec2
to
5f93e92
Compare
Thanks for all the feedback. |
The error is going to show like following in the log.
|
Description:
What are you trying to accomplish?
This PR aims to fix a bug for the
npm_and_yarn
ecosystem. The changes include:nil
when there are conflicting dependencies and the dependency is not top-level.npm_and_yarn
ecosystem.This change is necessary to ensure that our system correctly handles and reports vulnerable transitive dependencies within the
npm_and_yarn
ecosystem, improving our ability to maintain a clear and accurate dependency relationship.Anything you want to highlight for special attention from reviewers?
This change specifically addresses the bug related to conflicting transitive dependencies in the
npm_and_yarn
ecosystem.How will you know you've accomplished your goal?
npm_and_yarn
ecosystem.nil
for transitive dependencies with conflicts.Checklist