Skip to content

Commit 2ce4f59

Browse files
bmiddhaCopilot
andauthored
[operation-graph] Add Rush-compatible operation statuses (#5889)
* [WS0-T5] Add shared operation statuses Add Rush's queued, warning, skipped, and cache statuses to the standalone enum and cover them in exhaustive rerun handling. Existing execution paths continue to emit the same statuses. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(operation-graph): update skipped status Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14
1 parent 1e6149e commit 2ce4f59

4 files changed

Lines changed: 36 additions & 1 deletion

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/operation-graph",
5+
"comment": "Add Rush-compatible operation statuses in preparation for graph convergence.",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@rushstack/operation-graph",
10+
"email": "5100938+bmiddha@users.noreply.github.com"
11+
}

common/reviews/api/operation-graph.api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,13 @@ export enum OperationStatus {
222222
Blocked = "BLOCKED",
223223
Executing = "EXECUTING",
224224
Failure = "FAILURE",
225+
FromCache = "FROM CACHE",
225226
NoOp = "NO OP",
227+
Queued = "QUEUED",
226228
Ready = "READY",
229+
Skipped = "SKIPPED",
227230
Success = "SUCCESS",
231+
SuccessWithWarning = "SUCCESS WITH WARNINGS",
228232
Waiting = "WAITING"
229233
}
230234

libraries/operation-graph/src/Operation.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ export class Operation<TMetadata extends {} = {}, TGroupMetadata extends {} = {}
290290
switch (this.state?.status) {
291291
case OperationStatus.Waiting:
292292
case OperationStatus.Ready:
293+
case OperationStatus.Queued:
293294
case OperationStatus.Executing:
294295
// If current status has not yet resolved to a fixed value,
295296
// re-executing this operation does not require a full rerun
@@ -306,6 +307,9 @@ export class Operation<TMetadata extends {} = {}, TGroupMetadata extends {} = {}
306307
case OperationStatus.Failure:
307308
case OperationStatus.NoOp:
308309
case OperationStatus.Success:
310+
case OperationStatus.SuccessWithWarning:
311+
case OperationStatus.Skipped:
312+
case OperationStatus.FromCache:
309313
// The requestRun callback is assumed to remain constant
310314
// throughout the lifetime of the process, so it is safe
311315
// to capture here.

libraries/operation-graph/src/OperationStatus.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,21 @@ export enum OperationStatus {
3737
/**
3838
* The operation performed no meaningful work.
3939
*/
40-
NoOp = 'NO OP'
40+
NoOp = 'NO OP',
41+
/**
42+
* The Operation is queued.
43+
*/
44+
Queued = 'QUEUED',
45+
/**
46+
* The Operation completed successfully, but wrote to standard output.
47+
*/
48+
SuccessWithWarning = 'SUCCESS WITH WARNINGS',
49+
/**
50+
* The Operation was skipped via incremental build logic.
51+
*/
52+
Skipped = 'SKIPPED',
53+
/**
54+
* The Operation had its outputs restored from the build cache.
55+
*/
56+
FromCache = 'FROM CACHE'
4157
}

0 commit comments

Comments
 (0)