fix(arborist): only forward Link overrides when a rule names a target dep#9359
Open
manzoorwanijk wants to merge 1 commit into
Open
fix(arborist): only forward Link overrides when a rule names a target dep#9359manzoorwanijk wants to merge 1 commit into
manzoorwanijk wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In continuation of our exploration of using
install-strategy=linkedin the Gutenberg monorepo, which powers the WordPress Block Editor.npm ciin v11.14.x rejects lockfiles that v11.13.x accepts, withEUSAGE: Invalid: lock file's <pkg>@<old> does not satisfy <pkg>@<new>for any workspace^range that has had a newer matching patch published since the lockfile was generated.Bisected to commit e7805c3 (#9198). The new
Link.recalculateOutEdgesOverrideswas forwarding the link'sOverrideSetto the target unconditionally — even when the OverrideSet had no rule naming any of the target's deps. That settarget.overridesfromundefinedto the root's generic OverrideSet, and the cascade causedcanReplaceWith's "overrides equal" branch to flipplaceDep's decision fromKEEPtoREPLACEfor an edge the lockfile already satisfied.validateLockfilethen rejected the resulting ideal tree.Fixed by gating the forward on the OverrideSet actually containing a rule that names a dep the target depends on. If no rule matches, don't forward —
target.overridesstaysundefinedand downstream placement matches v11.13.0.#9198's intent is preserved: when the override DOES name a dep of the target, propagation still fires. #9198's existing test still passes (including
bar edge spec is overridden to 2.0.0). Added a regression test for the no-matching-rule case; verified failing before this fix and passing after.References
Fixes #9357
Refines #9198