-
Notifications
You must be signed in to change notification settings - Fork 604
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] heft watch mode always logs the re-run requestor task as unknown
#4467
Comments
unknown
unknown
@bartvandenende-wm has proposed a simple fix in #4468 However I'd like to consider requiring a logging name for every operation, as illustrated in my alternate PR #4469 |
Also, in testing this change, I noticed that the reported watcher seems a bit counterintuitive: Using
To a casual observer, it seems counterintuitive that modifying *.tsx would trigger the |
The run is triggered by the SASS task because Heft's file watcher support doesn't actually monitor the output of globs, it monitors all the file system calls made to evaluate them. This is something that could be changed, but at the time of implementation it was easier to provide a watching file system adapter. TL;DR, the SASS task triggers a rerun because a folder that was readdir'd during the evaluation of the SASS glob had a change to its directory listing. |
good callout @octogonz, does it mean we have 2 plugins (sass and typescript) that trigger from the same Heft's file watcher support event simultaneously causing the first abort run? A suggestion for further improved (verbose) log traceability would be for the task plugin to provide a trigger reason on the |
I see, so Heft's watcher cannot see the globs themselves? And therefore it does not have enough information to determine whether the disk events actually affect the actual input files for SASS? Then maybe the log message is correct, and we should instead focus on optimizing specific tasks such as |
@octogonz any idea about how to optimize tasks for cases we want to see the globs? |
Summary
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.Repro steps
cd 'rushstack/build-tests-samples/heft-webpack-basic-tutorial'
rush build --to .
rushx start
src
folderExpected result:
I would expect heft to print the name of the task operation that triggered to re-run, for example if the
heft-typescript-plugin
triggersrunOptions.requestRun
it should print something along the below lines:New run requested by typescript
Actual result:
The operation task is always
undefined
New run requested by undefined task
Details
Heft logs the message with the
requestor
here:rushstack/apps/heft/src/cli/HeftActionRunner.ts
Line 345 in 2c8bed2
which uses the Operation
name
value here:rushstack/libraries/operation-graph/src/Operation.ts
Line 282 in 2c8bed2
but the
name
value is never set for the operation when heft initialises it:rushstack/apps/heft/src/cli/HeftActionRunner.ts
Line 474 in 2c8bed2
Adding the task
name
explicitly to the Operation initialisation inHeftActionRunner.ts
solves this:Standard questions
Please answer these questions to help us investigate your issue more quickly:
@rushstack/heft
version?node -v
)?The text was updated successfully, but these errors were encountered: