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

Run yarn dedupe entirely instead of specific package(s) #9388

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smorimoto
Copy link

Closes #5830

@smorimoto smorimoto requested a review from a team as a code owner March 29, 2024 13:33
@smorimoto smorimoto mentioned this pull request Mar 29, 2024
1 task
Signed-off-by: Sora Morimoto <sora@morimoto.io>
@jurre
Copy link
Member

jurre commented Apr 26, 2024

We chose specifically to only dedupe the package being updated to keep the diff Dependabot generates as small as possible.

This would result in Dependabot making changes unrelated to the dependency being updated and I am not sure that it's the right thing to do.

There should be previous discussions about this in the issue tracker as well. See #5830

I'm curious to hear some more reasons about why you think this would be preferable, and why it's Dependabots responsibility to do this

@tierra
Copy link

tierra commented Apr 29, 2024

The existing dedupe definitely isn't covering all situations that result in duplicate dependencies being introduced specifically by the same Dependabot bumps. I still quite regularly have to manually run a full dedupe on Dependabot PRs to pass dedupe checks.

Does the existing dedupe include all downstream dependencies of the package(s) being bumped? It doesn't seem like it does.

I subscribed to this issue (and PR) initially without even realizing that it does apparently run that (restricted) dedupe because I thought it just didn't run dedupe at all, given how often I have to manually address these.

An alternative approach that would be helpful is exposing a new optional setting to perform a full dedupe instead, thus still offering the current approach by default (assuming this is actually working as desired for most projects).

@deivid-rodriguez
Copy link
Contributor

Maybe Dependabot could try a dedupe before the update, and then do the following:

  • If that dedupe does not cause any lockfile changes, then run a full dedupe after the update since any duplications will have been caused by Dependabot for sure.
  • If that dedupe already causes lockfile changes, then don't run dedupe at all since the original lockfile was already not deduped.

In any case, it'd be good to see a realworld example of Dependabot creating duplications, also to verify that the proposed approach fixes it.

@benjie
Copy link

benjie commented May 9, 2024

In any case, it'd be good to see a realworld example of Dependabot creating duplications, also to verify that the proposed approach fixes it.

Here's an example:

https://github.com/graphile/gatsby-source-pg-example/pull/34/files

It upgraded express, which resulted in an upgrade of body-parser from 1.20.1 to 1.20.2, but it left the previous version of body-parser around causing a duplicate that wasn't previously present.

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

Successfully merging this pull request may close these issues.

Deduplicate Yarn Dependencies
5 participants