Skip to content

feat(ci): add prepare-release extension hook with devkit dogfooding - #1067

Merged
c-vigo merged 5 commits into
devfrom
feature/1059-prepare-release-extension-hook
Jul 14, 2026
Merged

c-vigo merged 5 commits into
devfrom
feature/1059-prepare-release-extension-hook

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements #1059 — the mutating counterpart to release-extension.yml.

The hook

  • New scaffolded prepare-release-extension.yml (workflow_call, default no-op, preserved file — added to PRESERVE_FILES, carries the seeded banner): inputs version, release_branch, branch_sha (post-freeze), dry_run, git identity; secrets: inherit so real extensions can mint the COMMIT_APP token exactly like the freeze commit does.
  • prepare-release.yml restructured into validate → prepare → extension → open-pr plus a single rollback job (mirroring release.yml's pattern): the extension runs strictly after the release/X.Y.Z branch 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.py step (and its rollback twin) moves into devkit's own prepare-release-extension.yml. Both prepare-release.yml copies 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)
  • Full light CI lane → 137 passed; actionlint exit 0 on all touched workflows
  • prek run --all-files → 51 hooks green (re-verified independently before push)

Closes #1059
Refs: #1044, #1045, #1046

c-vigo added 5 commits July 14, 2026 15:17
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
@c-vigo
c-vigo merged commit 0fc7e48 into dev Jul 14, 2026
13 checks passed
@c-vigo
c-vigo deleted the feature/1059-prepare-release-extension-hook branch July 14, 2026 15:12
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