[rush] Implementation of Cobuild feature#3949
Conversation
94cbbbd to
dfc0456
Compare
dfc0456 to
dbf758f
Compare
dmichon-msft
left a comment
There was a problem hiding this comment.
Way too much is happening in ShellOperationRunner that has nothing to do with its task of "execute a shell command and log its stdout/stderr". Cobuilds should be a wrapper, not part of ShellOperationRunner (so, for that matter, should the build cache, so that we get cache support for other runners).
dmichon-msft
left a comment
There was a problem hiding this comment.
Some more design feedback.
|
This is looking really nice. I have a comment about configuration here -- I wonder if there's too much (potentially unneeded) functionality. Here's some (admittedly opinionated) suggestions:
Let me know what you think! |
|
First, thanks you for reviewing this! @elliot-nelson For 2 and 3, Do you mean that "context id" should be not configured in the "cobuid.json", instead, "context id" must be specified by environment variable ("RUSH_COBUILD_CONTEXT_ID") or CLI parameter(not designed yet)? If so, i am OK to remove the "context id pattern" part. A further question from my side: Should For 4, Do you mean that the configuration for CobuildRedisPlugin should get the functionality to specify a env var? such as rush-redis-cobuild-plugin.json {
"url": "redis://a.b.c.d:6379",
"password": "${REDIS_PASS}"
} where REDIS_PASS is a env var from predefined variable in CI. |
|
@chengcyber - I've come up with a repro for the issue we're seeing. Steps:
You should see output that looks like this: |
dmichon-msft
left a comment
There was a problem hiding this comment.
For safety, please also update OperationMetadataManager#tryRestoreAsync to ensure that control cannot exit the function without cleaning up logReadStream, e.g. by instantiating it outside of the try and cleaning it up in a finally block.
|
🚀 A prerelease of this branch is published as version
|
[rush] Separate Skip and Build Cache, add flag

Summary
Closes #3485
Details
[ ] Add a new lifecycle to PhasedCommandHooks, which receives current results from operationManager. And periodically called for reporting current progress from a global view. The use case would be like sending operation status to a data server, and repo maintainer can build a cobuild dashboard with the realtime data.(will be another MR.How it was tested
rush-redis-cobuild-plugin-integration-testa. test redisLockProvider
b. test cobuild for sandbox repo via running VS Code tasks.
Preparation
Integration test folder: build-tests/rush-redis-cobuild-plugin-integration-test
Sandbox repo folder: build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/repo
cd sandbox/repo rush updateCase 1: Normal build, Cobuild is disabled because of missing RUSH_COBUILD_CONTEXT_ID
rm -rf common/temp/build-cache && node ../../lib/runRush.js --debug cobuildExpected behavior: Cobuild feature is disabled. Build cache is saved/restored as normal.
Case 2: Cobuild enabled by specifying RUSH_COBUILD_CONTEXT_ID and Redis authentication
rm -rf common/temp/build-cache && RUSH_COBUILD_CONTEXT_ID=foo REDIS_PASS=redis123 RUSH_COBUILD_RUNNER_ID=runner1 node ../../lib/runRush.js --debug cobuildExpected behavior: Cobuild feature is enabled. Run command successfully.
You can also see cobuild related logs in the terminal.
Case 3: Cobuild enabled, run two cobuild commands in parallel
Open predefined
.vscode/redis-cobuild.code-workspacein Visual Studio Code.Clear redis server
# Under rushstack/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/repo rm -rf common/temp/build-cacheTasks: Run Taskand selectcobuild.Expected behavior: Cobuild feature is enabled, cobuild related logs out in both terminals.
Case 4: Cobuild enabled, run two cobuild commands in parallel, one of them failed
Open predefined
.vscode/redis-cobuild.code-workspacein Visual Studio Code.Making the cobuild command of project "A" fails
sandbox/repo/projects/a/package.json
"scripts": { - "_phase:build": "node ../build.js a", + "_phase:build": "exit 1", }# Under rushstack/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/repo rm -rf common/temp/build-cacheTasks: Run Taskand selectcobuild.Expected behavior: Cobuild feature is enabled, cobuild related logs out in both terminals. These two cobuild commands fail because of the failing build of project "A". And, one of them restored the failing build cache created by the other one.
Impacted documentation
A brand new experimental feature!