Skip to content

fix(ci): fast-forward dev to the release-branch mirror sync commit - #1121

Merged
c-vigo merged 2 commits into
devfrom
bugfix/1115-mirror-reconcile-ancestry
Jul 15, 2026
Merged

c-vigo merged 2 commits into
devfrom
bugfix/1115-mirror-reconcile-ancestry

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Summary

Every release cycle the post-promote sync-main-to-dev PR conflicted on exactly one file: the workspace changelog mirror assets/workspace/.devcontainer/CHANGELOG.md (#1091, #1114). Root cause, verified on the 1.2.1 cycle: the prepare extension minted the mirror reconcile as a sibling commit on dev (11ff0e1c) — same parent (freeze 849b324a) and same tree (d5b4f190) as the release-branch sync commit (e727daf0), but a distinct object. Dev's copy was never an ancestor of the release branch, so the mirror's merge base at sync time was the stale pre-freeze content → deterministic overlap conflict. The root changelog merges clean precisely because the freeze commit is shared ancestry.

Fix

After the extension commits the mirror sync to the release branch, fast-forward dev to that commit (non-force ref PATCH via the COMMIT_APP token) — but only while dev still sits on the freeze commit (inputs.branch_sha). Both branches then share the literal commit object, giving the mirror the same shared-ancestry property that already keeps the root changelog conflict-free.

  • FF target is the release commit-action step's commit-sha output, not a fresh ref read (avoids the read-after-write ref lag documented in [BUG] prepare-release can branch release/X.Y.Z at pre-freeze dev SHA (read-after-write race) #617).
  • force=false makes the update FF-only and atomic: a dev that advanced in the race window can never be clobbered. Deliberately not retried — a legitimate non-FF rejection must not be retried; transient failures degrade to the fallback.
  • Dev-advanced race or any PATCH failure → fall back to the previous sibling-commit reconcile (status quo, never worse; that one cycle may conflict).
  • Rollback interplay preserved: every step after the FF is gated on ff_done != 'true', and the fallback reconcile commit stays the job's last step — every failure path still leaves dev's root+mirror consistent under prepare-release.yml's dev-advanced guard. Header comment rewritten with the full analysis.

Devkit-local change only: prepare-release.yml stays scaffold-verbatim; the consumer no-op scaffold extension is untouched.

Verification

  • TDD: 5f991fa2 pins the new invariants (3 red structural tests), 71dc5d79 turns them green — tests/test_workflow_prepare_extension.py: 18 passed.
  • Full pre-commit suite green locally (actionlint validates the new step's steps.*.outputs references and if expressions).
  • Scratch-repo ancestry proof: root-only freeze → sibling mirror commits on both branches → git merge-tree --write-tree conflicts on the mirror (reproduces chore: sync dev with main (conflicts) #1114); dev fast-forwarded to the release-branch sync commit instead → same merge is clean.
  • Real end-to-end proof lands next release cycle: the sync PR should come out titled without "(conflicts)" and auto-merge.

Closes #1115

c-vigo added 2 commits July 15, 2026 14:43
The dev-side mirror reconcile must share ancestry with the release
branch: the extension fast-forwards dev to the release-branch sync
commit (non-force ref update, only while dev still sits on the freeze
commit) instead of minting a sibling commit, so the post-promote
sync-main-to-dev merge sees the mirror rewrite as common history.
Fallback to the sibling-commit reconcile stays pinned for the
dev-advanced race.

Refs: #1115
The extension previously minted a sibling reconcile commit on dev
(same parent and tree as the release-branch sync commit, distinct
object), so the mirror's merge base at post-promote sync time was the
stale pre-freeze content and sync-main-to-dev conflicted on the mirror
every release cycle. Fast-forwarding dev to the release branch's sync
commit makes the mirror rewrite shared ancestry, the same property
that keeps the root changelog conflict-free. Dev-advanced races and
ref-update failures fall back to the sibling-commit reconcile
(status quo). Every rollback failure path still leaves dev's
root+mirror consistent.

Refs: #1115
@c-vigo
c-vigo enabled auto-merge July 15, 2026 12:55
@c-vigo
c-vigo merged commit 9165bfa into dev Jul 15, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/1115-mirror-reconcile-ancestry branch July 15, 2026 12:57
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