Optimise dedupe to skip install when nothing to dedupe#6974
Optimise dedupe to skip install when nothing to dedupe#6974jordanoverbye wants to merge 4 commits intoyarnpkg:masterfrom
Conversation
c674609 to
2577eed
Compare
|
Only LGTM, but I'd like to have a second pair of eyes to look over it. |
2a34bf8 to
08a853a
Compare
|
Thank you for the review @clemyan! I've just pushed a change to the versions file so only |
2ba936d to
161675d
Compare
|
Hey ! One question:
Which lockfile updates is it causing ? Are they really unnecessary ? Since the lockfile is supposed to be stable I'd assume that any lockfile update there would be triggered by something, and just skipping it could cause issues. |
|
Hey @arcanis, The lockfile updates I was to referring to are the ones that happen when Currently, the dedupe command always calls With this PR:
So the "unnecessary" part refers specifically to the case where the dedupe operation found nothing to do - in that scenario, there's no reason to run an install or touch the lockfile at all. The lockfile should already be stable since we haven't made any changes. |
What's the problem this PR addresses?
Currently the
dedupecommand always runsproject.installWithNewReport()even when no packages need deduplication, causing unnecessary installs and lockfile updates.How did you fix it?
Exit early if no packages need deduping. Only run
project.installWithNewReport()when necessary.Checklist