Repository navigation
Keep release sync from re-conflicting after a squashed repair PR - #1901
Conversation
Squash-merging a release-sync repair PR copies its resolved content onto the release branch but drops the main commits it merged. The next sync then computes a stale merge-base and conflicts again on content that was already resolved. Before each sync, record the newest merged repair PR's main history on the release branch with a tree-preserving merge commit. The commit stays local and is pushed together with the sync, so release still sees a single push. Merge-commit landings already contain that history, so they stay a no-op. Adds repair-release-sync-ancestry.sh, runs it from update-release-branch.yml, covers it in test-merge-main-into-release.sh, and syntax-checks it in the release-sync-tests job. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 65be19d6-1259-4301-8367-94450d9a82ba
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues were identified; tree-preservation safeguards and focused regression coverage support the change.
0 open findings
What changed in this PR
Prevents repeated release-sync conflicts after squash-merging a repair PR by restoring main’s ancestry without changing release content.
Changes:
- Adds a tree-preserving ancestry repair before the normal sync merge.
- Updates repair PR guidance and adds regression tests and CI syntax validation.
| File | Description |
|---|---|
.github/workflows/update-release-branch.yml |
Runs ancestry repair and updates merge guidance. |
.github/workflows/ci.yml |
Adds syntax validation for the repair script. |
.github/scripts/test-merge-main-into-release.sh |
Tests squash recovery, no-op cases, and failure safeguards. |
.github/scripts/repair-release-sync-ancestry.sh |
Records missing main ancestry while verifying tree preservation. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
James Newton-King (JamesNK)
left a comment
There was a problem hiding this comment.
Reviewed the release-sync ancestry repair and workflow changes. No actionable issues found. Build and tests were not run, per request.
Summary
Stops the release sync from leaving a merge conflict behind after a repair PR has landed, like the one in #1896. Follow-up to #1883.
Cause. When
maincan't be merged intorelease/X.Ycleanly, the sync opens a repair PR (release-sync/X.Y) that holds the merge. #1886 was squash-merged, so its content reachedrelease/17.0but its history didn't:e95a50157,4c6faf60d,af7b7ca6cand68e5026fefrommainare still not ancestors of the release branch. The next sync used the stale merge-base73158d192and conflicted again on content that was already resolved.Fix.
.github/scripts/repair-release-sync-ancestry.sh(new) finds the newestmaincommit the merged repair PR carries (git merge-base main <PR head>). If the release branch doesn't contain it yet, the script records it with a tree-preserving merge (-s ours). Only history changes, and the script verifies the tree is unchanged. It does nothing when the PR was merged with a merge commit or the commit is already an ancestor..github/workflows/update-release-branch.ymlruns the script in a new "Record main history from a landed repair PR" step, just before themainmerge. The commit stays local and goes out with the sync's existing push, so there's still one push and one CI run.bash -non the new script inrelease-sync-tests, andtest-merge-main-into-release.shgains four tests: a squashed repair PR (with a control that conflicts without the fix), a merge-commit no-op, unrelated history, and refusals.Known limits.
mainhistory is left to recover.release/17.0already has a duplicatedReadableTextblock insrc/frontend/tests/typecheck/component-props.contracts.ts. It came in with [docs] Document dashboard startup telemetry #1867, whose branch merged bothmainandrelease/17.0and ended up with two copies. Removing it needs a separate change onrelease/17.0.Third-party links and affiliations
None.
Validation
Run from Git bash on Windows:
bash .github/scripts/test-merge-main-into-release.sh: 15 passed, 0 failed.-s oursremoved, and the already-an-ancestor early exit removed).bash -nonmerge-main-into-release.sh,repair-release-sync-ancestry.shandtest-merge-main-into-release.sh: passed.actionlint .github/workflows/update-release-branch.yml .github/workflows/ci.yml: no findings.bash -non everyrun:block: passed.1080319c0, repair PR Resolve release sync conflicts for release/17.0 #1886 headee018c095, the extracted workflow steps, a stubghserving the real API response, and a local bare origin. Without the new step, the merge exits 3 on the stale merge-base73158d192and leaves three files for human review. With it, the new step recordse95a50157, the sync merges cleanly and pushes, and a second run reports "already an ancestor" and changes nothing.Not run: the workflow on GitHub Actions. It only runs on pushes to
mainorworkflow_dispatch, so the first sync after this merges is the live check.