Skip to content

fix(release): restore changelog when abandoning a release - #2024

Merged
gerchowl merged 15 commits into
devfrom
bugfix/2003-abandon-unfreeze-changelog
Nov 4, 2026
Merged

gerchowl merged 15 commits into
devfrom
bugfix/2003-abandon-unfreeze-changelog

Conversation

@gerchowl

@gerchowl gerchowl commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

Abandoning a regular release restores dev's pending changelog entries to Unreleased. Restoration commits are pinned to the checkout SHA so a stale fold cannot silently replace concurrent dev changes. The one-off 1.19.0 repair is generated by the tested command from current dev, preserving concurrent entries and regenerating the mirror.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • chore -- Maintenance task
  • refactor -- Code restructuring
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style

Modifiers

  • Breaking change (!)

Changes Made

  • Add prepare-changelog unfreeze VERSION [FILE]: combine pending entries and repeated categories, preserve entry order and nested details, and deduplicate whole entries. An absent version is a no-op; dated releases are refused.
  • Preserve Unreleased's LF/CRLF style and blank lines between entries. Keep untouched header/history spans verbatim, including their original line endings. Refuse preambles, unsupported headings/prose, and loose bullets without rewriting the file; errors identify the offending section.
  • Capture git rev-parse HEAD immediately after checkout in both abandon workflows and fail if SHA capture fails, and pass it as BASE_SHA to the same Commit App API action used by prepare-release. A non-fast-forward update fails; rerun abandonment from a fresh checkout.
  • Re-sync and commit the devkit mirror with the root changelog. Missing pending sections produce no API commit, including hotfix trains and reruns.
  • Use devkit-version-pinned host utilities in the consumer job. Trunk scaffolding omits dev restoration. Keep the consumer changelog seed empty.
  • Document the command, failure modes and concurrency behavior.

The pinned v0.3.3 runner reads BASE_SHA into baseSha, and commit.ts uses that fixed base for the tree and commit parent, then updates the ref with force: false. Retries reuse that base and commit; they do not recompute against a newer dev head.

Changelog Entry

Fixed

  • Restore abandoned release changelogs (#2003)
    • Fold pending release entries back into Unreleased when abandoning a regular release train.
    • Pin restoration commits to their checkout SHA and refuse unsupported content without losing entries or line endings.

Testing

  • Tests pass locally (just test) — targeted local verification; full suites run in CI.
  • Manual testing performed

uv run --with pytest-xdist pytest packages/vig-utils/tests/test_prepare_changelog.py tests/test_abandon_release.py tests/test_seed_changelog.py tests/test_workflow_model.py -n 4 --basetemp=$HOME/.cache/devkit-pytest/2003-r2-capture-green: 251 passed, exit 0.

RED tests were committed before implementation: 11 failures covering the checkout-SHA wiring and command edge cases (exit 1), plus two failures covering mixed newline styles in untouched release history (exit 1), and two failures proving SHA-resolution errors must stop the job (exit 1).

Replay tests execute the SHA-capture step from each actual workflow, advance the fixture branch, then resolve the API action's environment and prove BASE_SHA remains the original checkout output. Command tests cover category merging, duplicates, empty sections, reruns, missing versions, dated-version CLI refusal, CRLF, untouched history, unsupported prose/comments, error section names and entry spacing.

Manual Testing Details

Rebased onto current dev, regenerated the repair with prepare-changelog unfreeze 1.19.0 CHANGELOG.md, and ran scripts/sync_manifest.py sync assets/workspace/. Verified all merged category contents retain their order; #1955, #2025 and #2011 occur once each; released history and the empty consumer seed are unchanged. No release workflow was dispatched.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code where useful
  • I have updated the documentation accordingly
  • I have updated CHANGELOG.md in Unreleased
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective
  • New and existing relevant unit tests pass locally
  • Any dependent changes have been merged and published — none outstanding

Additional Notes

The changelog moves are the one-off pending-section repair. Published release sections are not changed. The concurrency failure intentionally leaves the workflow failed rather than rebasing stale file contents onto a newer dev head.

Refs: #2003

@gerchowl
gerchowl force-pushed the bugfix/2003-abandon-unfreeze-changelog branch from 266ad73 to ebf89f3 Compare November 4, 2026 05:07
@gerchowl
gerchowl merged commit 6311fd9 into dev Nov 4, 2026
16 checks passed
@gerchowl
gerchowl deleted the bugfix/2003-abandon-unfreeze-changelog branch November 4, 2026 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant