@rushstack/rush-sdk 5.101.0-pr3949.3 → 5.101.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rush-lib.d.ts +10 -292
- package/lib/api/EnvironmentConfiguration.d.ts +0 -61
- package/lib/index.d.ts +1 -3
- package/lib/logic/RushConstants.d.ts +0 -4
- package/lib/logic/buildCache/ProjectBuildCache.d.ts +4 -5
- package/lib/logic/operations/AsyncOperationQueue.d.ts +4 -23
- package/lib/logic/operations/IOperationExecutionResult.d.ts +0 -4
- package/lib/logic/operations/IOperationRunner.d.ts +8 -27
- package/lib/logic/operations/OperationExecutionManager.d.ts +0 -5
- package/lib/logic/operations/OperationExecutionRecord.d.ts +1 -8
- package/lib/logic/operations/OperationMetadataManager.d.ts +1 -3
- package/lib/logic/operations/OperationStateFile.d.ts +0 -2
- package/lib/logic/operations/OperationStatus.d.ts +0 -8
- package/lib/logic/operations/ShellOperationRunner.d.ts +14 -6
- package/lib/pluginFramework/PhasedCommandHooks.d.ts +3 -20
- package/lib/pluginFramework/RushSession.d.ts +2 -11
- package/package.json +2 -2
- package/lib/api/CobuildConfiguration.d.ts +0 -71
- package/lib/api/CobuildConfiguration.js +0 -1
- package/lib/logic/cobuild/CobuildLock.d.ts +0 -43
- package/lib/logic/cobuild/CobuildLock.js +0 -1
- package/lib/logic/cobuild/DisjointSet.d.ts +0 -28
- package/lib/logic/cobuild/DisjointSet.js +0 -1
- package/lib/logic/cobuild/ICobuildLockProvider.d.ts +0 -99
- package/lib/logic/cobuild/ICobuildLockProvider.js +0 -1
- package/lib/logic/operations/CacheableOperationPlugin.d.ts +0 -30
- package/lib/logic/operations/CacheableOperationPlugin.js +0 -1
- package/lib/logic/operations/OperationRunnerHooks.d.ts +0 -52
- package/lib/logic/operations/OperationRunnerHooks.js +0 -1
- package/lib/logic/operations/PeriodicCallback.d.ts +0 -20
- package/lib/logic/operations/PeriodicCallback.js +0 -1
package/dist/rush-lib.d.ts
CHANGED
|
@@ -209,62 +209,6 @@ export declare class ChangeManager {
|
|
|
209
209
|
*/
|
|
210
210
|
export declare type CloudBuildCacheProviderFactory = (buildCacheJson: IBuildCacheJson) => ICloudBuildCacheProvider | Promise<ICloudBuildCacheProvider>;
|
|
211
211
|
|
|
212
|
-
/**
|
|
213
|
-
* Use this class to load and save the "common/config/rush/cobuild.json" config file.
|
|
214
|
-
* This file provides configuration options for the Rush Cobuild feature.
|
|
215
|
-
* @beta
|
|
216
|
-
*/
|
|
217
|
-
export declare class CobuildConfiguration {
|
|
218
|
-
private static _jsonSchema;
|
|
219
|
-
/**
|
|
220
|
-
* Indicates whether the cobuild feature is enabled.
|
|
221
|
-
* Typically it is enabled in the cobuild.json config file.
|
|
222
|
-
*
|
|
223
|
-
* Note: The orchestrator (or local users) should always have to opt into running with cobuilds by
|
|
224
|
-
* providing a cobuild context id. Even if cobuilds are "enabled" as a feature, they don't
|
|
225
|
-
* actually turn on for that particular build unless the cobuild context id is provided as an
|
|
226
|
-
* non-empty string.
|
|
227
|
-
*/
|
|
228
|
-
readonly cobuildEnabled: boolean;
|
|
229
|
-
/**
|
|
230
|
-
* Cobuild context id
|
|
231
|
-
*
|
|
232
|
-
* @remarks
|
|
233
|
-
* The cobuild feature won't be enabled until the context id is provided as an non-empty string.
|
|
234
|
-
*/
|
|
235
|
-
readonly cobuildContextId: string | undefined;
|
|
236
|
-
/**
|
|
237
|
-
* This is a name of the participating cobuild runner. It can be specified by the environment variable
|
|
238
|
-
* RUSH_COBUILD_RUNNER_ID. If it is not provided, a random id will be generated to identify the runner.
|
|
239
|
-
*/
|
|
240
|
-
readonly cobuildRunnerId: string;
|
|
241
|
-
/**
|
|
242
|
-
* If true, Rush will automatically handle the leaf project with build cache "disabled" by writing
|
|
243
|
-
* to the cache in a special "log files only mode". This is useful when you want to use Cobuilds
|
|
244
|
-
* to improve the performance in CI validations and the leaf projects have not enabled cache.
|
|
245
|
-
*/
|
|
246
|
-
readonly cobuildLeafProjectLogOnlyAllowed: boolean;
|
|
247
|
-
private _cobuildLockProvider;
|
|
248
|
-
private readonly _cobuildLockProviderFactory;
|
|
249
|
-
private readonly _cobuildJson;
|
|
250
|
-
private constructor();
|
|
251
|
-
/**
|
|
252
|
-
* Attempts to load the cobuild.json data from the standard file path `common/config/rush/cobuild.json`.
|
|
253
|
-
* If the file has not been created yet, then undefined is returned.
|
|
254
|
-
*/
|
|
255
|
-
static tryLoadAsync(terminal: ITerminal, rushConfiguration: RushConfiguration, rushSession: RushSession): Promise<CobuildConfiguration | undefined>;
|
|
256
|
-
static getCobuildConfigFilePath(rushConfiguration: RushConfiguration): string;
|
|
257
|
-
private static _loadAsync;
|
|
258
|
-
createLockProviderAsync(terminal: ITerminal): Promise<void>;
|
|
259
|
-
destroyLockProviderAsync(): Promise<void>;
|
|
260
|
-
get cobuildLockProvider(): ICobuildLockProvider;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* @beta
|
|
265
|
-
*/
|
|
266
|
-
export declare type CobuildLockProviderFactory = (cobuildJson: ICobuildJson) => ICobuildLockProvider | Promise<ICobuildLockProvider>;
|
|
267
|
-
|
|
268
212
|
/**
|
|
269
213
|
* Use this class to load and save the "common/config/rush/common-versions.json" config file.
|
|
270
214
|
* This config file stores dependency version information that affects all projects in the repo.
|
|
@@ -394,10 +338,6 @@ export declare class EnvironmentConfiguration {
|
|
|
394
338
|
private static _buildCacheCredential;
|
|
395
339
|
private static _buildCacheEnabled;
|
|
396
340
|
private static _buildCacheWriteAllowed;
|
|
397
|
-
private static _cobuildEnabled;
|
|
398
|
-
private static _cobuildContextId;
|
|
399
|
-
private static _cobuildRunnerId;
|
|
400
|
-
private static _cobuildLeafProjectLogOnlyAllowed;
|
|
401
341
|
private static _gitBinaryPath;
|
|
402
342
|
private static _tarBinaryPath;
|
|
403
343
|
/**
|
|
@@ -453,26 +393,6 @@ export declare class EnvironmentConfiguration {
|
|
|
453
393
|
* See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_WRITE_ALLOWED}
|
|
454
394
|
*/
|
|
455
395
|
static get buildCacheWriteAllowed(): boolean | undefined;
|
|
456
|
-
/**
|
|
457
|
-
* If set, enables or disables the cobuild feature.
|
|
458
|
-
* See {@link EnvironmentVariableNames.RUSH_COBUILD_ENABLED}
|
|
459
|
-
*/
|
|
460
|
-
static get cobuildEnabled(): boolean | undefined;
|
|
461
|
-
/**
|
|
462
|
-
* Provides a determined cobuild context id if configured
|
|
463
|
-
* See {@link EnvironmentVariableNames.RUSH_COBUILD_CONTEXT_ID}
|
|
464
|
-
*/
|
|
465
|
-
static get cobuildContextId(): string | undefined;
|
|
466
|
-
/**
|
|
467
|
-
* Provides a determined cobuild runner id if configured
|
|
468
|
-
* See {@link EnvironmentVariableNames.RUSH_COBUILD_RUNNER_ID}
|
|
469
|
-
*/
|
|
470
|
-
static get cobuildRunnerId(): string | undefined;
|
|
471
|
-
/**
|
|
472
|
-
* If set, enables or disables the cobuild leaf project log only feature.
|
|
473
|
-
* See {@link EnvironmentVariableNames.RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED}
|
|
474
|
-
*/
|
|
475
|
-
static get cobuildLeafProjectLogOnlyAllowed(): boolean | undefined;
|
|
476
396
|
/**
|
|
477
397
|
* Allows the git binary path to be explicitly provided.
|
|
478
398
|
* See {@link EnvironmentVariableNames.RUSH_GIT_BINARY_PATH}
|
|
@@ -630,43 +550,6 @@ export declare const EnvironmentVariableNames: {
|
|
|
630
550
|
* this environment variable is ignored.
|
|
631
551
|
*/
|
|
632
552
|
readonly RUSH_BUILD_CACHE_WRITE_ALLOWED: "RUSH_BUILD_CACHE_WRITE_ALLOWED";
|
|
633
|
-
/**
|
|
634
|
-
* Setting this environment variable overrides the value of `cobuildEnabled` in the `cobuild.json`
|
|
635
|
-
* configuration file.
|
|
636
|
-
*
|
|
637
|
-
* @remarks
|
|
638
|
-
* Specify `1` to enable the cobuild or `0` to disable it.
|
|
639
|
-
*
|
|
640
|
-
* If there is no cobuild configured, then this environment variable is ignored.
|
|
641
|
-
*/
|
|
642
|
-
readonly RUSH_COBUILD_ENABLED: "RUSH_COBUILD_ENABLED";
|
|
643
|
-
/**
|
|
644
|
-
* Setting this environment variable opts into running with cobuilds. The context id should be the same across
|
|
645
|
-
* multiple VMs, but changed when it is a new round of cobuilds.
|
|
646
|
-
*
|
|
647
|
-
* e.g. `Build.BuildNumber` in Azure DevOps Pipeline.
|
|
648
|
-
*
|
|
649
|
-
* @remarks
|
|
650
|
-
* If there is no cobuild configured, then this environment variable is ignored.
|
|
651
|
-
*/
|
|
652
|
-
readonly RUSH_COBUILD_CONTEXT_ID: "RUSH_COBUILD_CONTEXT_ID";
|
|
653
|
-
/**
|
|
654
|
-
* Explicitly specifies a name for each participating cobuild runner.
|
|
655
|
-
*
|
|
656
|
-
* Setting this environment variable opts into running with cobuilds.
|
|
657
|
-
*
|
|
658
|
-
* @remarks
|
|
659
|
-
* This environment variable is optional, if it is not provided, a random id is used.
|
|
660
|
-
*
|
|
661
|
-
* If there is no cobuild configured, then this environment variable is ignored.
|
|
662
|
-
*/
|
|
663
|
-
readonly RUSH_COBUILD_RUNNER_ID: "RUSH_COBUILD_RUNNER_ID";
|
|
664
|
-
/**
|
|
665
|
-
* If this variable is set to "1", When getting distributed builds, Rush will automatically handle the leaf project
|
|
666
|
-
* with build cache "disabled" by writing to the cache in a special "log files only mode". This is useful when you
|
|
667
|
-
* want to use Cobuilds to improve the performance in CI validations and the leaf projects have not enabled cache.
|
|
668
|
-
*/
|
|
669
|
-
readonly RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: "RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED";
|
|
670
553
|
/**
|
|
671
554
|
* Explicitly specifies the path for the Git binary that is invoked by certain Rush operations.
|
|
672
555
|
*/
|
|
@@ -830,114 +713,6 @@ export declare interface ICloudBuildCacheProvider {
|
|
|
830
713
|
deleteCachedCredentialsAsync(terminal: ITerminal): Promise<void>;
|
|
831
714
|
}
|
|
832
715
|
|
|
833
|
-
/**
|
|
834
|
-
* @beta
|
|
835
|
-
*/
|
|
836
|
-
export declare interface ICobuildCompletedState {
|
|
837
|
-
status: OperationStatus.Success | OperationStatus.SuccessWithWarning | OperationStatus.Failure;
|
|
838
|
-
/**
|
|
839
|
-
* Completed state points to the cache id that was used to store the build cache.
|
|
840
|
-
* Note: Cache failed builds in a separate cache id
|
|
841
|
-
*/
|
|
842
|
-
cacheId: string;
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
/**
|
|
846
|
-
* @beta
|
|
847
|
-
*/
|
|
848
|
-
export declare interface ICobuildContext {
|
|
849
|
-
/**
|
|
850
|
-
* The key for acquiring lock.
|
|
851
|
-
*/
|
|
852
|
-
lockKey: string;
|
|
853
|
-
/**
|
|
854
|
-
* The expire time of the lock in seconds.
|
|
855
|
-
*/
|
|
856
|
-
lockExpireTimeInSeconds: number;
|
|
857
|
-
/**
|
|
858
|
-
* The key for storing completed state.
|
|
859
|
-
*/
|
|
860
|
-
completedStateKey: string;
|
|
861
|
-
/**
|
|
862
|
-
* The contextId is provided by the monorepo maintainer, it reads from environment variable {@link EnvironmentVariableNames.RUSH_COBUILD_CONTEXT_ID}.
|
|
863
|
-
* It ensure only the builds from the same given contextId cooperated.
|
|
864
|
-
*/
|
|
865
|
-
contextId: string;
|
|
866
|
-
/**
|
|
867
|
-
* The id of the cluster. The operations in the same cluster share the same clusterId and
|
|
868
|
-
* will be executed on the same machine.
|
|
869
|
-
*/
|
|
870
|
-
clusterId: string;
|
|
871
|
-
/**
|
|
872
|
-
* The id of the runner. The identifier for the running machine.
|
|
873
|
-
*
|
|
874
|
-
* It can be specified via assigning `RUSH_COBUILD_RUNNER_ID` environment variable.
|
|
875
|
-
*/
|
|
876
|
-
runnerId: string;
|
|
877
|
-
/**
|
|
878
|
-
* The id of the cache entry. It should be kept the same as the normal cacheId from ProjectBuildCache.
|
|
879
|
-
* Otherwise, there is a discrepancy in the success case wherein turning on cobuilds will
|
|
880
|
-
* fail to populate the normal build cache.
|
|
881
|
-
*/
|
|
882
|
-
cacheId: string;
|
|
883
|
-
/**
|
|
884
|
-
* The name of NPM package
|
|
885
|
-
*
|
|
886
|
-
* Example: `@scope/MyProject`
|
|
887
|
-
*/
|
|
888
|
-
packageName: string;
|
|
889
|
-
/**
|
|
890
|
-
* The name of the phase.
|
|
891
|
-
*
|
|
892
|
-
* Example: _phase:build
|
|
893
|
-
*/
|
|
894
|
-
phaseName: string;
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
/**
|
|
898
|
-
* @beta
|
|
899
|
-
*/
|
|
900
|
-
export declare interface ICobuildJson {
|
|
901
|
-
cobuildEnabled: boolean;
|
|
902
|
-
cobuildLockProvider: string;
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
/**
|
|
906
|
-
* @beta
|
|
907
|
-
*/
|
|
908
|
-
export declare interface ICobuildLockProvider {
|
|
909
|
-
/**
|
|
910
|
-
* The callback function invoked to connect to the lock provider.
|
|
911
|
-
* For example, initializing the connection to the redis server.
|
|
912
|
-
*/
|
|
913
|
-
connectAsync(): Promise<void>;
|
|
914
|
-
/**
|
|
915
|
-
* The callback function invoked to disconnect the lock provider.
|
|
916
|
-
*/
|
|
917
|
-
disconnectAsync(): Promise<void>;
|
|
918
|
-
/**
|
|
919
|
-
* The callback function to acquire a lock with a lock key and specific contexts.
|
|
920
|
-
*
|
|
921
|
-
* NOTE: This lock implementation must be a ReentrantLock. It says the lock might be acquired
|
|
922
|
-
* multiple times, since tasks in the same cluster can be run in the same VM.
|
|
923
|
-
*/
|
|
924
|
-
acquireLockAsync(context: Readonly<ICobuildContext>): Promise<boolean>;
|
|
925
|
-
/**
|
|
926
|
-
* The callback function to renew a lock with a lock key and specific contexts.
|
|
927
|
-
*
|
|
928
|
-
* NOTE: If the lock key expired
|
|
929
|
-
*/
|
|
930
|
-
renewLockAsync(context: Readonly<ICobuildContext>): Promise<void>;
|
|
931
|
-
/**
|
|
932
|
-
* The callback function to set completed state.
|
|
933
|
-
*/
|
|
934
|
-
setCompletedStateAsync(context: Readonly<ICobuildContext>, state: ICobuildCompletedState): Promise<void>;
|
|
935
|
-
/**
|
|
936
|
-
* The callback function to get completed state.
|
|
937
|
-
*/
|
|
938
|
-
getCompletedStateAsync(context: Readonly<ICobuildContext>): Promise<ICobuildCompletedState | undefined>;
|
|
939
|
-
}
|
|
940
|
-
|
|
941
716
|
/**
|
|
942
717
|
* A collection of environment variables
|
|
943
718
|
* @public
|
|
@@ -975,10 +750,6 @@ export declare interface ICreateOperationsContext {
|
|
|
975
750
|
* The configuration for the build cache, if the feature is enabled.
|
|
976
751
|
*/
|
|
977
752
|
readonly buildCacheConfiguration: BuildCacheConfiguration | undefined;
|
|
978
|
-
/**
|
|
979
|
-
* The configuration for the cobuild, if cobuild feature and build cache feature are both enabled.
|
|
980
|
-
*/
|
|
981
|
-
readonly cobuildConfiguration: CobuildConfiguration | undefined;
|
|
982
753
|
/**
|
|
983
754
|
* The set of custom parameters for the executing command.
|
|
984
755
|
* Maps from the `longName` field in command-line.json to the parser configuration in ts-command-line.
|
|
@@ -1338,10 +1109,6 @@ export declare interface IOperationExecutionResult {
|
|
|
1338
1109
|
* The value indicates the duration of the same operation without cache hit.
|
|
1339
1110
|
*/
|
|
1340
1111
|
readonly nonCachedDurationMs: number | undefined;
|
|
1341
|
-
/**
|
|
1342
|
-
* The id of the runner which actually runs the building process in cobuild mode.
|
|
1343
|
-
*/
|
|
1344
|
-
readonly cobuildRunnerId: string | undefined;
|
|
1345
1112
|
}
|
|
1346
1113
|
|
|
1347
1114
|
/**
|
|
@@ -1351,8 +1118,6 @@ export declare interface _IOperationMetadata {
|
|
|
1351
1118
|
durationInSeconds: number;
|
|
1352
1119
|
logPath: string;
|
|
1353
1120
|
errorLogPath: string;
|
|
1354
|
-
cobuildContextId: string | undefined;
|
|
1355
|
-
cobuildRunnerId: string | undefined;
|
|
1356
1121
|
}
|
|
1357
1122
|
|
|
1358
1123
|
/**
|
|
@@ -1395,6 +1160,10 @@ export declare interface IOperationRunner {
|
|
|
1395
1160
|
* Name of the operation, for logging.
|
|
1396
1161
|
*/
|
|
1397
1162
|
readonly name: string;
|
|
1163
|
+
/**
|
|
1164
|
+
* This flag determines if the operation is allowed to be skipped if up to date.
|
|
1165
|
+
*/
|
|
1166
|
+
isSkipAllowed: boolean;
|
|
1398
1167
|
/**
|
|
1399
1168
|
* Indicates that this runner's duration has meaning.
|
|
1400
1169
|
*/
|
|
@@ -1408,6 +1177,10 @@ export declare interface IOperationRunner {
|
|
|
1408
1177
|
* exit code
|
|
1409
1178
|
*/
|
|
1410
1179
|
warningsAreAllowed: boolean;
|
|
1180
|
+
/**
|
|
1181
|
+
* Indicates if the output of this operation may be written to the cache
|
|
1182
|
+
*/
|
|
1183
|
+
isCacheWriteAllowed: boolean;
|
|
1411
1184
|
/**
|
|
1412
1185
|
* Method to be executed for the operation.
|
|
1413
1186
|
*/
|
|
@@ -1446,33 +1219,6 @@ export declare interface IOperationRunnerContext {
|
|
|
1446
1219
|
* Object used to track elapsed time.
|
|
1447
1220
|
*/
|
|
1448
1221
|
stopwatch: IStopwatchResult;
|
|
1449
|
-
/**
|
|
1450
|
-
* The current execution status of an operation. Operations start in the 'ready' state,
|
|
1451
|
-
* but can be 'blocked' if an upstream operation failed. It is 'executing' when
|
|
1452
|
-
* the operation is executing. Once execution is complete, it is either 'success' or
|
|
1453
|
-
* 'failure'.
|
|
1454
|
-
*/
|
|
1455
|
-
status: OperationStatus;
|
|
1456
|
-
/**
|
|
1457
|
-
* Error which occurred while executing this operation, this is stored in case we need
|
|
1458
|
-
* it later (for example to re-print errors at end of execution).
|
|
1459
|
-
*/
|
|
1460
|
-
error?: Error;
|
|
1461
|
-
/**
|
|
1462
|
-
* The set of operations that depend on this operation.
|
|
1463
|
-
*/
|
|
1464
|
-
readonly consumers: Set<IOperationRunnerContext>;
|
|
1465
|
-
/**
|
|
1466
|
-
* The operation runner that is executing this operation.
|
|
1467
|
-
*/
|
|
1468
|
-
readonly runner: IOperationRunner;
|
|
1469
|
-
/**
|
|
1470
|
-
* Normally the incremental build logic will rebuild changed projects as well as
|
|
1471
|
-
* any projects that directly or indirectly depend on a changed project.
|
|
1472
|
-
* If true, then the incremental build logic will only rebuild changed projects and
|
|
1473
|
-
* ignore dependent projects.
|
|
1474
|
-
*/
|
|
1475
|
-
readonly changedProjectsOnly: boolean;
|
|
1476
1222
|
}
|
|
1477
1223
|
|
|
1478
1224
|
/**
|
|
@@ -1488,8 +1234,6 @@ export declare interface _IOperationStateFileOptions {
|
|
|
1488
1234
|
*/
|
|
1489
1235
|
export declare interface _IOperationStateJson {
|
|
1490
1236
|
nonCachedDurationMs: number;
|
|
1491
|
-
cobuildContextId: string | undefined;
|
|
1492
|
-
cobuildRunnerId: string | undefined;
|
|
1493
1237
|
}
|
|
1494
1238
|
|
|
1495
1239
|
/**
|
|
@@ -2312,7 +2056,7 @@ export declare class _OperationMetadataManager {
|
|
|
2312
2056
|
* Example: `.rush/temp/operation/_phase_build/error.log`
|
|
2313
2057
|
*/
|
|
2314
2058
|
get relativeFilepaths(): string[];
|
|
2315
|
-
saveAsync({ durationInSeconds,
|
|
2059
|
+
saveAsync({ durationInSeconds, logPath, errorLogPath }: _IOperationMetadata): Promise<void>;
|
|
2316
2060
|
tryRestoreAsync({ terminal, logPath, errorLogPath }: {
|
|
2317
2061
|
terminal: ITerminal;
|
|
2318
2062
|
logPath: string;
|
|
@@ -2355,18 +2099,10 @@ export declare enum OperationStatus {
|
|
|
2355
2099
|
* The Operation is on the queue, ready to execute (but may be waiting for dependencies)
|
|
2356
2100
|
*/
|
|
2357
2101
|
Ready = "READY",
|
|
2358
|
-
/**
|
|
2359
|
-
* The Operation is Queued
|
|
2360
|
-
*/
|
|
2361
|
-
Queued = "QUEUED",
|
|
2362
2102
|
/**
|
|
2363
2103
|
* The Operation is currently executing
|
|
2364
2104
|
*/
|
|
2365
2105
|
Executing = "EXECUTING",
|
|
2366
|
-
/**
|
|
2367
|
-
* The Operation is currently executing by a remote process
|
|
2368
|
-
*/
|
|
2369
|
-
RemoteExecuting = "REMOTE EXECUTING",
|
|
2370
2106
|
/**
|
|
2371
2107
|
* The Operation completed successfully and did not write to standard output
|
|
2372
2108
|
*/
|
|
@@ -2524,10 +2260,7 @@ export declare class PhasedCommandHooks {
|
|
|
2524
2260
|
* Hook invoked before operation start
|
|
2525
2261
|
* Hook is series for stable output.
|
|
2526
2262
|
*/
|
|
2527
|
-
readonly beforeExecuteOperations: AsyncSeriesHook<[
|
|
2528
|
-
Map<Operation, IOperationExecutionResult>,
|
|
2529
|
-
ICreateOperationsContext
|
|
2530
|
-
]>;
|
|
2263
|
+
readonly beforeExecuteOperations: AsyncSeriesHook<[Map<Operation, IOperationExecutionResult>]>;
|
|
2531
2264
|
/**
|
|
2532
2265
|
* Hook invoked when operation status changed
|
|
2533
2266
|
* Hook is series for stable output.
|
|
@@ -2539,14 +2272,6 @@ export declare class PhasedCommandHooks {
|
|
|
2539
2272
|
* Hook is series for stable output.
|
|
2540
2273
|
*/
|
|
2541
2274
|
readonly afterExecuteOperations: AsyncSeriesHook<[IExecutionResult, ICreateOperationsContext]>;
|
|
2542
|
-
/**
|
|
2543
|
-
* Hook invoked before executing a operation.
|
|
2544
|
-
*/
|
|
2545
|
-
readonly beforeExecuteOperation: AsyncSeriesHook<[IOperationRunnerContext]>;
|
|
2546
|
-
/**
|
|
2547
|
-
* Hook invoked after executing a operation.
|
|
2548
|
-
*/
|
|
2549
|
-
readonly afterExecuteOperation: AsyncSeriesHook<[IOperationRunnerContext]>;
|
|
2550
2275
|
/**
|
|
2551
2276
|
* Hook invoked after a run has finished and the command is watching for changes.
|
|
2552
2277
|
* May be used to display additional relevant data to the user.
|
|
@@ -3690,10 +3415,6 @@ export declare class RushConstants {
|
|
|
3690
3415
|
* Changing this ensures that cache entries generated by an old version will no longer register as a cache hit.
|
|
3691
3416
|
*/
|
|
3692
3417
|
static readonly buildCacheVersion: number;
|
|
3693
|
-
/**
|
|
3694
|
-
* Cobuild configuration file.
|
|
3695
|
-
*/
|
|
3696
|
-
static readonly cobuildFilename: string;
|
|
3697
3418
|
/**
|
|
3698
3419
|
* Per-project configuration filename.
|
|
3699
3420
|
*/
|
|
@@ -3863,15 +3584,12 @@ declare class RushPluginsConfiguration {
|
|
|
3863
3584
|
export declare class RushSession {
|
|
3864
3585
|
private readonly _options;
|
|
3865
3586
|
private readonly _cloudBuildCacheProviderFactories;
|
|
3866
|
-
private readonly _cobuildLockProviderFactories;
|
|
3867
3587
|
readonly hooks: RushLifecycleHooks;
|
|
3868
3588
|
constructor(options: IRushSessionOptions);
|
|
3869
3589
|
getLogger(name: string): ILogger;
|
|
3870
3590
|
get terminalProvider(): ITerminalProvider;
|
|
3871
3591
|
registerCloudBuildCacheProviderFactory(cacheProviderName: string, factory: CloudBuildCacheProviderFactory): void;
|
|
3872
3592
|
getCloudBuildCacheProviderFactory(cacheProviderName: string): CloudBuildCacheProviderFactory | undefined;
|
|
3873
|
-
registerCobuildLockProviderFactory(cobuildLockProviderName: string, factory: CobuildLockProviderFactory): void;
|
|
3874
|
-
getCobuildLockProviderFactory(cobuildLockProviderName: string): CobuildLockProviderFactory | undefined;
|
|
3875
3593
|
}
|
|
3876
3594
|
|
|
3877
3595
|
/**
|
|
@@ -120,43 +120,6 @@ export declare const EnvironmentVariableNames: {
|
|
|
120
120
|
* this environment variable is ignored.
|
|
121
121
|
*/
|
|
122
122
|
readonly RUSH_BUILD_CACHE_WRITE_ALLOWED: "RUSH_BUILD_CACHE_WRITE_ALLOWED";
|
|
123
|
-
/**
|
|
124
|
-
* Setting this environment variable overrides the value of `cobuildEnabled` in the `cobuild.json`
|
|
125
|
-
* configuration file.
|
|
126
|
-
*
|
|
127
|
-
* @remarks
|
|
128
|
-
* Specify `1` to enable the cobuild or `0` to disable it.
|
|
129
|
-
*
|
|
130
|
-
* If there is no cobuild configured, then this environment variable is ignored.
|
|
131
|
-
*/
|
|
132
|
-
readonly RUSH_COBUILD_ENABLED: "RUSH_COBUILD_ENABLED";
|
|
133
|
-
/**
|
|
134
|
-
* Setting this environment variable opts into running with cobuilds. The context id should be the same across
|
|
135
|
-
* multiple VMs, but changed when it is a new round of cobuilds.
|
|
136
|
-
*
|
|
137
|
-
* e.g. `Build.BuildNumber` in Azure DevOps Pipeline.
|
|
138
|
-
*
|
|
139
|
-
* @remarks
|
|
140
|
-
* If there is no cobuild configured, then this environment variable is ignored.
|
|
141
|
-
*/
|
|
142
|
-
readonly RUSH_COBUILD_CONTEXT_ID: "RUSH_COBUILD_CONTEXT_ID";
|
|
143
|
-
/**
|
|
144
|
-
* Explicitly specifies a name for each participating cobuild runner.
|
|
145
|
-
*
|
|
146
|
-
* Setting this environment variable opts into running with cobuilds.
|
|
147
|
-
*
|
|
148
|
-
* @remarks
|
|
149
|
-
* This environment variable is optional, if it is not provided, a random id is used.
|
|
150
|
-
*
|
|
151
|
-
* If there is no cobuild configured, then this environment variable is ignored.
|
|
152
|
-
*/
|
|
153
|
-
readonly RUSH_COBUILD_RUNNER_ID: "RUSH_COBUILD_RUNNER_ID";
|
|
154
|
-
/**
|
|
155
|
-
* If this variable is set to "1", When getting distributed builds, Rush will automatically handle the leaf project
|
|
156
|
-
* with build cache "disabled" by writing to the cache in a special "log files only mode". This is useful when you
|
|
157
|
-
* want to use Cobuilds to improve the performance in CI validations and the leaf projects have not enabled cache.
|
|
158
|
-
*/
|
|
159
|
-
readonly RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: "RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED";
|
|
160
123
|
/**
|
|
161
124
|
* Explicitly specifies the path for the Git binary that is invoked by certain Rush operations.
|
|
162
125
|
*/
|
|
@@ -201,10 +164,6 @@ export declare class EnvironmentConfiguration {
|
|
|
201
164
|
private static _buildCacheCredential;
|
|
202
165
|
private static _buildCacheEnabled;
|
|
203
166
|
private static _buildCacheWriteAllowed;
|
|
204
|
-
private static _cobuildEnabled;
|
|
205
|
-
private static _cobuildContextId;
|
|
206
|
-
private static _cobuildRunnerId;
|
|
207
|
-
private static _cobuildLeafProjectLogOnlyAllowed;
|
|
208
167
|
private static _gitBinaryPath;
|
|
209
168
|
private static _tarBinaryPath;
|
|
210
169
|
/**
|
|
@@ -260,26 +219,6 @@ export declare class EnvironmentConfiguration {
|
|
|
260
219
|
* See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_WRITE_ALLOWED}
|
|
261
220
|
*/
|
|
262
221
|
static get buildCacheWriteAllowed(): boolean | undefined;
|
|
263
|
-
/**
|
|
264
|
-
* If set, enables or disables the cobuild feature.
|
|
265
|
-
* See {@link EnvironmentVariableNames.RUSH_COBUILD_ENABLED}
|
|
266
|
-
*/
|
|
267
|
-
static get cobuildEnabled(): boolean | undefined;
|
|
268
|
-
/**
|
|
269
|
-
* Provides a determined cobuild context id if configured
|
|
270
|
-
* See {@link EnvironmentVariableNames.RUSH_COBUILD_CONTEXT_ID}
|
|
271
|
-
*/
|
|
272
|
-
static get cobuildContextId(): string | undefined;
|
|
273
|
-
/**
|
|
274
|
-
* Provides a determined cobuild runner id if configured
|
|
275
|
-
* See {@link EnvironmentVariableNames.RUSH_COBUILD_RUNNER_ID}
|
|
276
|
-
*/
|
|
277
|
-
static get cobuildRunnerId(): string | undefined;
|
|
278
|
-
/**
|
|
279
|
-
* If set, enables or disables the cobuild leaf project log only feature.
|
|
280
|
-
* See {@link EnvironmentVariableNames.RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED}
|
|
281
|
-
*/
|
|
282
|
-
static get cobuildLeafProjectLogOnlyAllowed(): boolean | undefined;
|
|
283
222
|
/**
|
|
284
223
|
* Allows the git binary path to be explicitly provided.
|
|
285
224
|
* See {@link EnvironmentVariableNames.RUSH_GIT_BINARY_PATH}
|
package/lib/index.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ export { INpmOptionsJson as _INpmOptionsJson, NpmOptionsConfiguration } from './
|
|
|
9
9
|
export { IYarnOptionsJson as _IYarnOptionsJson, YarnOptionsConfiguration } from './logic/yarn/YarnOptionsConfiguration';
|
|
10
10
|
export { IPnpmOptionsJson as _IPnpmOptionsJson, PnpmStoreOptions, PnpmOptionsConfiguration } from './logic/pnpm/PnpmOptionsConfiguration';
|
|
11
11
|
export { BuildCacheConfiguration } from './api/BuildCacheConfiguration';
|
|
12
|
-
export { CobuildConfiguration, ICobuildJson } from './api/CobuildConfiguration';
|
|
13
12
|
export { GetCacheEntryIdFunction, IGenerateCacheEntryIdOptions } from './logic/buildCache/CacheEntryId';
|
|
14
13
|
export { FileSystemBuildCacheProvider, IFileSystemBuildCacheProviderOptions } from './logic/buildCache/FileSystemBuildCacheProvider';
|
|
15
14
|
export { IPhase, PhaseBehaviorForMissingScript as IPhaseBehaviorForMissingScript } from './api/CommandLineConfiguration';
|
|
@@ -37,7 +36,7 @@ export { IOperationRunner, IOperationRunnerContext } from './logic/operations/IO
|
|
|
37
36
|
export { IExecutionResult, IOperationExecutionResult } from './logic/operations/IOperationExecutionResult';
|
|
38
37
|
export { IOperationOptions, Operation } from './logic/operations/Operation';
|
|
39
38
|
export { OperationStatus } from './logic/operations/OperationStatus';
|
|
40
|
-
export { RushSession, IRushSessionOptions, CloudBuildCacheProviderFactory
|
|
39
|
+
export { RushSession, IRushSessionOptions, CloudBuildCacheProviderFactory } from './pluginFramework/RushSession';
|
|
41
40
|
export { IRushCommand, IGlobalCommand, IPhasedCommand, RushLifecycleHooks } from './pluginFramework/RushLifeCycle';
|
|
42
41
|
export { ICreateOperationsContext, PhasedCommandHooks } from './pluginFramework/PhasedCommandHooks';
|
|
43
42
|
export { IRushPlugin } from './pluginFramework/IRushPlugin';
|
|
@@ -45,7 +44,6 @@ export { IBuiltInPluginConfiguration as _IBuiltInPluginConfiguration } from './p
|
|
|
45
44
|
export { IRushPluginConfigurationBase as _IRushPluginConfigurationBase } from './api/RushPluginsConfiguration';
|
|
46
45
|
export { ILogger } from './pluginFramework/logging/Logger';
|
|
47
46
|
export { ICloudBuildCacheProvider } from './logic/buildCache/ICloudBuildCacheProvider';
|
|
48
|
-
export { ICobuildLockProvider, ICobuildContext, ICobuildCompletedState } from './logic/cobuild/ICobuildLockProvider';
|
|
49
47
|
export { ICredentialCacheOptions, ICredentialCacheEntry, CredentialCache } from './logic/CredentialCache';
|
|
50
48
|
export type { ITelemetryData, ITelemetryMachineInfo, ITelemetryOperationResult } from './logic/Telemetry';
|
|
51
49
|
export { IStopwatchResult } from './utilities/Stopwatch';
|
|
@@ -148,10 +148,6 @@ export declare class RushConstants {
|
|
|
148
148
|
* Changing this ensures that cache entries generated by an old version will no longer register as a cache hit.
|
|
149
149
|
*/
|
|
150
150
|
static readonly buildCacheVersion: number;
|
|
151
|
-
/**
|
|
152
|
-
* Cobuild configuration file.
|
|
153
|
-
*/
|
|
154
|
-
static readonly cobuildFilename: string;
|
|
155
151
|
/**
|
|
156
152
|
* Per-project configuration filename.
|
|
157
153
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ITerminal } from '@rushstack/node-core-library';
|
|
2
|
-
import { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
3
2
|
import { ProjectChangeAnalyzer } from '../ProjectChangeAnalyzer';
|
|
3
|
+
import { RushProjectConfiguration } from '../../api/RushProjectConfiguration';
|
|
4
4
|
import { BuildCacheConfiguration } from '../../api/BuildCacheConfiguration';
|
|
5
5
|
export interface IProjectBuildCacheOptions {
|
|
6
6
|
buildCacheConfiguration: BuildCacheConfiguration;
|
|
7
|
-
|
|
7
|
+
projectConfiguration: RushProjectConfiguration;
|
|
8
8
|
projectOutputFolderNames: ReadonlyArray<string>;
|
|
9
9
|
additionalProjectOutputFilePaths?: ReadonlyArray<string>;
|
|
10
10
|
additionalContext?: Record<string, string>;
|
|
@@ -30,11 +30,10 @@ export declare class ProjectBuildCache {
|
|
|
30
30
|
private _cacheId;
|
|
31
31
|
private constructor();
|
|
32
32
|
private static _tryGetTarUtility;
|
|
33
|
-
get cacheId(): string | undefined;
|
|
34
33
|
static tryGetProjectBuildCache(options: IProjectBuildCacheOptions): Promise<ProjectBuildCache | undefined>;
|
|
35
34
|
private static _validateProject;
|
|
36
|
-
tryRestoreFromCacheAsync(terminal: ITerminal
|
|
37
|
-
trySetCacheEntryAsync(terminal: ITerminal
|
|
35
|
+
tryRestoreFromCacheAsync(terminal: ITerminal): Promise<boolean>;
|
|
36
|
+
trySetCacheEntryAsync(terminal: ITerminal): Promise<boolean>;
|
|
38
37
|
/**
|
|
39
38
|
* Walks the declared output folders of the project and collects a list of files.
|
|
40
39
|
* @returns The list of output files as project-relative paths, or `undefined` if a
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { OperationExecutionRecord } from './OperationExecutionRecord';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* at this time, the caller has a chance to make a decision:
|
|
5
|
-
* 1. Manually invoke `tryGetRemoteExecutingOperation()` to get the remote executing operation.
|
|
6
|
-
* 2. If there is no remote executing operation available, wait for some time and return in callback, which
|
|
7
|
-
* internally invoke `assignOperations()` to assign new operations.
|
|
8
|
-
* NOTE: the caller must wait for some time to avoid busy loop and burn CPU cycles.
|
|
9
|
-
*/
|
|
10
|
-
export declare const UNASSIGNED_OPERATION: 'UNASSIGNED_OPERATION';
|
|
11
|
-
export type IOperationIteratorResult = OperationExecutionRecord | typeof UNASSIGNED_OPERATION;
|
|
12
|
-
/**
|
|
13
|
-
* Implementation of the async iteration protocol for a collection of IOperation objects.
|
|
3
|
+
* Implmentation of the async iteration protocol for a collection of IOperation objects.
|
|
14
4
|
* The async iterator will wait for an operation to be ready for execution, or terminate if there are no more operations.
|
|
15
5
|
*
|
|
16
6
|
* @remarks
|
|
@@ -18,12 +8,9 @@ export type IOperationIteratorResult = OperationExecutionRecord | typeof UNASSIG
|
|
|
18
8
|
* it must manually invoke `assignOperations()` after performing the updates, otherwise iterators will
|
|
19
9
|
* stall until another operations completes.
|
|
20
10
|
*/
|
|
21
|
-
export declare class AsyncOperationQueue implements AsyncIterable<
|
|
11
|
+
export declare class AsyncOperationQueue implements AsyncIterable<OperationExecutionRecord>, AsyncIterator<OperationExecutionRecord> {
|
|
22
12
|
private readonly _queue;
|
|
23
13
|
private readonly _pendingIterators;
|
|
24
|
-
private readonly _totalOperations;
|
|
25
|
-
private readonly _completedOperations;
|
|
26
|
-
private _isDone;
|
|
27
14
|
/**
|
|
28
15
|
* @param operations - The set of operations to be executed
|
|
29
16
|
* @param sortFn - A function that sorts operations in reverse priority order:
|
|
@@ -36,23 +23,17 @@ export declare class AsyncOperationQueue implements AsyncIterable<IOperationIter
|
|
|
36
23
|
* For use with `for await (const operation of taskQueue)`
|
|
37
24
|
* @see {AsyncIterator}
|
|
38
25
|
*/
|
|
39
|
-
next(): Promise<IteratorResult<
|
|
40
|
-
/**
|
|
41
|
-
* Set a callback to be invoked when one operation is completed.
|
|
42
|
-
* If all operations are completed, set the queue to done, resolve all pending iterators in next cycle.
|
|
43
|
-
*/
|
|
44
|
-
complete(record: OperationExecutionRecord): void;
|
|
26
|
+
next(): Promise<IteratorResult<OperationExecutionRecord>>;
|
|
45
27
|
/**
|
|
46
28
|
* Routes ready operations with 0 dependencies to waiting iterators. Normally invoked as part of `next()`, but
|
|
47
29
|
* if the caller does not update operation dependencies prior to calling `next()`, may need to be invoked manually.
|
|
48
30
|
*/
|
|
49
31
|
assignOperations(): void;
|
|
50
|
-
tryGetRemoteExecutingOperation(): OperationExecutionRecord | undefined;
|
|
51
32
|
/**
|
|
52
33
|
* Returns this queue as an async iterator, such that multiple functions iterating this object concurrently
|
|
53
34
|
* receive distinct iteration results.
|
|
54
35
|
*/
|
|
55
|
-
[Symbol.asyncIterator](): AsyncIterator<
|
|
36
|
+
[Symbol.asyncIterator](): AsyncIterator<OperationExecutionRecord>;
|
|
56
37
|
}
|
|
57
38
|
export interface IOperationSortFunction {
|
|
58
39
|
/**
|
|
@@ -31,10 +31,6 @@ export interface IOperationExecutionResult {
|
|
|
31
31
|
* The value indicates the duration of the same operation without cache hit.
|
|
32
32
|
*/
|
|
33
33
|
readonly nonCachedDurationMs: number | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* The id of the runner which actually runs the building process in cobuild mode.
|
|
36
|
-
*/
|
|
37
|
-
readonly cobuildRunnerId: string | undefined;
|
|
38
34
|
}
|
|
39
35
|
/**
|
|
40
36
|
* The `IExecutionResult` interface represents the results of executing a set of {@link Operation}s.
|