-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[heft] Require a logging name for every operation (followup) #4953
base: main
Are you sure you want to change the base?
[heft] Require a logging name for every operation (followup) #4953
Conversation
…ration names percolate through the call graphs - Fix spelling of "requestor" and make it non-optional
common/changes/@microsoft/rush/octogonz-heft-issue-4467_2024-10-01-08-08.json
Outdated
Show resolved
Hide resolved
common/changes/@microsoft/rush/octogonz-heft-issue-4467_2024-10-01-08-08.json
Outdated
Show resolved
Hide resolved
@@ -152,7 +152,7 @@ export class Operation implements IOperationStates { | |||
_executeAsync(context: IExecuteOperationContext): Promise<OperationStatus>; | |||
readonly groupName: string | undefined; | |||
lastState: IOperationState | undefined; | |||
readonly name: string | undefined; | |||
readonly operationName: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also a breaking API change. Is this rename necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this change is beneficial to ensure we are more explicit in the naming. The purpose of name
is easily lost outside of the operation-graph
lib context. Specifically as downstream libs use this interface to implement custom operations like the heft TaskOperationRunner
.
// the reject callback in the promise is discarded so we ignore errors | ||
.catch(() => {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this behavior correct/expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the watchloop is using a deferred promise pattern, but only binds the resolve
function per:
rushstack/libraries/operation-graph/src/WatchLoop.ts
Lines 264 to 266 in ca6e96b
this._requestRunPromise = new Promise<string | undefined>((resolve) => { | |
this._resolveRequestRun = resolve; | |
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
Fixes #4467 and builds upon #4469 previously actioned by @octogonz
Details
When using the heft watch mode using
heft start
a re-run triggered by a heft-plugin is not properly logged as requestor in the console. This can block teams from properly debugging of heft plugin related build issues.This PR forces an operation to always have a name so we can log it accordingly.
How it was tested
Redo repro steps from #4467
Impacted documentation
N/A