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

NPM security update job doesn't pick minimal version when it's a transitive dependency #11152

Open
ryanbrandenburg opened this issue Dec 18, 2024 · 1 comment

Comments

@ryanbrandenburg
Copy link
Contributor

This line causes Dependabot-Core to choose the highest applicable version for transitive dependencies in NPM which can lead to weird behavior. Take this example repo and run it against this job:

job:
   dependencies:
   - cross-spawn
   security-advisories:
   - dependency-name: cross-spawn
     affected-versions:
     - '>= 7.0.0, < 7.0.5'
     - '>= 0, < 6.0.6'
   existing-pull-requests:
   - - dependency-name: cross-spawn
       dependency-version: 7.0.5
   security-updates-only: true
   updating-a-pull-request: true
   commit-message-options:
     prefix: '[SECURITY] '
   experiments:
     lead_security_dependency: true
   source:
     directories:
     - /
     provider: github
     repo: ryanbrandenburg/crossspawn
     branch: main
   package-manager: npm_and_yarn

Which is modeled off a real scenario. The existing PR (with version 7.0.5) is not getting rebased because we try to create a new one instead (due to this check failing). Of particular note to this scenerio is that cross-spawn 7.0.6 was published after the existing PR was created.

@github-actions github-actions bot added L: dart:pub Dart packages via pub L: javascript labels Dec 18, 2024
@abdulapopoola abdulapopoola removed the L: dart:pub Dart packages via pub label Dec 19, 2024
@ryanbrandenburg
Copy link
Contributor Author

@abdulapopoola I created a discussion for this #11160. Let me know if there's additional context that would be good on there.

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

No branches or pull requests

2 participants