Skip to content

Keep release sync from re-conflicting after a squashed repair PR - #1901

Merged
David Pine (IEvangelist) merged 1 commit into
mainfrom
fix-release-sync-ancestry
Oct 19, 2026
Merged

David Pine (IEvangelist) merged 1 commit into
mainfrom
fix-release-sync-ancestry

Conversation

@IEvangelist

Copy link
Copy Markdown
Member

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 main can't be merged into release/X.Y cleanly, the sync opens a repair PR (release-sync/X.Y) that holds the merge. #1886 was squash-merged, so its content reached release/17.0 but its history didn't: e95a50157, 4c6faf60d, af7b7ca6c and 68e5026fe from main are still not ancestors of the release branch. The next sync used the stale merge-base 73158d192 and conflicted again on content that was already resolved.

Fix.

  • .github/scripts/repair-release-sync-ancestry.sh (new) finds the newest main commit 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.yml runs the script in a new "Record main history from a landed repair PR" step, just before the main merge. The commit stays local and goes out with the sync's existing push, so there's still one push and one CI run.
  • The repair PR body still prefers Create a merge commit, but now says a squash no longer re-conflicts the next sync.
  • CI runs bash -n on the new script in release-sync-tests, and test-merge-main-into-release.sh gains 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.

  • If someone rebases the repair branch and drops its merge commit, no main history is left to recover.
  • This doesn't repair a repair PR that's already open. Resolve release sync conflicts for release/17.0 #1896 needs a manual decision.
  • release/17.0 already has a duplicated ReadableText block in src/frontend/tests/typecheck/component-props.contracts.ts. It came in with [docs] Document dashboard startup telemetry #1867, whose branch merged both main and release/17.0 and ended up with two copies. Removing it needs a separate change on release/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.
  • Mutation checks on the new script: the suite caught all three mutants (a no-op heal, -s ours removed, and the already-an-ancestor early exit removed).
  • bash -n on merge-main-into-release.sh, repair-release-sync-ancestry.sh and test-merge-main-into-release.sh: passed.
  • actionlint .github/workflows/update-release-branch.yml .github/workflows/ci.yml: no findings.
  • Parsed both workflows with PyYAML and ran bash -n on every run: block: passed.
  • Replayed the real incident with release tip 1080319c0, repair PR Resolve release sync conflicts for release/17.0 #1886 head ee018c095, the extracted workflow steps, a stub gh serving the real API response, and a local bare origin. Without the new step, the merge exits 3 on the stale merge-base 73158d192 and leaves three files for human review. With it, the new step records e95a50157, 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 main or workflow_dispatch, so the first sync after this merges is the live check.

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
Copilot AI balanced review requested due to automatic review settings October 16, 2026 13:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Frontend HTML artifact ready

The latest frontend build uploaded the frontend-dist artifact for PR #1901. Use the VS Code button below to open this PR with GitHub Artifacts Explorer and browse the built HTML locally.

VS Code: Open PR #1901 artifacts

This comment updates automatically when a new frontend build artifact is uploaded.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the release-sync ancestry repair and workflow changes. No actionable issues found. Build and tests were not run, per request.

@IEvangelist
David Pine (IEvangelist) merged commit fa51b99 into main Oct 19, 2026
20 checks passed
@IEvangelist
David Pine (IEvangelist) deleted the fix-release-sync-ancestry branch October 19, 2026 13:06
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.

3 participants