Skip to content

Commit ae8683e

Browse files
chore: PR feedback on requester and changelog
1 parent a5cce4c commit ae8683e

File tree

9 files changed

+23
-33
lines changed

9 files changed

+23
-33
lines changed

apps/heft/src/cli/HeftActionRunner.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ export class HeftActionRunner {
333333
executeAsync: (state: IWatchLoopState): Promise<OperationStatus> => {
334334
return this._executeOnceAsync(executionManager, state.abortSignal, state.requestRun);
335335
},
336-
onRequestRun: (requester: string) => {
337-
terminal.writeLine(Colorize.bold(`New run requested by ${requester}`));
336+
onRequestRun: (requestor: string) => {
337+
terminal.writeLine(Colorize.bold(`New run requested by ${requestor}`));
338338
},
339339
onAbort: () => {
340340
terminal.writeLine(Colorize.bold(`Cancelling incremental build...`));
@@ -346,7 +346,7 @@ export class HeftActionRunner {
346346
private async _executeOnceAsync(
347347
executionManager: OperationExecutionManager,
348348
abortSignal: AbortSignal,
349-
requestRun?: (requester: string) => void
349+
requestRun?: (requestor: string) => void
350350
): Promise<OperationStatus> {
351351
// Record this as the start of task execution.
352352
this._metricsCollector.setStartTime();

common/changes/@microsoft/rush/octogonz-heft-issue-4467_2024-10-01-08-08.json

-10
This file was deleted.

common/changes/@rushstack/operation-graph/octogonz-heft-issue-4467_2024-10-01-08-08.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"changes": [
33
{
44
"packageName": "@rushstack/operation-graph",
5-
"comment": "Require a logging name for every operation.",
6-
"type": "patch"
5+
"comment": "(BREAKING API CHANGE) Require an operationName for every operation to improve logging.",
6+
"type": "minor"
77
}
88
],
99
"packageName": "@rushstack/operation-graph"

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface IExecuteOperationContext extends Omit<IOperationRunnerContext,
3333
afterExecute(operation: Operation, state: IOperationState): void;
3434
beforeExecute(operation: Operation, state: IOperationState): void;
3535
queueWork(workFn: () => Promise<OperationStatus>, priority: number): Promise<OperationStatus>;
36-
requestRun?: (requester: string) => void;
36+
requestRun?: (requestor: string) => void;
3737
terminal: ITerminal;
3838
}
3939

@@ -50,7 +50,7 @@ export interface IOperationExecutionOptions {
5050
// (undocumented)
5151
parallelism: number;
5252
// (undocumented)
53-
requestRun?: (requester: string) => void;
53+
requestRun?: (requestor: string) => void;
5454
// (undocumented)
5555
terminal: ITerminal;
5656
}
@@ -99,7 +99,7 @@ export interface IRequestRunEventMessage {
9999
// (undocumented)
100100
event: 'requestRun';
101101
// (undocumented)
102-
requester: string;
102+
requestor: string;
103103
}
104104

105105
// @beta
@@ -127,15 +127,15 @@ export interface IWatchLoopOptions {
127127
executeAsync: (state: IWatchLoopState) => Promise<OperationStatus>;
128128
onAbort: () => void;
129129
onBeforeExecute: () => void;
130-
onRequestRun: (requester: string) => void;
130+
onRequestRun: (requestor: string) => void;
131131
}
132132

133133
// @beta
134134
export interface IWatchLoopState {
135135
// (undocumented)
136136
get abortSignal(): AbortSignal;
137137
// (undocumented)
138-
requestRun: (requester: string) => void;
138+
requestRun: (requestor: string) => void;
139139
}
140140

141141
// @beta
@@ -231,7 +231,7 @@ export class Stopwatch {
231231
export class WatchLoop implements IWatchLoopState {
232232
constructor(options: IWatchLoopOptions);
233233
get abortSignal(): AbortSignal;
234-
requestRun: (requester: string) => void;
234+
requestRun: (requestor: string) => void;
235235
runIPCAsync(host?: IPCHost): Promise<void>;
236236
runUntilAbortedAsync(abortSignal: AbortSignal, onWaiting: () => void): Promise<void>;
237237
runUntilStableAsync(abortSignal: AbortSignal): Promise<OperationStatus>;

libraries/operation-graph/src/Operation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export interface IExecuteOperationContext extends Omit<IOperationRunnerContext,
6868
* A callback to the overarching orchestrator to request that the operation be invoked again.
6969
* Used in watch mode to signal that inputs have changed.
7070
*/
71-
requestRun?: (requester: string) => void;
71+
requestRun?: (requestor: string) => void;
7272

7373
/**
7474
* Terminal to write output to.

libraries/operation-graph/src/OperationExecutionManager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface IOperationExecutionOptions {
2121
parallelism: number;
2222
terminal: ITerminal;
2323

24-
requestRun?: (requester: string) => void;
24+
requestRun?: (requestor: string) => void;
2525
}
2626

2727
/**

libraries/operation-graph/src/WatchLoop.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface IWatchLoopOptions {
3131
/**
3232
* Logging callback when a run is requested (and hasn't already been).
3333
*/
34-
onRequestRun: (requester: string) => void;
34+
onRequestRun: (requestor: string) => void;
3535
/**
3636
* Logging callback when a run is aborted.
3737
*/
@@ -45,7 +45,7 @@ export interface IWatchLoopOptions {
4545
*/
4646
export interface IWatchLoopState {
4747
get abortSignal(): AbortSignal;
48-
requestRun: (requester: string) => void;
48+
requestRun: (requestor: string) => void;
4949
}
5050

5151
/**
@@ -60,7 +60,7 @@ export class WatchLoop implements IWatchLoopState {
6060
private _isRunning: boolean;
6161
private _runRequested: boolean;
6262
private _requestRunPromise: Promise<string | undefined>;
63-
private _resolveRequestRun!: (requester: string) => void;
63+
private _resolveRequestRun!: (requestor: string) => void;
6464

6565
public constructor(options: IWatchLoopOptions) {
6666
this._options = options;
@@ -147,7 +147,7 @@ export class WatchLoop implements IWatchLoopState {
147147
}
148148
}
149149

150-
function requestRunFromHost(requester: string): void {
150+
function requestRunFromHost(requestor: string): void {
151151
if (runRequestedFromHost) {
152152
return;
153153
}
@@ -156,7 +156,7 @@ export class WatchLoop implements IWatchLoopState {
156156

157157
const requestRunMessage: IRequestRunEventMessage = {
158158
event: 'requestRun',
159-
requester
159+
requestor
160160
};
161161

162162
tryMessageHost(requestRunMessage);
@@ -228,16 +228,16 @@ export class WatchLoop implements IWatchLoopState {
228228
/**
229229
* Requests that a new run occur.
230230
*/
231-
public requestRun: (requester: string) => void = (requester: string) => {
231+
public requestRun: (requestor: string) => void = (requestor: string) => {
232232
if (!this._runRequested) {
233-
this._options.onRequestRun(requester);
233+
this._options.onRequestRun(requestor);
234234
this._runRequested = true;
235235
if (this._isRunning) {
236236
this._options.onAbort();
237237
this._abortCurrent();
238238
}
239239
}
240-
this._resolveRequestRun(requester);
240+
this._resolveRequestRun(requestor);
241241
};
242242

243243
/**

libraries/operation-graph/src/protocol.types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type { OperationStatus } from './OperationStatus';
1010
*/
1111
export interface IRequestRunEventMessage {
1212
event: 'requestRun';
13-
requester: string;
13+
requestor: string;
1414
}
1515

1616
/**

libraries/rush-lib/src/logic/operations/IPCOperationRunner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class IPCOperationRunner implements IOperationRunner {
103103

104104
this._ipcProcess.on('message', (message: unknown) => {
105105
if (isRequestRunEventMessage(message)) {
106-
this._requestRun(message.requester);
106+
this._requestRun(message.requestor);
107107
} else if (isSyncEventMessage(message)) {
108108
resolveReadyPromise();
109109
}

0 commit comments

Comments
 (0)