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

fix(workspace): delegate to local ng script to allow customization #1544

Merged
merged 1 commit into from
Jul 8, 2019

Conversation

juristr
Copy link
Member

@juristr juristr commented Jul 1, 2019

Current Behavior (This is the behavior we have today, before the PR is merged)

When invoking the various NX CLI commands in non-parallel mode, it directly invokes the ng binary in the node_modules folder. That prevents applying customizations such as setting the memory limits.

Expected Behavior (This is the new behavior we can expect after the PR is merged)

The behavior should be unified between parallel execution (which uses the ng script in the package.json) and the non-parallel execution.

Issue

#1110

@juristr
Copy link
Member Author

juristr commented Jul 1, 2019

@vsavkin Just a quick question. I pushed this WIP PR with a quick & dirty implementation of changing the current implementation, s.t. it uses the ng script in the package.json. Still need to do some further testing and some refactoring.

I was just wondering, because in the implementation right now I've used the npm-run-all script but passing in false for the parallel option since we want to execute it serially. The code could actually now be refactored between the parallel & serial execution as it differs only in a couple of flags. However I noticed that for the parallel execution, the failedProjects don't seem to be used:

let failedProjects = [];

Is this intentional and should be preserved?

@alfaproject
Copy link
Contributor

I'm actually surprised there's a need to rely on the user to have the ng script in package.json. Why not always use the package from node modules directly in all cases?

@juristr
Copy link
Member Author

juristr commented Jul 1, 2019

@alfaproject well that would be another option. but based on a discussion with @vsavkin relying on the package.json script allows the user to better customize the invocation of the ng script. Otherwise it would be hidden by NX

@alfaproject
Copy link
Contributor

Right, I guess there's a valid argument for both ways

@vsavkin
Copy link
Member

vsavkin commented Jul 3, 2019

@juristr I like your implementation. I think using npm-run-all is a good idea.

I think we should use failedProjects for parallel execution as well. I imagine it was easier to do it the way it is done.

@juristr
Copy link
Member Author

juristr commented Jul 4, 2019

@vsavkin Alright awesome. Gonna clean up the implementation and complete this PR 👍

@juristr juristr force-pushed the fix/out-of-memory branch 2 times, most recently from 9393983 to 2fd45ae Compare July 7, 2019 20:21
@juristr juristr marked this pull request as ready for review July 7, 2019 20:23
@juristr
Copy link
Member Author

juristr commented Jul 7, 2019

Alright, should be ready for review @vsavkin. There are some tests that aren't passing (even on master), didn't have the time to check that though.

Another thing I noticed, is that the message "You can isolate the above projects by passing --only-failed" is not always printed. Probably due to this line

https://github.com/nrwl/nx/blob/master/packages/workspace/src/command-line/workspace-results.ts#L36

..if the failing project is the 1st one to run, then the message isn't being printed. Although IMHO it should. Do you know what's the reasoning behind startedWithFailedProjects flag? What is it for?

@juristr juristr force-pushed the fix/out-of-memory branch from 2fd45ae to 10b4086 Compare July 8, 2019 22:20
@vsavkin
Copy link
Member

vsavkin commented Jul 8, 2019

@juristr CI passed, so it might have been something on your local.

I think the reasoning behind startedWithFailedProjects is to tell the user that even though the provided command passed, it doesn't mean that the build is green and that they need to rerun it without the flag.

I think the PR looks good. I'm going to merge it. Thank you @juristr !

@vsavkin vsavkin merged commit 82ee4f1 into nrwl:master Jul 8, 2019
@juristr
Copy link
Member Author

juristr commented Jul 9, 2019

CI passed, so it might have been something on your local.

There was actually a breaking integration test which I fixed and pushed yesterday in this commit 🙂

@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
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