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

fix dependency duplication across multiple groups #8106

Merged
merged 12 commits into from
Oct 2, 2023

Conversation

jakecoffman
Copy link
Member

@jakecoffman jakecoffman commented Sep 28, 2023

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.

@jakecoffman jakecoffman force-pushed the jakecoffman/fix-grouping-duplication branch from 7eb5668 to 156313a Compare September 28, 2023 23:39
@jakecoffman jakecoffman changed the title [WIP] fix grouping duplication fix grouping duplication Sep 29, 2023
@jakecoffman jakecoffman marked this pull request as ready for review September 29, 2023 14:51
@jakecoffman jakecoffman requested a review from a team as a code owner September 29, 2023 14:51
@jakecoffman jakecoffman changed the title fix grouping duplication fix dependency duplication across multiple groups Sep 29, 2023
Copy link
Member

@jurre jurre left a 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! 🎉

@jakecoffman jakecoffman enabled auto-merge (squash) October 2, 2023 13:11
@jakecoffman jakecoffman merged commit 4f0d5ee into main Oct 2, 2023
80 checks passed
@jakecoffman jakecoffman deleted the jakecoffman/fix-grouping-duplication branch October 2, 2023 13:24
@edmorley
Copy link

edmorley commented Oct 6, 2023

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 libcnb-data and libcnb-package packages:
heroku/languages-github-actions#152

...even though they are covered by this (earlier in the Dependabot config definition) group:
heroku/languages-github-actions#148

Our Dependabot config is here:
https://github.com/heroku/languages-github-actions/blob/main/.github/dependabot.yml

And I reported this originally here:
#7939

Which was then marked as a duplicate of #7915 (which this PR closed).

@edmorley
Copy link

edmorley commented Oct 6, 2023

The logs of the most recent Dependabot retrigger:

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

Successfully merging this pull request may close these issues.

Same dependencies showing up in multiple groups
3 participants