Skip to content

fix(smoke-test): idempotent release pipeline across candidate→final - #614

Merged
c-vigo merged 9 commits into
devfrom
bugfix/612-smoke-test-dispatch-idempotent
Jun 22, 2026
Merged

c-vigo merged 9 commits into
devfrom
bugfix/612-smoke-test-dispatch-idempotent

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Description

Makes the smoke-test release pipeline idempotent when one base version X.Y.Z is
exercised by both a candidate pass (X.Y.Z-rcN) and a final pass (X.Y.Z).
Previously the ## [X.Y.Z] CHANGELOG heading could end up dated before the
downstream release-core validation (which requires the ## [X.Y.Z] - TBD
placeholder), failing with does not contain '## [X.Y.Z] - TBD' and requiring
manual CHANGELOG recovery (as happened for 0.3.7).

Defense-in-depth across the Python SSoT (vig-utils) and the synced workflow
templates.

Type of Change

  • fix -- Bug fix

Changes Made

prepare_changelog.py (vig-utils, the tested SSoT):

  • finalize is now a no-op when the version heading is already dated (the
    linked ## [X.Y.Z](…) - YYYY-MM-DD form this tool writes), instead of erroring.
    A plain historical dated heading is still rejected.
  • prepare dedupes an existing same-version heading (TBD or dated): it folds
    the existing section's bullets back into the freshly-frozen content and drops it,
    yielding exactly one ## [X.Y.Z] - TBD heading instead of stacking a duplicate.
  • New reset-version <version> command reverts a dated heading back to - TBD
    (idempotent; no-op when already TBD or absent).

Synced workflow templates:

  • repository-dispatch.yml: the post-seed verification is now scoped to the
    ## Unreleased section
    (awk), so a bullet stranded in a stale [X.Y.Z]
    section can no longer mask an un-seeded Unreleased.
  • prepare-release.yml: runs prepare-changelog reset-version immediately before
    prepare, normalizing a dated heading to - TBD at freeze time (in-container,
    where the CLI is on PATH).

Changelog Entry

Fixed

  • Make smoke-test dispatch idempotent across candidate→final on one base version (#612)
    • prepare-changelog finalize is now a no-op when the version heading is already dated, instead of erroring
    • prepare-changelog prepare folds an existing same-version heading back into a single ## [X.Y.Z] - TBD section instead of stacking a duplicate
    • New prepare-changelog reset-version <version> command reverts a dated heading back to - TBD (idempotent); the smoke-test dispatch template runs it at dispatch start and scopes its deploy-seed check to the Unreleased section

Testing

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Manual Testing Details

  • 139 unit tests pass (uv run pytest), ruff check + format clean.
  • TDD: each behavior added as a failing test: commit, then a fix: commit.
  • End-to-end CLI smoke reproducing candidate→final on one base version: prepare →
    (prior) finalize dates it → reset-version reverts to TBD → prepare again yields
    a single heading → finalize twice both succeed (idempotent), leaving a dated
    heading and zero leftover TBD for the version.
  • Verified the scoped awk: a bullet only in a stale [X.Y.Z] section correctly
    fails the seed check, while a properly-seeded Unreleased passes.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally with my changes

Additional Notes

  • Do not auto-close [BUG] Smoke-test dispatch not idempotent across candidate→final on same base version #612 on merge. Per the issue, it can be closed only after
    the next release ships these changes and a real downstream candidate→final smoke
    run passes. Hence Refs: (not Closes:) below.
  • Follow-ups after merge + next release: re-sync the templates into
    vig-os/devcontainer-smoke-test (downstream tracking issue [FEATURE] Smoke-test repository to validate shipped CI/CD workflows #169) by bumping it to
    the new devcontainer tag, then run publish-candidate + finalize-release on the
    same base version to confirm green.
  • Deviation from the drafted plan: the reset-version call lives in
    prepare-release.yml's in-container freeze step rather than the
    repository-dispatch.yml deploy job, because that job runs on plain ubuntu-24.04
    (no prepare-changelog on PATH). The prepare dedupe covers the same case at the
    Python layer regardless.

Refs: #612

c-vigo and others added 9 commits June 22, 2026 13:03
…ding

Treat a re-run of finalize against a version this tool already dated (the
linked ## [X.Y.Z](…) - YYYY-MM-DD form) as a no-op, so candidate→final on
one base version no longer errors on a reused release branch.

Refs: #612
Fold an existing ## [X.Y.Z] section (TBD or dated) back into the freshly
frozen Unreleased content and drop it, so re-preparing the same base version
on a reused release branch yields a single ## [X.Y.Z] - TBD heading.

Refs: #612
Add reset_version_to_tbd() and the 'reset-version' CLI subcommand to revert a
dated ## [X.Y.Z] heading back to the - TBD placeholder. Idempotent (no-op when
already TBD or absent), so a dispatch can normalize a reused release branch
before prepare/release run.

Refs: #612
… base version

- repository-dispatch.yml: scope the deploy-seed verification to the
  Unreleased section so a bullet stranded in a stale [X.Y.Z] section can no
  longer mask an un-seeded Unreleased.
- prepare-release.yml: run prepare-changelog reset-version before prepare to
  normalize a dated [X.Y.Z] heading back to TBD at freeze time.

Refs: #612
@c-vigo
c-vigo enabled auto-merge June 22, 2026 11:19
@c-vigo
c-vigo merged commit a1e787c into dev Jun 22, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/612-smoke-test-dispatch-idempotent branch June 22, 2026 11:24
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