Repository navigation
feat: fail the command on hook errors with AIO_FAIL_ON_HOOK_ERROR - #949
Open
iivvaannxx wants to merge 2 commits into
Open
iivvaannxx wants to merge 2 commits into
iivvaannxx wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds
AIO_FAIL_ON_HOOK_ERROR, off by default. When it is on for a hook, an error from that hook fails the command. Todaypre-app-build,post-app-build,pre-app-runandpost-app-runonly log the error and continue.pre-app-build,post-app-run. Any other on value means all four hooks.pre-app-buildorpre-app-runhook throws beforereloadEnvOnPreHooks, so the reload is skipped.Evidence
pre-app-buildhook is logged and the build goes on with stale generated files.After: with
AIO_FAIL_ON_HOOK_ERROR=truethe command fails withHook 'pre-app-build' failed: .... Tests cover a list value that fails only the listed hooks, an all value, off values, and the four call sites.npm testand eslint pass.Merge Danger
Door: two-way
Blast Radius: hook errors
Behavior is unchanged with the variable off. The helper lives in a new
src/lib/hook-runner.jsbecause the command tests automockapp-helper. This branch includes the commit from the base PR (list syntax forAIO_RELOAD_ENV_ON_PRE_HOOKS). That commit will drop out of the diff once the base PR merges.