Skip to content

fix(changelog): count fragments without the bad substitution that stopped the cut - #1655

Merged
neochaotic merged 2 commits into
mainfrom
fix/changelog-fold-count
Oct 10, 2026
Merged

neochaotic merged 2 commits into
mainfrom
fix/changelog-fold-count

Conversation

@neochaotic

Copy link
Copy Markdown
Collaborator

What & why

scripts/changelog-fold.sh counted fragments with ${#fragments[@]:-0}, which is not valid bash. Every dry run and every fold with a version died right after the merge with bad substitution, so scripts/cut-release.sh v0.5.3-rc.1 stopped while preparing the release branch:

/home/claude/dexaflow/scripts/changelog-fold.sh: line 320: ${#fragments[@]:-0}: bad substitution
error: folding changelog fragments failed

The self-test only called merge_unreleased, so that code never ran in CI. This initializes the array once and counts it plainly; --render leaves it empty and keeps taking the else branch.

How it was tested

  • New self-test case 10 copies the script into a scratch repo with one fragment and a changie stub, then runs the real entry point: --dry-run <version> and <version>. It asserts the exit codes, the folded entry, and that only the real fold removes the fragment. The test commit comes first and fails (exit 1 on both runs); the fix commit turns it green.
  • bash scripts/check-script-selftests.sh: 40 self-tests pass.
  • scripts/changelog-fold.sh --dry-run 0.5.99 with real changie v1.24.0 on this branch: 97 fragments would be folded, exit 0, nothing changed.

Checklist

  • TDD: the self-test case failed before the fix
  • Script self-tests pass locally
  • Public /api/v2/ surface unchanged
  • Docs: release tooling only
  • Changelog: skip-changelog, release tooling with no user-facing change
  • All text in English
  • One logical change

Skip-docs: fixes a crash in the release tooling; no behavior users see changes.


Generated by Claude Code

The self-test only called merge_unreleased, so the code after the merge
never ran in CI. A dry run and a fold with a version both fail today on
a bad substitution in the fragment count.
…pped the cut

${#fragments[@]:-0} is not valid bash, so changelog-fold.sh died after the
merge on every dry run and every fold with a version, and cut-release.sh
could not prepare v0.5.3-rc.1. Initialize the array once and count it
plainly; --render leaves it empty and takes the else branch as before.
@neochaotic neochaotic added this to the v0.5.3 milestone Oct 10, 2026 — with Claude
@neochaotic neochaotic added skip-changelog PR has no user-facing change; exempt from the CHANGELOG entry gate skip-docs PR changes nothing a user could discover; exempts it from the docs guard labels Oct 10, 2026 — with Claude
@neochaotic
neochaotic merged commit 6c1d6fa into main Oct 10, 2026
56 of 58 checks passed
neochaotic added a commit that referenced this pull request Oct 10, 2026
…pped the cut (#1655)

${#fragments[@]:-0} is not valid bash, so changelog-fold.sh died after the
merge on every dry run and every fold with a version, and cut-release.sh
could not prepare v0.5.3-rc.1. Initialize the array once and count it
plainly; --render leaves it empty and takes the else branch as before.

(cherry picked from commit 6c1d6fa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog PR has no user-facing change; exempt from the CHANGELOG entry gate skip-docs PR changes nothing a user could discover; exempts it from the docs guard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant