Repository navigation
chore: release 0.3.8 - #619
Merged
Merged
Conversation
Signed-off-by: Carlos Vigo <[email protected]>
Automated sync of `main` to `dev` found **merge conflicts** that require manual resolution. ### How to resolve ```bash git fetch origin chore/sync-main-to-dev-9-1:chore/sync-main-to-dev-9-1 git checkout chore/sync-main-to-dev-9-1 git merge origin/dev # resolve conflicts git commit -S git push origin chore/sync-main-to-dev-9-1 ``` Once pushed, this PR will update and become mergeable.
…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
…614) ## 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 - [x] `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](#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 - [x] Tests pass locally (`just test`) - [x] 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 - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have updated `CHANGELOG.md` in the `[Unreleased]` section (and pasted the entry above) - [x] My changes generate no new warnings or errors - [x] I have added tests that prove my fix is effective - [x] New and existing unit tests pass locally with my changes ## Additional Notes - **Do not auto-close #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 #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
Move Unreleased content to [0.3.8] - TBD and create fresh empty Unreleased section for continued development.
The 'Create release branch from dev' step re-read dev's ref and trusted the result. GitHub's REST ref read is not strongly consistent right after a write, so ~1s after commit-action pushes the freeze the read can still return the pre-freeze SHA; retry only retries on failure, so the stale-but-successful read slipped through and release/X.Y.Z was branched without the freeze, failing downstream release validation (missing '## [X.Y.Z] - TBD'). Poll dev until it advances past the captured pre-freeze SHA before branching, and hard-fail if it never does. Applied to this repo's workflow and the synced assets/workspace template. Refs: #617
## Description Fixes a read-after-write race in `prepare-release` that can create the `release/X.Y.Z` branch at the **pre-freeze** dev SHA, so the release branch lacks `## [X.Y.Z] - TBD` and the downstream `Release` workflow fails validation (`does not contain '## [X.Y.Z] - TBD'`). Surfaced on the 0.3.8 release. ## Type of Change - [x] `ci` -- CI/CD pipeline changes (fix) ## Root cause Within a successful `Prepare Release` run, the "Create release branch from dev" step re-reads `dev`'s ref and branches from whatever it returns: ```bash DEV_SHA=$(retry ... gh api ".../git/ref/heads/dev" --jq '.object.sha') ``` GitHub's REST ref read is not strongly consistent immediately after a write — ~1s after commit-action pushes the freeze, the read can still return the pre-freeze SHA. `retry` only retries on **failure**, so a stale-but-successful read passes through and the release branch is cut without the freeze. The failure only surfaces two steps later in `Release`. Evidence (run `27949666239`): capture pre-prepare dev SHA `a1e787c` (11:34:42) → commit freeze `0a9334d` (11:34:44) → create branch re-read dev → **`a1e787c`** (11:34:45) → `release/0.3.8` cut at the pre-freeze SHA. ## Changes Poll `dev` until its SHA differs from the captured `prepare_start_sha` (with backoff), and hard-fail if it never advances; branch from that confirmed post-freeze SHA. Applied to both copies of the identical step: - `.github/workflows/prepare-release.yml` - `assets/workspace/.github/workflows/prepare-release.yml` ## Changelog Entry ### Fixed - **Prevent prepare-release from branching `release/X.Y.Z` at the pre-freeze dev SHA** ([#617](#617)) - The "Create release branch from dev" step now polls dev until it advances past the captured pre-freeze SHA before branching, and hard-fails if it never does, closing a read-after-write race that could create a release branch missing the `## [X.Y.Z] - TBD` freeze ## Testing - [x] `pre-commit run` passes (yamllint/shellcheck/generate-docs/etc.). - Logic traced against the failing 0.3.8 run; the guard would have looped until dev showed `0a9334d` (or failed loudly) instead of branching at `a1e787c`. ## Notes Separate root cause from #612 (smoke-test dispatch idempotency) — this is the devcontainer's own release branch-creation step. The already-stale `release/0.3.8` still needs a one-off recovery (fast-forward to dev + re-run Release); this PR prevents recurrence. Refs: #617
Move Unreleased content to [0.3.8] - TBD and create fresh empty Unreleased section for continued development.
c-vigo
marked this pull request as ready for review
June 22, 2026 12:39
c-vigo
approved these changes
Jun 22, 2026
The 'Extract CHANGELOG content for PR body' step used an unanchored sed range (/## \[/), so an inline backtick-quoted heading inside a bullet (e.g. `## [X.Y.Z] - TBD`) ended the range early and truncated the release PR body. Anchor both range patterns to start-of-line (/^## \[/) so only real column-0 version headings delimit the section. Applied to this repo's workflow and the synced assets/workspace template. Refs: #620
2 tasks done
…621) ## Description Fixes a latent bug in `prepare-release`'s "Extract CHANGELOG content for PR body" step that truncated the release PR body (observed on #619) when a `## [X.Y.Z]` section contains the literal `## [` inside a bullet (e.g. a changelog entry that quotes `` `## [X.Y.Z] - TBD` ``). Targeted at **`release/0.3.8`** so it ships with this release. ## Type of Change - [x] `ci` -- CI/CD pipeline changes (fix) ## Root cause ```bash CHANGELOG_CONTENT=$(sed -n "/## \[$VERSION\]/,/## \[/p" CHANGELOG.md | sed '$d') ``` The range-end pattern `/## \[/` is unanchored, so it matches the first line containing `## [` anywhere — including inline backtick-quoted headings inside bullets — closing the range early and dropping the rest of the section. ## Change Anchor both range patterns to start-of-line: ```bash sed -n "/^## \[$VERSION\]/,/^## \[/p" CHANGELOG.md | sed '$d' ``` Applied to both copies: - `.github/workflows/prepare-release.yml` - `assets/workspace/.github/workflows/prepare-release.yml` ## Testing - [x] `pre-commit run` passes. - Verified against the real `release/0.3.8` CHANGELOG: the old pattern stops after the first #617 bullet; the anchored pattern extracts the full `[0.3.8]` section (both #617 and #612), ending at the blank line before `## [0.3.7]`. ## Notes The release→main→dev sync will carry this back to `dev`; no separate dev PR needed. PR #619's body was already corrected manually. Refs: #620
Set release date to 2026-06-22 and regenerate release docs. Refs: #619
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.
Release 0.3.8 - 2026-06-22
This PR prepares release 0.3.8 for merge to main.
0.3.8 - 2026-06-22
Fixed
release/X.Y.Zat the pre-freeze dev SHA (#617)## [X.Y.Z] - TBDfreezeprepare-changelog finalizeis now a no-op when the version heading is already dated, instead of erroringprepare-changelog preparefolds an existing same-version heading back into a single## [X.Y.Z] - TBDsection instead of stacking a duplicateprepare-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 theUnreleasedsectionsedrange to start-of-line headings, so an inline backtick-quoted heading inside a bullet no longer ends the range early