Skip to content

Only install missing external dependencies during bootstrap - #199

Merged
jamiebuilds merged 1 commit into
lerna:masterfrom
gigabo:bootstrap-missing
Jun 10, 2016
Merged

jamiebuilds merged 1 commit into
lerna:masterfrom
gigabo:bootstrap-missing

Conversation

@gigabo

@gigabo gigabo commented Jun 9, 2016

Copy link
Copy Markdown
Contributor

This makes bootstrap in a repo that has been bootstrapped previously much faster.

This addresses #125.

Comment thread test/BootstrapCommand.js
import assertStubbedCalls from "./_assertStubbedCalls";

describe("BootstrapCommand", () => {
let testDir;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff is cluttered here due to indentation changes (added a nested describe layer).

I've left the original test unchanged, and added three additional tests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?w=1 makes it a clean diff

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful. Thank you.

@jamiebuilds

Copy link
Copy Markdown
Contributor

Looks like the tests aren't stubbing out npm completely which is causing it to fail in CI

@gigabo

gigabo commented Jun 9, 2016

Copy link
Copy Markdown
Contributor Author

Yeah, that's strange.

It's stubbing ChildProcessUtilities.exec, which is what NpmUtilities.installInDir uses.

Not able to repro locally. 😕

@jamiebuilds

Copy link
Copy Markdown
Contributor

I can take a look later. It might help if travis did cat lerna-debug.log if tests failed, so if you want to modify the script to do that it may help you debug CI.

@gigabo
gigabo force-pushed the bootstrap-missing branch from 57935e1 to e3d0428 Compare June 9, 2016 22:56
This makes bootstrap in a repo that has been bootstrapped previously much faster.

This addresses lerna#125.
@gigabo
gigabo force-pushed the bootstrap-missing branch from e3d0428 to 7d1863b Compare June 9, 2016 23:00
@gigabo

gigabo commented Jun 9, 2016

Copy link
Copy Markdown
Contributor Author

That whole test was actually invalid. It was intended to test that dependency linking doesn't happen on warm bootstrap, but this patch actually didn't wind up addressing that (no real need -- it's cheap).

It was only incidentally passing locally because I had a premature call to done() in there. It was a race that was just never lost on my laptop.

The remaining two new tests exercise the functionality that is actually provided by this patch.

@gigabo

gigabo commented Jun 10, 2016

Copy link
Copy Markdown
Contributor Author

This, plus #204, takes our bootstrap on a warm repo from ~8 minutes to a half second. 🚀

@jamiebuilds

jamiebuilds commented Jun 10, 2016 •

Copy link
Copy Markdown
Contributor

Happy to merge this as is. But should there be a flag to force it to reinstall things?

@jamiebuilds

Copy link
Copy Markdown
Contributor

Actually no, I'll wait for someone to request that.

@jamiebuilds
jamiebuilds merged commit ee9a12b into lerna:master Jun 10, 2016
gigabo added a commit to gigabo/react-server that referenced this pull request Jun 10, 2016
This picks up some patches that will help us out:

- lerna/lerna#181
- lerna/lerna#196
- lerna/lerna#198
- lerna/lerna#199
gigabo added a commit to redfin/react-server that referenced this pull request Jun 13, 2016
* Upgrade lerna-2.0.0-beta.18

This picks up some patches that will help us out:

- lerna/lerna#181
- lerna/lerna#196
- lerna/lerna#198
- lerna/lerna#199

* Use `lerna clean` for `npm run nuke`
davidalber pushed a commit to davidalber/react-server that referenced this pull request Jul 24, 2016
* Upgrade lerna-2.0.0-beta.18

This picks up some patches that will help us out:

- lerna/lerna#181
- lerna/lerna#196
- lerna/lerna#198
- lerna/lerna#199

* Use `lerna clean` for `npm run nuke`
@lock

lock Bot commented Dec 28, 2018

Copy link
Copy Markdown

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants