Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@rushstack/operation-graph",
"comment": "Add Rush-compatible operation statuses in preparation for graph convergence.",
"type": "minor"
}
],
"packageName": "@rushstack/operation-graph",
"email": "5100938+bmiddha@users.noreply.github.com"
}
4 changes: 4 additions & 0 deletions common/reviews/api/operation-graph.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,13 @@ export enum OperationStatus {
Blocked = "BLOCKED",
Executing = "EXECUTING",
Failure = "FAILURE",
FromCache = "FROM CACHE",
NoOp = "NO OP",
Queued = "QUEUED",
Ready = "READY",
Skipped = "SKIPPED",
Success = "SUCCESS",
SuccessWithWarning = "SUCCESS WITH WARNINGS",
Waiting = "WAITING"
}

Expand Down
4 changes: 4 additions & 0 deletions libraries/operation-graph/src/Operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ export class Operation<TMetadata extends {} = {}, TGroupMetadata extends {} = {}
switch (this.state?.status) {
case OperationStatus.Waiting:
case OperationStatus.Ready:
case OperationStatus.Queued:
case OperationStatus.Executing:
// If current status has not yet resolved to a fixed value,
// re-executing this operation does not require a full rerun
Expand All @@ -306,6 +307,9 @@ export class Operation<TMetadata extends {} = {}, TGroupMetadata extends {} = {}
case OperationStatus.Failure:
case OperationStatus.NoOp:
case OperationStatus.Success:
case OperationStatus.SuccessWithWarning:
case OperationStatus.Skipped:
case OperationStatus.FromCache:
// The requestRun callback is assumed to remain constant
// throughout the lifetime of the process, so it is safe
// to capture here.
Expand Down
18 changes: 17 additions & 1 deletion libraries/operation-graph/src/OperationStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,21 @@ export enum OperationStatus {
/**
* The operation performed no meaningful work.
*/
NoOp = 'NO OP'
NoOp = 'NO OP',
/**
* The Operation is queued.
*/
Queued = 'QUEUED',
/**
* The Operation completed successfully, but wrote to standard output.
*/
SuccessWithWarning = 'SUCCESS WITH WARNINGS',
/**
* The Operation was skipped via legacy incremental build logic.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really legacy anymore, since we use it in some of the frontier strategies.

*/
Skipped = 'SKIPPED',
/**
* The Operation had its outputs restored from the build cache.
*/
FromCache = 'FROM CACHE'
Comment on lines +52 to +56

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in the long term these should be flags, not statuses, since the overall status should still typically be "Success" or similar.

}