Repository navigation
fix(scripts): release prepare and context budget error cases - #176
Merged
Merged
Conversation
release.js prepare printed a release notes error and still exited 0 with the files changed. It now restores every file it wrote (also when the notes step throws) and exits 1 with "notes: <error> (files restored)"; a good run prints the same lines as before. context-budget.js --base failed with "Reduce of empty array with no initial value" on a revision from before the vcs reference files. It now measures such a base without them. Tests cover both; changelog entries added. Closes #171 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
scripts/release.js prepare: on a release notes error (returned or thrown) it now restores every file it wrote and exits 1 withnotes: <error> (files restored), instead of printing the error and exiting 0 with the files changed. A good run prints the samechanged:andnotes: vX.Y.Z oklines, so/axis-releaseis unaffected.preparetakes the root folder and the notes function as optional arguments for the test, and is exported.scripts/context-budget.js: a--baserevision from beforereference/vcs-*.mdno longer fails withReduce of empty array with no initial value; it is measured without a vcs file. Reports without--baseor with--base mainare unchanged.tests/release-script.test.js(restore on a notes error, files written on success),tests/foreman/context-budget.test.js(measureon a plugin without vcs files).Closes #171
Test plan
node scripts/check-all.js: 278/278 tests (2 new), bothclaude plugin validateruns passnode scripts/context-budget.js --base v1.0.0prints a reportrelease,manifests,docs): 17/17validatepasses on this pull request🤖 Generated with Claude Code