This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix branch pruning bugs in move/remove actions #10655
Closed
Closed
Conversation
This file contains 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
b05994c
to
4220f5c
Compare
Previously we were clearing it during the commit phase, but this has the problem of wiping out any node_modules installed inside it. This moves that to happen just before we put the node_modules back.
Previously we ran the commit phase TWICE, once after the remove phase, and then once after everything completed. We're ditching that intermediary commit as removes no longer take advantage of them.
4220f5c
to
5ee6835
Compare
@zkat sez 🐑 |
Landed as a whole bunch of commits for |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This is prooooobably the rest of the ENOENT / missing module / etc errors in 3.x:
So npm@3 generates a list of actions to take against the tree on disk. With the exception of lifecycle scripts, it expects these all to be able to act independently without interfering with each other.
This means, for instance, that one should be able to upgrade
b
ina→b→c
without reinstallingc
.That works fine btw.
But it also means that the move action should be able to move
b
ina→b→c@1.0.1
toa→d→b→c@1.0.2
without moving or removingc@1.0.1
and while leavingc@1.0.2
in place if it was already installed.That is, the
move
action moves an individual node, replacing itself with an empty spot if it had children. It's not a graft operation.So, we already took care to leave
c@1.0.1
in place, but were stomping on the destination and soc@1.0.2
was being removed.There was also a bug w/
remove
where it was pruning the entire tree at the remove point, prior to running moves and adds.This was fine most of the time, but if we were moving one of the deps out from inside it, kaboom.
Really, there was no need for this. I suspect this dates to a point where move was not able to handle its targets already existing.
The reason we didn't see any of these bugs before in Travis was that all of these actions were applying to deps bundled with npm. Previously bundled deps didn't go through the normal installer actions.
Really though, we shouldn't be using moves to try to optimize away bundled deps 'cause we're going to have to extract those regardless so it just adds complexity without any benefit.