fix(build): Have prepare task signal async completion #6356
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The basics
npm run format
andnpm run lint
The details
Resolves
"Did you forget to signal async completion?" error from gulp when running the
prepare
task (as invoked bynpm run prepare
ornpm install
).Proposed Changes
Add a
done
parameter and pass the provided callback tobuildJavaScriptAndDeps
. This also allows a simplification of the the don't-run case by simply callingdone()
and thenreturn
ing.Behaviour Before Change
When not run by a GitHub action,
npm run prepare
andnpm install
generate the aforementioned error.Behaviour After Change
prepare
script successfully signals async completion, avoiding error.Reason for Changes
PR #6244 made a change to have the
npm run prepare
script (automatically invoked bynpm install
after package installation) not bother running thebuildJavaScriptAndDeps
gulp task when run from a GitHub action (since our build action will do npm test straight afterwards, which runs this task).Unfortunately, due my misunderstanding of how gulp tasks work the "fix" was not correct, and somehow I overlooked the error while testing locally (and of course it was not generated in CI because the other branch of the conditional was taken).
Test Coverage
buildJavaScriptAndDeps
is run and no error generated.buildJavaScriptAndDeps
is not run and no error generated.No manual testing changes envisioned.