-
Notifications
You must be signed in to change notification settings - Fork 954
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
fix dependency duplication across multiple groups #8106
Conversation
7eb5668
to
156313a
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.
Yes, that makes sense! 🎉
Hi! Has this change been deployed already? (As part of https://github.com/dependabot/dependabot-core/releases/tag/v0.233.0) It's just that we're still seeing duplication, which I had thought would be fixed by this. For example, this grouped PR includes the ...even though they are covered by this (earlier in the Dependabot config definition) group: Our Dependabot config is here: And I reported this originally here: Which was then marked as a duplicate of #7915 (which this PR closed). |
The logs of the most recent Dependabot retrigger:
|
fixes #7915 and possibly others
If you define multiple groups that all match the same dependencies, the dependencies will show up in each PR.
This fix takes the dependencies that have already been handled and adds them to a Set in the DependencySnapshot that we can use to skip dependencies that have already been handled in previous groups.
This also adds pre-processing of the existing pull requests. This is needed because imagine due to semver grouping, or a change in the manifest, a PR is created for a certain dependency and the PR is still open. That group may be further down the list, but now an earlier group wants to create a PR with that dependency. Unless we pre-process the existing PRs, then it will create a duplicate again.
And finally when encountering an existing grouped PR, this now adds the dependencies listed in the existing PR record of the job definition, rather than the ones calculated from patterns, etc. This means if a group happens to also update a dependency outside of the group, like for instance because it has a peer-dependency on it, Dependabot won't open another PR bumping it.