Skip to content

fix(prepare-release): stop stripping Unreleased so sync cannot drop it - #594

Merged
c-vigo merged 1 commit into
devfrom
bugfix/590-sync-preserve-unreleased
Jun 18, 2026
Merged

c-vigo merged 1 commit into
devfrom
bugfix/590-sync-preserve-unreleased

Conversation

@c-vigo

@c-vigo c-vigo commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #590. sync-main-to-dev could silently drop dev's fresh ## Unreleased scaffold: the sync branch is cut from main (which had no ## Unreleased, because prepare-release stripped it from the release branch) and merged into dev (which has it). The 3-way merge then resolves cleanly in main's favour and deletes the scaffold — no conflict, green auto-merge, invisible loss until the next structure PR has nowhere to add an entry (observed every release in part-registry).

Fix

Stop stripping ## Unreleased from the release branch. main now keeps an empty ## Unreleased above the dated release, matching dev, so the section is stable common context in the freeze commit that becomes the main↔dev merge base. Finalization only edits the ## [X.Y.Z] line, so the sync merge preserves ## Unreleased cleanly. Keep a Changelog endorses an always-present Unreleased section.

This is the minimal change — just remove the strip step — applied to both the canonical workflow and the workspace template so adopters (e.g. part-registry) inherit it.

Why not re-add Unreleased on dev after the fork?

An earlier approach froze without Unreleased and re-added it to dev post-fork, keeping main free of Unreleased. Empirically that made the main→dev sync conflict every release (finalize edits the [X.Y.Z] line adjacent to the re-inserted scaffold) — i.e. the same manual chore #590 complains about. Keeping the section on both sides is the only way to get a clean conflict-free merge.

Changes

  • .github/workflows/prepare-release.yml + assets/workspace/.github/workflows/prepare-release.yml: drop the "Strip empty Unreleased section" step (and its release-branch commit); refresh the flow header/summary comments.
  • .github/workflows/sync-main-to-dev.yml + workspace copy: refresh the stale comment to document the new invariant.
  • CHANGELOG.md (+ mirrored workspace copy): Fixed entry.

Verification

Simulated the full freeze → fork → finalize → main→dev sync cycle with the real prepare-changelog tooling, across two consecutive releases, with and without ongoing dev work:

cycle 0.2.0: sync merge rc=0 clean -> ## Unreleased PRESERVED
cycle 0.3.0: sync merge rc=0 clean -> ## Unreleased PRESERVED

The pre-fix flow reproduces the silent drop (clean -> DROPPED) for contrast. just test-pytest for vig-utils (481 passed) and yamllint on all four workflows are green.

sync-main-to-dev could silently drop dev's fresh ## Unreleased: the sync
branch is cut from main (which had no Unreleased, since prepare-release
stripped it from the release branch) and merged into dev (which has it),
so the 3-way merge resolved cleanly in main's favour and deleted the
scaffold with no conflict.

Stop stripping ## Unreleased from the release branch. main now keeps an
empty ## Unreleased above the dated release, matching dev, so the section
is stable common context in the freeze commit that becomes the main/dev
merge base. Finalization only edits the [X.Y.Z] line, so the sync merge
preserves ## Unreleased cleanly. Apply to the workspace template too so
adopters inherit the fix.

Refs: #590
@c-vigo
c-vigo enabled auto-merge June 18, 2026 10:52
@c-vigo
c-vigo merged commit 5d76b9e into dev Jun 18, 2026
14 checks passed
@c-vigo
c-vigo deleted the bugfix/590-sync-preserve-unreleased branch June 18, 2026 10:58
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