Repository navigation
fix(ci): revert only the run's own finalize commits in release rollback - #1467
Merged
Merged
Conversation
Executed decision matrix + workflow-shape assertions for the rollback job in both release.yml copies: no-op when finalize never ran or for candidates, refuse loudly when the branch tip is not exactly the commit(s) this run wrote, and revert only after the chain proof. Red against the current tree-reset logic that destroyed foreign commits in #1459/#1460. Refs: #1462
The rollback job reset the branch tree to the run-start PRE_SHA whenever a failed run's tip had moved, destroying commits merged mid-run (#1459/#1460). It now no-ops when finalize never ran (and on branch-neutral candidates), verifies the tip is exactly the finalize commit — optionally with the sync-issues commit on top — parented on the snapshot, using SHAs finalize exports as job outputs, and refuses loudly otherwise. The scaffolded consumer rollback swaps its git reset --hard + force push for the identical guarded Git Data API revert; release-core exposes finalize_result/finalize_commit_sha to the caller, and the devkit PR-body restore skips when finalize was skipped. Refs: #1462
Squash merges are single-parent, so a foreign PR squash-merged between the finalize commit and the post-sync tip record would pass the parentage check and get reverted. The FINAL_TIP path now also requires the tip's message to be exactly 'chore: sync issues and PRs' in both release.yml copies, and its author to match the org commit App (SYNC_COMMIT_AUTHOR knob, devkit only — consumer App bot names are not a devkit-known constant, so the scaffold relies on the message gate alone). Refs: #1462
c-vigo
enabled auto-merge
August 12, 2026 11:53
This was referenced Aug 12, 2026
c-vigo
added a commit
that referenced
this pull request
Aug 12, 2026
… release workflows (#1472) ## Summary #1467 replaced the scaffolded orchestrator's rollback (`git reset --hard` + force-push under a configured git identity) with the guarded Git Data API revert — the last consumer of the `git_user_name` / `git_user_email` values threaded through the release workflows. This removes the dead plumbing everywhere, caller and callee in lockstep. The set turned out larger than #1467's "three workflows" note: **four workflows × two copies**: - scaffold `release.yml`: `workflow_dispatch` inputs + the forward into the `release-core` call - scaffold `release-core.yml`: `workflow_call` declarations (zero use sites in the file) - `prepare-release.yml` (devkit's own + scaffold): dispatch inputs + the forward into the extension call - `prepare-release-extension.yml` (devkit's own + scaffold): seam template declarations (the default no-op never reads them) Plus the contract docs (`docs/DOWNSTREAM_RELEASE.md` + scaffold copy). Devkit's own `release.yml` was already clean (bespoke, zero hits) and is untouched. Historical archives and released changelog entries deliberately kept. ## Consumer safety This is a `workflow_call`/seam interface change, hence the `semver:minor` label and the `### Removed` changelog entry under 1.8.0. Orchestrator and core ship together via the scaffold, so caller and callee change in lockstep — no consumer action beyond the normal upgrade. All six reachable consumers' **preserved** `prepare-release-extension.yml` copies (commit-action, sync-issues-action, org-config, devkit-smoke-test, vault, exo-fleet) were checked: they declare the pair but have zero use sites, and since the inputs are optional with declared defaults, a stale preserved copy stays valid against the upgraded caller. The one genuine surface change: the (never-exercised) dispatch knob for a custom release-commit identity is gone — all release writes are App-identity API commits. ## Tests TDD: `test(ci)` commit landed RED first (5 failed / 32 passed — exactly the new absence assertions). `test_scaffold_orchestrator_keeps_the_dispatch_identity_inputs` rewritten to `..._drops_...` (also pins the release-core declarations and the core-call `with:`, keeps the App-token rollback assertions); the pair dropped from `REQUIRED_INPUTS` in `test_workflow_prepare_extension.py` plus two absence tests parametrized over both extension copies. Verification (direct exit codes): workflow suites 66 passed; broad `pytest tests/` (excl. image/integration/flake) 534 passed; `actionlint` on the two touched devkit workflows clean; rendered-tree actionlint bats 6/6; after merging in the updated `release/1.8.0` (#1468 landed mid-flight; clean auto-merge, changelog union verified, mirror byte-identical): full `init-workspace.bats` 252/252 ok and full `prek run --all-files` exit 0. Closes #1470
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.
Summary
release.yml's Rollback on Failure built a commit whose tree was reset topre_finalize_sha— a run-start snapshot — whenever the run failed and the branch tip had moved at all. Any commit merged to the release branch while a run was in flight was silently destroyed on that run's failure (#1459: the merged content of #1447 and #1448 wiped offrelease/1.8.0twice, both times withfinalizeskipped).Fix
The rollback branch step now proves the branch holds only this run's own writes before touching anything, and refuses loudly otherwise:
finalizenever ran (needs.finalize.result == 'skipped'/empty) — this alone prevents both incidents.release_kind == final(second independent shield; both incidents were candidates).CURRENT_SHA == PRE_SHAno-op.finalizenow exports the exact commit SHA it pushed (commit-action'scommit-shaoutput) plus the post-sync tip. The tip must be exactly the finalize commit parented onPRE_SHA, or the sync commit directly on top of it — and since this org squash-merges PRs (single-parent, indistinguishable by parentage alone), the sync-tip path additionally gates on the sync commit's fixed messagechore: sync issues and PRs(devkit also pins the authorcommit-action-bot[bot]; live-verified against the real 1.7.0 finalize/sync pair onmain). Anything else ⇒::error+ step failure, branch untouched; the failure issue and job summary report the outcome.Only when the proof passes does the existing tree-at-
PRE_SHArevert commit run — at that point it is exactly a revert of the run's own commits.The PR-body restore step (and its Release-App token mint) now also skip when finalize was skipped — finalize is the only PR-body writer.
All three copies fixed consistently: devkit's
release.yml, scaffoldedrelease-core.yml(newfinalize_commit_sha/finalize_resultworkflow_call outputs), and the scaffolded orchestratorrelease.yml— whose old rollback was agit reset --hard $PRE_SHA+ force-push with zero guards, now replaced by the identical guarded API revert. Scaffold copies gate on the sync message only (the commit-bot name is per-consumer, the shippedsync-issues.ymlmessage is a constant); script bodies are byte-identical between copies.No concurrency group (issue proposal 4) — deliberately out of scope.
Tests
TDD:
test(ci)commit landed RED first (18 failed / 5 passed — the 5 were retained behaviors). Newtests/test_release_rollback_guard.pyexecutes the actual workflow scripts against stubbedgh/retrysimulating the Git Data API, parametrized over both copies: both incident shapes no-op, foreign-tip and foreign-parent refuse, foreign squash commit atop finalize refuses (the row that fails against the unhardened script), genuine sync commit reverts. Existing #1378 rollback-identity test rewritten to pin the App-token API rollback.Verification (direct exit codes):
pytest tests/test_release_rollback_guard.py tests/test_workflow_release_publish.py→ 43 passed; broadpytest tests/(excl. image/integration/flake) → 524 passed;actionlint .github/workflows/release.ymlclean; rendered-tree actionlint bats 6/6 (covers the scaffold copies in all modes); fullprek run --all-files→ exit 0.Also included:
choremerge ofrelease/1.8.0(brings in the #1463 fix from #1464; changelog union resolved manually, mirror byte-identical), and stale "branch reset to pre-finalization state" wording updated indocs/RELEASE_CYCLE.md/DOWNSTREAM_RELEASE.mdand the failure-issue texts.Notes
finalize_commit_shafollows the pattern the job already relied on forpre_finalize_sha.git_user_name/git_user_emailplumbing inrelease-core.yml(now unused after dropping the git-CLI rollback) is left in place — removal ripples across three workflows; separate-issue material.Closes #1462