Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bartvandenende-wm
Copy link
Contributor

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

common/reviews/api/operation-graph.api.md 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;
Copy link
Member

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?

Copy link
Contributor Author

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.

Comment on lines +196 to +197
// the reject callback in the promise is discarded so we ignore errors
.catch(() => {})
Copy link
Member

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?

Copy link
Contributor Author

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:

this._requestRunPromise = new Promise<string | undefined>((resolve) => {
this._resolveRequestRun = resolve;
});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

common/reviews/api/operation-graph.api.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

[heft] heft watch mode always logs the re-run requestor task as unknown
4 participants