Repository navigation
feat(ci): add prepare-release extension hook with devkit dogfooding - #1067
Merged
Merged
Conversation
Scaffold a prepare-release-extension.yml reusable workflow (workflow_call, default no-op), the mutating counterpart to release-extension.yml. prepare-release.yml calls it after the release branch is created and before the draft PR opens; the prepare phase is split into prepare/extension/open-pr jobs with a single rollback job that deletes the partial branch on any failure. Add it to PRESERVE_FILES, document the hook contract in DOWNSTREAM_RELEASE.md, and dogfood it: devkit's own hook runs the workspace-manifest sync that was a hardcoded divergence in prepare-release.yml. Refs: #1059
The scaffold-verbatim freeze commits only the root CHANGELOG.md, leaving dev's synced mirror stale until the main-to-dev sync — a red sync-manifest hook on every dev PR during the release window. Devkit's extension now re-syncs the mirror against dev's current head and commits just the mirror to dev, idempotently, as its LAST step: any extension failure means the reconcile did not land (rollback's root-restore applies), and once it lands the only remaining failure domain is open-pr, where the rollback's dev-advanced guard leaves dev at root(frozen) == mirror(frozen). Every failure path keeps dev's root and mirror consistent. Refs: #1059
…b structure The #1059 restructure moved the inline if-failure rollback step into a dedicated rollback job covering prepare, extension and open-pr. Three just.bats assertions greped the old step shape; each is migrated to guard the same intent against the new structure (the rollback test now also pins the per-phase failure conditions). Test migration for an intentional structural change, so no RED phase applies. Refs: #1059
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
Implements #1059 — the mutating counterpart to
release-extension.yml.The hook
prepare-release-extension.yml(workflow_call, default no-op, preserved file — added toPRESERVE_FILES, carries the seeded banner): inputsversion,release_branch,branch_sha(post-freeze),dry_run, git identity;secrets: inheritso real extensions can mint the COMMIT_APP token exactly like the freeze commit does.prepare-release.ymlrestructured intovalidate → prepare → extension → open-prplus a singlerollbackjob (mirroringrelease.yml's pattern): the extension runs strictly after therelease/X.Y.Zbranch exists and before the draft PR opens, so extension commits appear in the PR diff from the start, and extension failure lands in the existing rollback domain (delete branch + restore dev changelog — no new rollback machinery).Devkit dogfooding — its one template divergence removed
Devkit's hardcoded
sync_manifest.pystep (and its rollback twin) moves into devkit's ownprepare-release-extension.yml. Bothprepare-release.ymlcopies now share a structurally identical, test-pinned job DAG; remaining diffs are the known pre-existing toolchain divergences (#991/#996).Drift window closed (found during implementation)
The removed inline step also kept dev's hook-synced changelog mirror consistent with the freeze commit. Devkit's extension therefore ends with a dev-side reconciliation: regenerate the mirror against dev's frozen changelog and commit just the mirror to dev (idempotent, dry-run-gated). The workflow header documents a full failure-ordering analysis: the reconcile commit is the last failable-adjacent step, the rollback's SHA guard composes correctly with it, and every enumerated failure path leaves dev with root+mirror consistent — without teaching the scaffold-shaped rollback any devkit-specific paths.
Docs
Hook contract added to
docs/DOWNSTREAM_RELEASE.md(dry-run + rollback semantics, and the commit-action dist-rebuild example — its first consumer, closing the manual rebuild loop from vig-os/commit-action#71).TDD: two failing-test → implementation pairs; 13 shape/DAG tests including the devkit-vs-scaffold structural identity pins.
Test evidence
uv run pytest tests/test_workflow_prepare_extension.py→ 13 passed (both RED phases committed first)prek run --all-files→ 51 hooks green (re-verified independently before push)Closes #1059
Refs: #1044, #1045, #1046