-
Notifications
You must be signed in to change notification settings - Fork 1
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
Phased Builds DIFF (do not merge) #1
base: main
Are you sure you want to change the base?
Conversation
rigs/acme-classic-rig/profiles/library/config/rush-project.json
Outdated
Show resolved
Hide resolved
@@ -168,6 +168,54 @@ | |||
// } | |||
], | |||
|
|||
/* PHASES */ | |||
"phases": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are these phases mapped to Rush actions? I think we're missing the definition in "commands"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a realistic example, we should show the intended Rush shell commands for realistic everyday tasks:
- How do I build everything including all phases?
- How do I update the README and do nothing else?
- How do I do a
--lite
build where we skip unit tests and linting? - For these things, what's the equivalent of
rush rebuild
?
Maybe the answer is that initially each of these problems requires a completely new command action name. (rush build-lite
?) But if so we can still enumerate them to get a sense of how painful that feature cut will be in practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are great questions.
Since presumably the monorepo had this --lite
need before phases, I implemented a solution in main
(a custom build script that lets it properly handle --lite
from the rushx command line).
That --lite
flag is rough for the phased approach though. As an example, I imagined that the user wanted build.js
to pass --lite
both to Heft and to the push_notes.js
custom script. If I invent a new phased command build-lite
, then it can have phases ['_phase:compile', '_phase:readme_updater']
etc., and you don't need to pass --lite
to Heft because you've baked that into the phase. But that's not generically possible if you were doing something with the --lite
flag.
I guess one possible approach is to implement lite phases, push-notes
and push-notes-lite
, and only include the appropriate one. But they'll never share build cache, and would have to be leaf nodes (no dependents), otherwise how would a dependent phase know which one to rely on.
@octogonz OK, this should be ready for another pass. Rough summary:
|
Some phased command-related tweaks
Updates to reflect schema changes.
Move incremental back to the commands.
Various updates for microsoft/rushstack#3113
Remove the explicit "rebuild" command configuration.
Update rush-project.json schema.
…d options, which have temporarily been removed.
Comment out parameter with addPhasesToCommand and skipPhasesForCommand options, which have temporarily been removed.
Demo
Example PR showing the changes made to enable phased builds.
The
main
branch is buildable with current rush (rush install && rush build
). It has some setup (for example, it adds the"_phase:x"
command definitions to thepackage.json
files), but doesn't include anything that would be invalid configuration for current rush.This
phased
branch is not buildable with current rush, but in theory, it is buildable with a rushstack branch that implements the spec described in microsoft/rushstack#2300.