From 757a986768f6c3834a5e524d0ca673e1774ac7c2 Mon Sep 17 00:00:00 2001 From: Aramis Sennyey Date: Thu, 8 Aug 2024 18:40:32 -0400 Subject: [PATCH 1/7] feat(cobuilds): allow orchestration without using the build cache --- .../README.md | 18 +++++++++ .../projects/e/config/rush-project.json | 12 +++--- ...obuild-orchestration_2024-08-08-23-11.json | 10 +++++ common/reviews/api/rush-lib.api.md | 4 ++ .../rush-lib/src/api/CobuildConfiguration.ts | 8 ++++ .../src/api/EnvironmentConfiguration.ts | 26 +++++++++++++ .../src/api/RushProjectConfiguration.ts | 5 +++ .../operations/CacheableOperationPlugin.ts | 38 +++++++++++++++---- .../src/schemas/rush-project.schema.json | 4 ++ 9 files changed, 111 insertions(+), 14 deletions(-) create mode 100644 common/changes/@microsoft/rush/sennyeya-allow-cobuild-orchestration_2024-08-08-23-11.json diff --git a/build-tests/rush-redis-cobuild-plugin-integration-test/README.md b/build-tests/rush-redis-cobuild-plugin-integration-test/README.md index cde55a7bff7..84f4145f2a6 100644 --- a/build-tests/rush-redis-cobuild-plugin-integration-test/README.md +++ b/build-tests/rush-redis-cobuild-plugin-integration-test/README.md @@ -150,3 +150,21 @@ rm -rf common/temp/build-cache 5. Open command palette (Ctrl+Shift+P or Command+Shift+P) and select `Tasks: Run Task` and select `cobuild`. 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. + +#### Case 5: Sharded cobuilds +Navigate to the sandbox for sharded cobuilds, +```sh +cd sandbox/sharded-repo +``` + +Next, start up your Redis instance, +```sh +docker compose down && docker compose up -d +``` + +Then, open 2 terminals and run this in each (changing the RUSH_COBUILD_RUNNER_ID across the 2 terminals), +```sh +rm -rf common/temp/build-cache && RUSH_COBUILD_CONTEXT_ID=foo REDIS_PASS=redis123 RUSH_COBUILD_RUNNER_ID=runner1 RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED=1 node ../../lib/runRush.js cobuild -p 10 --timeline +``` + +If all goes well, you should see a bunch of operation with `- shard xx/yy`. Operations `h (build)` and `e (build)` are both sharded heavily and should be cobuild compatible. To validate changes you're making, ensure that the timeline view for all of the shards of those 2 operations are cobuilt across both terminals. If they're not, something is wrong with your update. \ No newline at end of file diff --git a/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/e/config/rush-project.json b/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/e/config/rush-project.json index aae24577ea5..98da067a193 100644 --- a/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/e/config/rush-project.json +++ b/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/e/config/rush-project.json @@ -1,18 +1,16 @@ { + "$schema": "../../../../../../../libraries/rush-lib/src/schemas/rush-project.schema.json", "operationSettings": [ { "operationName": "_phase:build", "outputFolderNames": ["dist"], - "sharding": { - "count": 75, - "shardOperationSettings": { - "weight": 10 - } - } + "allowCobuildOrchestration": true, + "disableBuildCacheForOperation": true }, { "operationName": "_phase:build:shard", - "weight": 1 + "weight": 1, + "allowCobuildOrchestration": true } ] } diff --git a/common/changes/@microsoft/rush/sennyeya-allow-cobuild-orchestration_2024-08-08-23-11.json b/common/changes/@microsoft/rush/sennyeya-allow-cobuild-orchestration_2024-08-08-23-11.json new file mode 100644 index 00000000000..1ece36cf965 --- /dev/null +++ b/common/changes/@microsoft/rush/sennyeya-allow-cobuild-orchestration_2024-08-08-23-11.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Adds a new experiment for cobuilds to allow uncacheable operations to benefit from cobuild orchestration without using the build cache.", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/common/reviews/api/rush-lib.api.md b/common/reviews/api/rush-lib.api.md index b1315c3252d..7e386806629 100644 --- a/common/reviews/api/rush-lib.api.md +++ b/common/reviews/api/rush-lib.api.md @@ -104,6 +104,7 @@ export class CobuildConfiguration { readonly cobuildContextId: string | undefined; readonly cobuildFeatureEnabled: boolean; readonly cobuildLeafProjectLogOnlyAllowed: boolean; + readonly cobuildOrchestrationOnlyAllowed: boolean; readonly cobuildRunnerId: string; // (undocumented) createLockProviderAsync(terminal: ITerminal): Promise; @@ -234,6 +235,7 @@ export class EnvironmentConfiguration { static get buildCacheWriteAllowed(): boolean | undefined; static get cobuildContextId(): string | undefined; static get cobuildLeafProjectLogOnlyAllowed(): boolean | undefined; + static get cobuildOrchestrationOnlyAllowed(): boolean | undefined; static get cobuildRunnerId(): string | undefined; // Warning: (ae-forgotten-export) The symbol "IEnvironment" needs to be exported by the entry point index.d.ts // @@ -269,6 +271,7 @@ export const EnvironmentVariableNames: { readonly RUSH_COBUILD_CONTEXT_ID: "RUSH_COBUILD_CONTEXT_ID"; readonly RUSH_COBUILD_RUNNER_ID: "RUSH_COBUILD_RUNNER_ID"; readonly RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: "RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED"; + readonly RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED: "RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED"; readonly RUSH_GIT_BINARY_PATH: "RUSH_GIT_BINARY_PATH"; readonly RUSH_TAR_BINARY_PATH: "RUSH_TAR_BINARY_PATH"; readonly _RUSH_RECURSIVE_RUSHX_CALL: "_RUSH_RECURSIVE_RUSHX_CALL"; @@ -625,6 +628,7 @@ export interface IOperationRunnerContext { // @alpha (undocumented) export interface IOperationSettings { + allowCobuildOrchestration?: boolean; dependsOnAdditionalFiles?: string[]; dependsOnEnvVars?: string[]; disableBuildCacheForOperation?: boolean; diff --git a/libraries/rush-lib/src/api/CobuildConfiguration.ts b/libraries/rush-lib/src/api/CobuildConfiguration.ts index 6d274ec43bd..f2933e509c6 100644 --- a/libraries/rush-lib/src/api/CobuildConfiguration.ts +++ b/libraries/rush-lib/src/api/CobuildConfiguration.ts @@ -69,6 +69,13 @@ export class CobuildConfiguration { */ public readonly cobuildLeafProjectLogOnlyAllowed: boolean; + /** + * If true, Rush will automatically handle the leaf project with build cache "disabled" by writing + * to the cache in a special "log files only mode". This is useful when you want to use Cobuilds + * to improve the performance in CI validations and the leaf projects have not enabled cache. + */ + public readonly cobuildOrchestrationOnlyAllowed: boolean; + private _cobuildLockProvider: ICobuildLockProvider | undefined; private readonly _cobuildLockProviderFactory: CobuildLockProviderFactory; private readonly _cobuildJson: ICobuildJson; @@ -81,6 +88,7 @@ export class CobuildConfiguration { this.cobuildRunnerId = EnvironmentConfiguration.cobuildRunnerId || uuidv4(); this.cobuildLeafProjectLogOnlyAllowed = EnvironmentConfiguration.cobuildLeafProjectLogOnlyAllowed ?? false; + this.cobuildOrchestrationOnlyAllowed = EnvironmentConfiguration.cobuildOrchestrationOnlyAllowed ?? false; this._cobuildLockProviderFactory = cobuildLockProviderFactory; this._cobuildJson = cobuildJson; diff --git a/libraries/rush-lib/src/api/EnvironmentConfiguration.ts b/libraries/rush-lib/src/api/EnvironmentConfiguration.ts index 7826651d1d2..6bcd67ae1e6 100644 --- a/libraries/rush-lib/src/api/EnvironmentConfiguration.ts +++ b/libraries/rush-lib/src/api/EnvironmentConfiguration.ts @@ -166,6 +166,12 @@ export const EnvironmentVariableNames = { */ RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: 'RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED', + /** + * If this variable is set to "1", When getting distributed builds, Rush will allow uncacheable projects to still leverage + * the cobuild feature. This is useful when you want to speed up operations that can't (or shouldn't) be cached. + */ + RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED: 'RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED', + /** * Explicitly specifies the path for the Git binary that is invoked by certain Rush operations. */ @@ -248,6 +254,8 @@ export class EnvironmentConfiguration { private static _cobuildLeafProjectLogOnlyAllowed: boolean | undefined; + private static _cobuildOrchestrationOnlyAllowed: boolean | undefined; + private static _gitBinaryPath: string | undefined; private static _tarBinaryPath: string | undefined; @@ -372,6 +380,15 @@ export class EnvironmentConfiguration { return EnvironmentConfiguration._cobuildLeafProjectLogOnlyAllowed; } + /** + * If set, enables or disables the cobuild leaf project log only feature. + * See {@link EnvironmentVariableNames.RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED} + */ + public static get cobuildOrchestrationOnlyAllowed(): boolean | undefined { + EnvironmentConfiguration._ensureValidated(); + return EnvironmentConfiguration._cobuildOrchestrationOnlyAllowed; + } + /** * Allows the git binary path to be explicitly provided. * See {@link EnvironmentVariableNames.RUSH_GIT_BINARY_PATH} @@ -521,6 +538,15 @@ export class EnvironmentConfiguration { break; } + case EnvironmentVariableNames.RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED: { + EnvironmentConfiguration._cobuildOrchestrationOnlyAllowed = + EnvironmentConfiguration.parseBooleanEnvironmentVariable( + EnvironmentVariableNames.RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED, + value + ); + break; + } + case EnvironmentVariableNames.RUSH_GIT_BINARY_PATH: { EnvironmentConfiguration._gitBinaryPath = value; break; diff --git a/libraries/rush-lib/src/api/RushProjectConfiguration.ts b/libraries/rush-lib/src/api/RushProjectConfiguration.ts index 279c6f92b64..44e8832e52d 100644 --- a/libraries/rush-lib/src/api/RushProjectConfiguration.ts +++ b/libraries/rush-lib/src/api/RushProjectConfiguration.ts @@ -134,6 +134,11 @@ export interface IOperationSettings { * determined by the -p flag. */ weight?: number; + + /** + * If true, this operation can use cobuilds for orchestration without restoring build cache entries. + */ + allowCobuildOrchestration?: boolean; } interface IOldRushProjectJson { diff --git a/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts b/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts index a29db3d9c97..c3d5b8e91d9 100644 --- a/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts +++ b/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts @@ -99,6 +99,25 @@ export class CacheableOperationPlugin implements IPhasedCommandPlugin { ? new DisjointSet() : undefined; + for (const operation of recordByOperation.keys()) { + if ( + operation.settings?.allowCobuildOrchestration && + !cobuildConfiguration?.cobuildOrchestrationOnlyAllowed + ) { + throw new Error( + `Operation ${operation.name} is not allowed to run without the cobuild orchestration experiment enabled. You must use the RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED environment variable to enable that mode.` + ); + } + if ( + operation.settings?.allowCobuildOrchestration && + !operation.settings.disableBuildCacheForOperation + ) { + throw new Error( + `Operation ${operation.name} must have disableBuildCacheForOperation set to true when using the cobuild orchestration experiment. This is to prevent implicit cache dependencies for this operation.` + ); + } + } + await Async.forEachAsync( recordByOperation.keys(), async (operation: Operation) => { @@ -258,7 +277,8 @@ export class CacheableOperationPlugin implements IPhasedCommandPlugin { phase, configHash, terminal: buildCacheTerminal, - operationMetadataManager + operationMetadataManager, + operation: record.operation }); // Try to acquire the cobuild lock @@ -359,15 +379,17 @@ export class CacheableOperationPlugin implements IPhasedCommandPlugin { if (cobuildCompletedState) { const { status, cacheId } = cobuildCompletedState; + if (record.operation.settings?.allowCobuildOrchestration) { + // This should only be enabled if the experiment for cobuild orchestration is enabled. + return status; + } + const restoreFromCacheSuccess: boolean = await restoreCacheAsync( cobuildLock.projectBuildCache, cacheId ); if (restoreFromCacheSuccess) { - if (cobuildCompletedState) { - return cobuildCompletedState.status; - } return status; } } else if (!buildCacheContext.isCacheReadAttempted && buildCacheContext.isCacheReadAllowed) { @@ -569,7 +591,8 @@ export class CacheableOperationPlugin implements IPhasedCommandPlugin { phase, configHash, terminal, - operationMetadataManager + operationMetadataManager, + operation }: { buildCacheContext: IOperationBuildCacheContext; buildCacheConfiguration: BuildCacheConfiguration | undefined; @@ -578,10 +601,11 @@ export class CacheableOperationPlugin implements IPhasedCommandPlugin { configHash: string; terminal: ITerminal; operationMetadataManager: OperationMetadataManager | undefined; + operation: Operation; }): Promise { if (!buildCacheContext.projectBuildCache) { const { cacheDisabledReason } = buildCacheContext; - if (cacheDisabledReason) { + if (cacheDisabledReason && !operation.settings?.allowCobuildOrchestration) { terminal.writeVerboseLine(cacheDisabledReason); return; } @@ -863,7 +887,7 @@ export function clusterOperations( for (const [operation, { cacheDisabledReason }] of operationBuildCacheMap) { const { associatedProject: project, associatedPhase: phase } = operation; if (project && phase) { - if (cacheDisabledReason) { + if (cacheDisabledReason && !operation.settings?.allowCobuildOrchestration) { /** * Group the project build cache disabled with its consumers. This won't affect too much in * a monorepo with high build cache coverage. diff --git a/libraries/rush-lib/src/schemas/rush-project.schema.json b/libraries/rush-lib/src/schemas/rush-project.schema.json index 3fe4645d924..2c9caa0f08a 100644 --- a/libraries/rush-lib/src/schemas/rush-project.schema.json +++ b/libraries/rush-lib/src/schemas/rush-project.schema.json @@ -102,6 +102,10 @@ "description": "The number of concurrency units that this operation should take up. The maximum concurrency units is determined by the -p flag.", "type": "integer", "minimum": 0 + }, + "allowCobuildOrchestration": { + "type": "boolean", + "description": "If true, this operation will not need to use the build cache to leverage cobuilds" } } } From ef539f7a3232c0b5919c9c719d47e1f007e43409 Mon Sep 17 00:00:00 2001 From: Aramis Sennyey Date: Thu, 8 Aug 2024 19:13:53 -0400 Subject: [PATCH 2/7] update comment --- libraries/rush-lib/src/api/CobuildConfiguration.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/rush-lib/src/api/CobuildConfiguration.ts b/libraries/rush-lib/src/api/CobuildConfiguration.ts index f2933e509c6..e4fac05758e 100644 --- a/libraries/rush-lib/src/api/CobuildConfiguration.ts +++ b/libraries/rush-lib/src/api/CobuildConfiguration.ts @@ -70,9 +70,8 @@ export class CobuildConfiguration { public readonly cobuildLeafProjectLogOnlyAllowed: boolean; /** - * If true, Rush will automatically handle the leaf project with build cache "disabled" by writing - * to the cache in a special "log files only mode". This is useful when you want to use Cobuilds - * to improve the performance in CI validations and the leaf projects have not enabled cache. + * If true, operations can opt into leveraging cobuild orchestration without restoring from the build cache. + * Operations will need to us the allowCobuildOrchestration flag to opt into this behavior per phase. */ public readonly cobuildOrchestrationOnlyAllowed: boolean; From 470b0e066da9d61571d869e08a3781c162d735c4 Mon Sep 17 00:00:00 2001 From: Aramis Sennyey Date: Wed, 21 Aug 2024 10:23:35 -0400 Subject: [PATCH 3/7] rename allowCobuildOrchestration to allowCobuildWithoutCache --- .../projects/e/config/rush-project.json | 5 ++++- ...w-cobuild-orchestration_2024-08-08-23-11.json | 2 +- common/reviews/api/rush-lib.api.md | 8 ++++---- .../rush-lib/src/api/CobuildConfiguration.ts | 8 ++++---- .../rush-lib/src/api/EnvironmentConfiguration.ts | 16 ++++++++-------- .../rush-lib/src/api/RushProjectConfiguration.ts | 2 +- .../logic/operations/CacheableOperationPlugin.ts | 15 ++++++++------- .../src/schemas/rush-project.schema.json | 2 +- 8 files changed, 31 insertions(+), 27 deletions(-) diff --git a/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/e/config/rush-project.json b/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/e/config/rush-project.json index 98da067a193..64e6617b715 100644 --- a/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/e/config/rush-project.json +++ b/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/e/config/rush-project.json @@ -5,7 +5,10 @@ "operationName": "_phase:build", "outputFolderNames": ["dist"], "allowCobuildOrchestration": true, - "disableBuildCacheForOperation": true + "disableBuildCacheForOperation": true, + "sharding": { + "count": 75 + } }, { "operationName": "_phase:build:shard", diff --git a/common/changes/@microsoft/rush/sennyeya-allow-cobuild-orchestration_2024-08-08-23-11.json b/common/changes/@microsoft/rush/sennyeya-allow-cobuild-orchestration_2024-08-08-23-11.json index 1ece36cf965..54824242087 100644 --- a/common/changes/@microsoft/rush/sennyeya-allow-cobuild-orchestration_2024-08-08-23-11.json +++ b/common/changes/@microsoft/rush/sennyeya-allow-cobuild-orchestration_2024-08-08-23-11.json @@ -2,7 +2,7 @@ "changes": [ { "packageName": "@microsoft/rush", - "comment": "Adds a new experiment for cobuilds to allow uncacheable operations to benefit from cobuild orchestration without using the build cache.", + "comment": "Adds a new experiment 'allowCobuildWithoutCache' for cobuilds to allow uncacheable operations to benefit from cobuild orchestration without using the build cache.", "type": "none" } ], diff --git a/common/reviews/api/rush-lib.api.md b/common/reviews/api/rush-lib.api.md index 7e386806629..4c477cf4a7d 100644 --- a/common/reviews/api/rush-lib.api.md +++ b/common/reviews/api/rush-lib.api.md @@ -104,8 +104,8 @@ export class CobuildConfiguration { readonly cobuildContextId: string | undefined; readonly cobuildFeatureEnabled: boolean; readonly cobuildLeafProjectLogOnlyAllowed: boolean; - readonly cobuildOrchestrationOnlyAllowed: boolean; readonly cobuildRunnerId: string; + readonly cobuildWithoutCacheAllowed: boolean; // (undocumented) createLockProviderAsync(terminal: ITerminal): Promise; // (undocumented) @@ -235,8 +235,8 @@ export class EnvironmentConfiguration { static get buildCacheWriteAllowed(): boolean | undefined; static get cobuildContextId(): string | undefined; static get cobuildLeafProjectLogOnlyAllowed(): boolean | undefined; - static get cobuildOrchestrationOnlyAllowed(): boolean | undefined; static get cobuildRunnerId(): string | undefined; + static get cobuildWithoutCacheAllowed(): boolean | undefined; // Warning: (ae-forgotten-export) The symbol "IEnvironment" needs to be exported by the entry point index.d.ts // // @internal @@ -271,7 +271,7 @@ export const EnvironmentVariableNames: { readonly RUSH_COBUILD_CONTEXT_ID: "RUSH_COBUILD_CONTEXT_ID"; readonly RUSH_COBUILD_RUNNER_ID: "RUSH_COBUILD_RUNNER_ID"; readonly RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: "RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED"; - readonly RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED: "RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED"; + readonly RUSH_COBUILD_WITHOUT_CACHE_ALLOWED: "RUSH_COBUILD_WITHOUT_CACHE_ALLOWED"; readonly RUSH_GIT_BINARY_PATH: "RUSH_GIT_BINARY_PATH"; readonly RUSH_TAR_BINARY_PATH: "RUSH_TAR_BINARY_PATH"; readonly _RUSH_RECURSIVE_RUSHX_CALL: "_RUSH_RECURSIVE_RUSHX_CALL"; @@ -628,7 +628,7 @@ export interface IOperationRunnerContext { // @alpha (undocumented) export interface IOperationSettings { - allowCobuildOrchestration?: boolean; + allowCobuildWithoutCache?: boolean; dependsOnAdditionalFiles?: string[]; dependsOnEnvVars?: string[]; disableBuildCacheForOperation?: boolean; diff --git a/libraries/rush-lib/src/api/CobuildConfiguration.ts b/libraries/rush-lib/src/api/CobuildConfiguration.ts index e4fac05758e..3daaee2b49f 100644 --- a/libraries/rush-lib/src/api/CobuildConfiguration.ts +++ b/libraries/rush-lib/src/api/CobuildConfiguration.ts @@ -70,10 +70,10 @@ export class CobuildConfiguration { public readonly cobuildLeafProjectLogOnlyAllowed: boolean; /** - * If true, operations can opt into leveraging cobuild orchestration without restoring from the build cache. - * Operations will need to us the allowCobuildOrchestration flag to opt into this behavior per phase. + * If true, operations can opt into leveraging cobuilds without restoring from the build cache. + * Operations will need to us the allowCobuildWithoutCache flag to opt into this behavior per phase. */ - public readonly cobuildOrchestrationOnlyAllowed: boolean; + public readonly cobuildWithoutCacheAllowed: boolean; private _cobuildLockProvider: ICobuildLockProvider | undefined; private readonly _cobuildLockProviderFactory: CobuildLockProviderFactory; @@ -87,7 +87,7 @@ export class CobuildConfiguration { this.cobuildRunnerId = EnvironmentConfiguration.cobuildRunnerId || uuidv4(); this.cobuildLeafProjectLogOnlyAllowed = EnvironmentConfiguration.cobuildLeafProjectLogOnlyAllowed ?? false; - this.cobuildOrchestrationOnlyAllowed = EnvironmentConfiguration.cobuildOrchestrationOnlyAllowed ?? false; + this.cobuildWithoutCacheAllowed = EnvironmentConfiguration.cobuildWithoutCacheAllowed ?? false; this._cobuildLockProviderFactory = cobuildLockProviderFactory; this._cobuildJson = cobuildJson; diff --git a/libraries/rush-lib/src/api/EnvironmentConfiguration.ts b/libraries/rush-lib/src/api/EnvironmentConfiguration.ts index 6bcd67ae1e6..e46ee3b9c46 100644 --- a/libraries/rush-lib/src/api/EnvironmentConfiguration.ts +++ b/libraries/rush-lib/src/api/EnvironmentConfiguration.ts @@ -170,7 +170,7 @@ export const EnvironmentVariableNames = { * If this variable is set to "1", When getting distributed builds, Rush will allow uncacheable projects to still leverage * the cobuild feature. This is useful when you want to speed up operations that can't (or shouldn't) be cached. */ - RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED: 'RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED', + RUSH_COBUILD_WITHOUT_CACHE_ALLOWED: 'RUSH_COBUILD_WITHOUT_CACHE_ALLOWED', /** * Explicitly specifies the path for the Git binary that is invoked by certain Rush operations. @@ -254,7 +254,7 @@ export class EnvironmentConfiguration { private static _cobuildLeafProjectLogOnlyAllowed: boolean | undefined; - private static _cobuildOrchestrationOnlyAllowed: boolean | undefined; + private static _cobuildWithoutCacheAllowed: boolean | undefined; private static _gitBinaryPath: string | undefined; @@ -382,11 +382,11 @@ export class EnvironmentConfiguration { /** * If set, enables or disables the cobuild leaf project log only feature. - * See {@link EnvironmentVariableNames.RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED} + * See {@link EnvironmentVariableNames.RUSH_COBUILD_WITHOUT_CACHE_ALLOWED} */ - public static get cobuildOrchestrationOnlyAllowed(): boolean | undefined { + public static get cobuildWithoutCacheAllowed(): boolean | undefined { EnvironmentConfiguration._ensureValidated(); - return EnvironmentConfiguration._cobuildOrchestrationOnlyAllowed; + return EnvironmentConfiguration._cobuildWithoutCacheAllowed; } /** @@ -538,10 +538,10 @@ export class EnvironmentConfiguration { break; } - case EnvironmentVariableNames.RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED: { - EnvironmentConfiguration._cobuildOrchestrationOnlyAllowed = + case EnvironmentVariableNames.RUSH_COBUILD_WITHOUT_CACHE_ALLOWED: { + EnvironmentConfiguration._cobuildWithoutCacheAllowed = EnvironmentConfiguration.parseBooleanEnvironmentVariable( - EnvironmentVariableNames.RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED, + EnvironmentVariableNames.RUSH_COBUILD_WITHOUT_CACHE_ALLOWED, value ); break; diff --git a/libraries/rush-lib/src/api/RushProjectConfiguration.ts b/libraries/rush-lib/src/api/RushProjectConfiguration.ts index 44e8832e52d..5c6b60ff73b 100644 --- a/libraries/rush-lib/src/api/RushProjectConfiguration.ts +++ b/libraries/rush-lib/src/api/RushProjectConfiguration.ts @@ -138,7 +138,7 @@ export interface IOperationSettings { /** * If true, this operation can use cobuilds for orchestration without restoring build cache entries. */ - allowCobuildOrchestration?: boolean; + allowCobuildWithoutCache?: boolean; } interface IOldRushProjectJson { diff --git a/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts b/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts index c3d5b8e91d9..3b34bf0f38f 100644 --- a/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts +++ b/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts @@ -34,6 +34,7 @@ import type { OperationMetadataManager } from './OperationMetadataManager'; import type { BuildCacheConfiguration } from '../../api/BuildCacheConfiguration'; import type { IOperationExecutionResult } from './IOperationExecutionResult'; import type { OperationExecutionRecord } from './OperationExecutionRecord'; +import { EnvironmentVariableNames } from '../../api/EnvironmentConfiguration'; const PLUGIN_NAME: 'CacheablePhasedOperationPlugin' = 'CacheablePhasedOperationPlugin'; const PERIODIC_CALLBACK_INTERVAL_IN_SECONDS: number = 10; @@ -101,15 +102,15 @@ export class CacheableOperationPlugin implements IPhasedCommandPlugin { for (const operation of recordByOperation.keys()) { if ( - operation.settings?.allowCobuildOrchestration && - !cobuildConfiguration?.cobuildOrchestrationOnlyAllowed + operation.settings?.allowCobuildWithoutCache && + !cobuildConfiguration?.cobuildWithoutCacheAllowed ) { throw new Error( - `Operation ${operation.name} is not allowed to run without the cobuild orchestration experiment enabled. You must use the RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED environment variable to enable that mode.` + `Operation ${operation.name} is not allowed to run without the cobuild orchestration experiment enabled. You must use the ${EnvironmentVariableNames.RUSH_COBUILD_WITHOUT_CACHE_ALLOWED} environment variable to enable that mode.` ); } if ( - operation.settings?.allowCobuildOrchestration && + operation.settings?.allowCobuildWithoutCache && !operation.settings.disableBuildCacheForOperation ) { throw new Error( @@ -379,7 +380,7 @@ export class CacheableOperationPlugin implements IPhasedCommandPlugin { if (cobuildCompletedState) { const { status, cacheId } = cobuildCompletedState; - if (record.operation.settings?.allowCobuildOrchestration) { + if (record.operation.settings?.allowCobuildWithoutCache) { // This should only be enabled if the experiment for cobuild orchestration is enabled. return status; } @@ -605,7 +606,7 @@ export class CacheableOperationPlugin implements IPhasedCommandPlugin { }): Promise { if (!buildCacheContext.projectBuildCache) { const { cacheDisabledReason } = buildCacheContext; - if (cacheDisabledReason && !operation.settings?.allowCobuildOrchestration) { + if (cacheDisabledReason && !operation.settings?.allowCobuildWithoutCache) { terminal.writeVerboseLine(cacheDisabledReason); return; } @@ -887,7 +888,7 @@ export function clusterOperations( for (const [operation, { cacheDisabledReason }] of operationBuildCacheMap) { const { associatedProject: project, associatedPhase: phase } = operation; if (project && phase) { - if (cacheDisabledReason && !operation.settings?.allowCobuildOrchestration) { + if (cacheDisabledReason && !operation.settings?.allowCobuildWithoutCache) { /** * Group the project build cache disabled with its consumers. This won't affect too much in * a monorepo with high build cache coverage. diff --git a/libraries/rush-lib/src/schemas/rush-project.schema.json b/libraries/rush-lib/src/schemas/rush-project.schema.json index 2c9caa0f08a..50bec9241da 100644 --- a/libraries/rush-lib/src/schemas/rush-project.schema.json +++ b/libraries/rush-lib/src/schemas/rush-project.schema.json @@ -103,7 +103,7 @@ "type": "integer", "minimum": 0 }, - "allowCobuildOrchestration": { + "allowCobuildWithoutCache": { "type": "boolean", "description": "If true, this operation will not need to use the build cache to leverage cobuilds" } From 7db4f3eae6567bbc6d8023ab35096f8ba95e620a Mon Sep 17 00:00:00 2001 From: Aramis Sennyey Date: Mon, 16 Sep 2024 10:18:10 -0400 Subject: [PATCH 4/7] move to experiments.json --- .../README.md | 5 +++- .../common/config/rush/experiments.json | 6 +++-- common/reviews/api/rush-lib.api.md | 3 +-- .../rush-lib/src/api/CobuildConfiguration.ts | 6 +++-- .../src/api/EnvironmentConfiguration.ts | 26 ------------------- .../src/api/ExperimentsConfiguration.ts | 7 +++++ .../operations/CacheableOperationPlugin.ts | 3 ++- .../src/schemas/experiments.schema.json | 4 +++ 8 files changed, 26 insertions(+), 34 deletions(-) diff --git a/build-tests/rush-redis-cobuild-plugin-integration-test/README.md b/build-tests/rush-redis-cobuild-plugin-integration-test/README.md index 84f4145f2a6..0412bcc358d 100644 --- a/build-tests/rush-redis-cobuild-plugin-integration-test/README.md +++ b/build-tests/rush-redis-cobuild-plugin-integration-test/README.md @@ -152,6 +152,9 @@ rm -rf common/temp/build-cache 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. #### Case 5: Sharded cobuilds + +Enable the `allowCobuildWithoutCache` experiment in `experiments.json`. + Navigate to the sandbox for sharded cobuilds, ```sh cd sandbox/sharded-repo @@ -164,7 +167,7 @@ docker compose down && docker compose up -d Then, open 2 terminals and run this in each (changing the RUSH_COBUILD_RUNNER_ID across the 2 terminals), ```sh -rm -rf common/temp/build-cache && RUSH_COBUILD_CONTEXT_ID=foo REDIS_PASS=redis123 RUSH_COBUILD_RUNNER_ID=runner1 RUSH_COBUILD_ORCHESTRATION_ONLY_ALLOWED=1 node ../../lib/runRush.js cobuild -p 10 --timeline +rm -rf common/temp/build-cache && RUSH_COBUILD_CONTEXT_ID=foo REDIS_PASS=redis123 RUSH_COBUILD_RUNNER_ID=runner1 node ../../lib/runRush.js cobuild -p 10 --timeline ``` If all goes well, you should see a bunch of operation with `- shard xx/yy`. Operations `h (build)` and `e (build)` are both sharded heavily and should be cobuild compatible. To validate changes you're making, ensure that the timeline view for all of the shards of those 2 operations are cobuilt across both terminals. If they're not, something is wrong with your update. \ No newline at end of file diff --git a/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/common/config/rush/experiments.json b/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/common/config/rush/experiments.json index fef826208c3..14a02ec1f2f 100644 --- a/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/common/config/rush/experiments.json +++ b/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/common/config/rush/experiments.json @@ -3,7 +3,7 @@ * Rush features. More documentation is available on the Rush website: https://rushjs.io */ { - "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/experiments.schema.json", + "$schema": "../../../../../../../libraries/rush-lib/src/schemas/experiments.schema.json", /** * By default, 'rush install' passes --no-prefer-frozen-lockfile to 'pnpm install'. @@ -40,7 +40,7 @@ * If true, the phased commands feature is enabled. To use this feature, create a "phased" command * in common/config/rush/command-line.json. */ - "phasedCommands": true + "phasedCommands": true, /** * If true, perform a clean install after when running `rush install` or `rush update` if the @@ -52,4 +52,6 @@ * If true, print the outputs of shell commands defined in event hooks to the console. */ // "printEventHooksOutputToConsole": true + + "allowCobuildWithoutCache": true } diff --git a/common/reviews/api/rush-lib.api.md b/common/reviews/api/rush-lib.api.md index 4c477cf4a7d..48ce89bb8d1 100644 --- a/common/reviews/api/rush-lib.api.md +++ b/common/reviews/api/rush-lib.api.md @@ -236,7 +236,6 @@ export class EnvironmentConfiguration { static get cobuildContextId(): string | undefined; static get cobuildLeafProjectLogOnlyAllowed(): boolean | undefined; static get cobuildRunnerId(): string | undefined; - static get cobuildWithoutCacheAllowed(): boolean | undefined; // Warning: (ae-forgotten-export) The symbol "IEnvironment" needs to be exported by the entry point index.d.ts // // @internal @@ -271,7 +270,6 @@ export const EnvironmentVariableNames: { readonly RUSH_COBUILD_CONTEXT_ID: "RUSH_COBUILD_CONTEXT_ID"; readonly RUSH_COBUILD_RUNNER_ID: "RUSH_COBUILD_RUNNER_ID"; readonly RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: "RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED"; - readonly RUSH_COBUILD_WITHOUT_CACHE_ALLOWED: "RUSH_COBUILD_WITHOUT_CACHE_ALLOWED"; readonly RUSH_GIT_BINARY_PATH: "RUSH_GIT_BINARY_PATH"; readonly RUSH_TAR_BINARY_PATH: "RUSH_TAR_BINARY_PATH"; readonly _RUSH_RECURSIVE_RUSHX_CALL: "_RUSH_RECURSIVE_RUSHX_CALL"; @@ -472,6 +470,7 @@ export interface IExecutionResult { // @beta export interface IExperimentsJson { + allowCobuildWithoutCache?: boolean; buildCacheWithAllowWarningsInSuccessfulBuild?: boolean; buildSkipWithAllowWarningsInSuccessfulBuild?: boolean; cleanInstallAfterNpmrcChanges?: boolean; diff --git a/libraries/rush-lib/src/api/CobuildConfiguration.ts b/libraries/rush-lib/src/api/CobuildConfiguration.ts index 3daaee2b49f..03d2e08d6dc 100644 --- a/libraries/rush-lib/src/api/CobuildConfiguration.ts +++ b/libraries/rush-lib/src/api/CobuildConfiguration.ts @@ -80,14 +80,16 @@ export class CobuildConfiguration { private readonly _cobuildJson: ICobuildJson; private constructor(options: ICobuildConfigurationOptions) { - const { cobuildJson, cobuildLockProviderFactory } = options; + const { cobuildJson, cobuildLockProviderFactory, rushConfiguration } = options; this.cobuildContextId = EnvironmentConfiguration.cobuildContextId; this.cobuildFeatureEnabled = this.cobuildContextId ? cobuildJson.cobuildFeatureEnabled : false; this.cobuildRunnerId = EnvironmentConfiguration.cobuildRunnerId || uuidv4(); this.cobuildLeafProjectLogOnlyAllowed = EnvironmentConfiguration.cobuildLeafProjectLogOnlyAllowed ?? false; - this.cobuildWithoutCacheAllowed = EnvironmentConfiguration.cobuildWithoutCacheAllowed ?? false; + console.log(JSON.stringify(rushConfiguration.experimentsConfiguration.configuration)); + this.cobuildWithoutCacheAllowed = + rushConfiguration.experimentsConfiguration.configuration.allowCobuildWithoutCache ?? false; this._cobuildLockProviderFactory = cobuildLockProviderFactory; this._cobuildJson = cobuildJson; diff --git a/libraries/rush-lib/src/api/EnvironmentConfiguration.ts b/libraries/rush-lib/src/api/EnvironmentConfiguration.ts index e46ee3b9c46..7826651d1d2 100644 --- a/libraries/rush-lib/src/api/EnvironmentConfiguration.ts +++ b/libraries/rush-lib/src/api/EnvironmentConfiguration.ts @@ -166,12 +166,6 @@ export const EnvironmentVariableNames = { */ RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: 'RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED', - /** - * If this variable is set to "1", When getting distributed builds, Rush will allow uncacheable projects to still leverage - * the cobuild feature. This is useful when you want to speed up operations that can't (or shouldn't) be cached. - */ - RUSH_COBUILD_WITHOUT_CACHE_ALLOWED: 'RUSH_COBUILD_WITHOUT_CACHE_ALLOWED', - /** * Explicitly specifies the path for the Git binary that is invoked by certain Rush operations. */ @@ -254,8 +248,6 @@ export class EnvironmentConfiguration { private static _cobuildLeafProjectLogOnlyAllowed: boolean | undefined; - private static _cobuildWithoutCacheAllowed: boolean | undefined; - private static _gitBinaryPath: string | undefined; private static _tarBinaryPath: string | undefined; @@ -380,15 +372,6 @@ export class EnvironmentConfiguration { return EnvironmentConfiguration._cobuildLeafProjectLogOnlyAllowed; } - /** - * If set, enables or disables the cobuild leaf project log only feature. - * See {@link EnvironmentVariableNames.RUSH_COBUILD_WITHOUT_CACHE_ALLOWED} - */ - public static get cobuildWithoutCacheAllowed(): boolean | undefined { - EnvironmentConfiguration._ensureValidated(); - return EnvironmentConfiguration._cobuildWithoutCacheAllowed; - } - /** * Allows the git binary path to be explicitly provided. * See {@link EnvironmentVariableNames.RUSH_GIT_BINARY_PATH} @@ -538,15 +521,6 @@ export class EnvironmentConfiguration { break; } - case EnvironmentVariableNames.RUSH_COBUILD_WITHOUT_CACHE_ALLOWED: { - EnvironmentConfiguration._cobuildWithoutCacheAllowed = - EnvironmentConfiguration.parseBooleanEnvironmentVariable( - EnvironmentVariableNames.RUSH_COBUILD_WITHOUT_CACHE_ALLOWED, - value - ); - break; - } - case EnvironmentVariableNames.RUSH_GIT_BINARY_PATH: { EnvironmentConfiguration._gitBinaryPath = value; break; diff --git a/libraries/rush-lib/src/api/ExperimentsConfiguration.ts b/libraries/rush-lib/src/api/ExperimentsConfiguration.ts index 0e66fa3dc1c..e9a6f46bec0 100644 --- a/libraries/rush-lib/src/api/ExperimentsConfiguration.ts +++ b/libraries/rush-lib/src/api/ExperimentsConfiguration.ts @@ -106,6 +106,13 @@ export interface IExperimentsJson { * ignore normal discussion group messages or don't know to subscribe. */ rushAlerts?: boolean; + + /** + * Allow cobuilds without using the build cache to store previous execution info. When setting up + * distributed builds, Rush will allow uncacheable projects to still leverage the cobuild feature. + * This is useful when you want to speed up operations that can't (or shouldn't) be cached. + */ + allowCobuildWithoutCache?: boolean; } const _EXPERIMENTS_JSON_SCHEMA: JsonSchema = JsonSchema.fromLoadedObject(schemaJson); diff --git a/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts b/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts index 3b34bf0f38f..9c3f9dc9b11 100644 --- a/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts +++ b/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts @@ -35,6 +35,7 @@ import type { BuildCacheConfiguration } from '../../api/BuildCacheConfiguration' import type { IOperationExecutionResult } from './IOperationExecutionResult'; import type { OperationExecutionRecord } from './OperationExecutionRecord'; import { EnvironmentVariableNames } from '../../api/EnvironmentConfiguration'; +import { ExperimentsConfiguration } from '../../api/ExperimentsConfiguration'; const PLUGIN_NAME: 'CacheablePhasedOperationPlugin' = 'CacheablePhasedOperationPlugin'; const PERIODIC_CALLBACK_INTERVAL_IN_SECONDS: number = 10; @@ -106,7 +107,7 @@ export class CacheableOperationPlugin implements IPhasedCommandPlugin { !cobuildConfiguration?.cobuildWithoutCacheAllowed ) { throw new Error( - `Operation ${operation.name} is not allowed to run without the cobuild orchestration experiment enabled. You must use the ${EnvironmentVariableNames.RUSH_COBUILD_WITHOUT_CACHE_ALLOWED} environment variable to enable that mode.` + `Operation ${operation.name} is not allowed to run without the cobuild orchestration experiment enabled. You must enable the "allowCobuildWithoutCache" experiment in experiments.json.` ); } if ( diff --git a/libraries/rush-lib/src/schemas/experiments.schema.json b/libraries/rush-lib/src/schemas/experiments.schema.json index c2026513fdb..7160d73926c 100644 --- a/libraries/rush-lib/src/schemas/experiments.schema.json +++ b/libraries/rush-lib/src/schemas/experiments.schema.json @@ -66,6 +66,10 @@ "description": "If true, when running in watch mode, Rush will check for phase scripts named `_phase::ipc` and run them instead of `_phase:` if they exist. The created child process will be provided with an IPC channel and expected to persist across invocations.", "type": "boolean" }, + "allowCobuildWithoutCache": { + "description": "Adds a new experiment 'allowCobuildWithoutCache' for cobuilds to allow uncacheable operations to benefit from cobuild orchestration without using the build cache.", + "type": "boolean" + }, "rushAlerts": { "description": "(UNDER DEVELOPMENT) The Rush alerts feature provides a way to send announcements to engineers working in the monorepo, by printing directly in the user's shell window when they invoke Rush commands. This ensures that important notices will be seen by anyone doing active development, since people often ignore normal discussion group messages or don't know to subscribe.", "type": "boolean" From 9541a939c4540b89a0ebc175ad9e9320fb559ca7 Mon Sep 17 00:00:00 2001 From: Aramis Sennyey Date: Mon, 16 Sep 2024 11:03:41 -0400 Subject: [PATCH 5/7] fix lint errors --- libraries/rush-lib/src/api/CobuildConfiguration.ts | 1 - .../rush-lib/src/logic/operations/CacheableOperationPlugin.ts | 2 -- 2 files changed, 3 deletions(-) diff --git a/libraries/rush-lib/src/api/CobuildConfiguration.ts b/libraries/rush-lib/src/api/CobuildConfiguration.ts index 03d2e08d6dc..0f169a2966a 100644 --- a/libraries/rush-lib/src/api/CobuildConfiguration.ts +++ b/libraries/rush-lib/src/api/CobuildConfiguration.ts @@ -87,7 +87,6 @@ export class CobuildConfiguration { this.cobuildRunnerId = EnvironmentConfiguration.cobuildRunnerId || uuidv4(); this.cobuildLeafProjectLogOnlyAllowed = EnvironmentConfiguration.cobuildLeafProjectLogOnlyAllowed ?? false; - console.log(JSON.stringify(rushConfiguration.experimentsConfiguration.configuration)); this.cobuildWithoutCacheAllowed = rushConfiguration.experimentsConfiguration.configuration.allowCobuildWithoutCache ?? false; diff --git a/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts b/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts index 9c3f9dc9b11..ad99f9a41b2 100644 --- a/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts +++ b/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts @@ -34,8 +34,6 @@ import type { OperationMetadataManager } from './OperationMetadataManager'; import type { BuildCacheConfiguration } from '../../api/BuildCacheConfiguration'; import type { IOperationExecutionResult } from './IOperationExecutionResult'; import type { OperationExecutionRecord } from './OperationExecutionRecord'; -import { EnvironmentVariableNames } from '../../api/EnvironmentConfiguration'; -import { ExperimentsConfiguration } from '../../api/ExperimentsConfiguration'; const PLUGIN_NAME: 'CacheablePhasedOperationPlugin' = 'CacheablePhasedOperationPlugin'; const PERIODIC_CALLBACK_INTERVAL_IN_SECONDS: number = 10; From fcb35ed2077004301eb49334495405d027b923f2 Mon Sep 17 00:00:00 2001 From: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com> Date: Wed, 18 Sep 2024 18:09:18 -0400 Subject: [PATCH 6/7] Update build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/e/config/rush-project.json --- .../sandbox/sharded-repo/projects/e/config/rush-project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/e/config/rush-project.json b/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/e/config/rush-project.json index 64e6617b715..e6534be5bc8 100644 --- a/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/e/config/rush-project.json +++ b/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/e/config/rush-project.json @@ -12,7 +12,7 @@ }, { "operationName": "_phase:build:shard", - "weight": 1, + "weight": 10, "allowCobuildOrchestration": true } ] From b2e50c6c935557d17309ad79a97c6bc8724f7d40 Mon Sep 17 00:00:00 2001 From: Aramis Sennyey Date: Fri, 20 Sep 2024 15:20:41 -0400 Subject: [PATCH 7/7] adding to rush-init and adjusting description --- .../assets/rush-init/common/config/rush/experiments.json | 8 +++++++- libraries/rush-lib/src/schemas/experiments.schema.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libraries/rush-lib/assets/rush-init/common/config/rush/experiments.json b/libraries/rush-lib/assets/rush-init/common/config/rush/experiments.json index 326b7c42af0..8bc016fb1d2 100644 --- a/libraries/rush-lib/assets/rush-init/common/config/rush/experiments.json +++ b/libraries/rush-lib/assets/rush-init/common/config/rush/experiments.json @@ -96,5 +96,11 @@ * This ensures that important notices will be seen by anyone doing active development, since people often * ignore normal discussion group messages or don't know to subscribe. */ - /*[LINE "HYPOTHETICAL"]*/ "rushAlerts": true + /*[LINE "HYPOTHETICAL"]*/ "rushAlerts": true, + + + /** + * When using cobuilds, this experiment allows uncacheable operations to benefit from cobuild orchestration without using the build cache. + */ + /*[LINE "HYPOTHETICAL"]*/ "allowCobuildWithoutCache": true } diff --git a/libraries/rush-lib/src/schemas/experiments.schema.json b/libraries/rush-lib/src/schemas/experiments.schema.json index 7160d73926c..d18ec334876 100644 --- a/libraries/rush-lib/src/schemas/experiments.schema.json +++ b/libraries/rush-lib/src/schemas/experiments.schema.json @@ -67,7 +67,7 @@ "type": "boolean" }, "allowCobuildWithoutCache": { - "description": "Adds a new experiment 'allowCobuildWithoutCache' for cobuilds to allow uncacheable operations to benefit from cobuild orchestration without using the build cache.", + "description": "When using cobuilds, this experiment allows uncacheable operations to benefit from cobuild orchestration without using the build cache.", "type": "boolean" }, "rushAlerts": {