Skip to content

Open a repair PR when the release sync hits conflicts - #1883

Merged
David Pine (IEvangelist) merged 2 commits into
mainfrom
ievangelist-update-release-branch-failures
Oct 13, 2026
Merged

David Pine (IEvangelist) merged 2 commits into
mainfrom
ievangelist-update-release-branch-failures

Conversation

@IEvangelist

Copy link
Copy Markdown
Member

Summary

Update Release Branch currently fails on every push to main once a merge into release/X.Y has a real conflict that the helper can't auto-resolve (e.g. runs 38433783235 and 38436114463 on component-props.contracts.ts). It stays red until someone notices and repairs the branch by hand.

  • The merge helper now exits 3 for "conflicts need human review" (merge aborted, release untouched) instead of a generic failure.
  • A new --commit-conflicts mode commits the merge with conflict markers left in the unresolved files, keeping both parents, and writes the conflicted paths to $RELEASE_SYNC_CONFLICTS_FILE.
  • On exit 3 the workflow pushes a rolling release-sync/X.Y branch and opens a draft PR into release/X.Y that lists the conflicts and the "Create a merge commit, never squash" instructions. The run finishes green with a warning and summary link.
  • Before doing any work, the workflow checks for an open PR from release-sync/X.Y. If one exists it skips the sync, so pushes to main no longer repeat the same failure while a human resolves it. After the repair merges, the next push resumes syncing.
  • The app token now requests pull-requests: write (already granted for update-integration-data.yml).

Non-conflict failures (push rejection, fatal git errors) still fail the job as before. This is independent of #1701 (push-race retry) and #1666 (version config conflicts) and composes with them.

Third-party links and affiliations

None

Validation

  • bash .github/scripts/test-merge-main-into-release.sh: all cases pass, including new exit-code 3, --commit-conflicts with conflicts, and --commit-conflicts on a clean merge.
  • bash -n on the three workflow run blocks (extracted from the YAML): passed.
  • prettier --check on the workflow: passed after --write.
  • Dry run against the real origin/release/17.0 and origin/main in a temporary worktree: the default mode aborts with exit 3, and --commit-conflicts produces a two-parent merge listing src/frontend/tests/typecheck/component-props.contracts.ts with a clean working tree.
  • Not run: the workflow end-to-end (PR creation and the skip check need Actions with the app token).

Exit 3 from the merge helper signals conflicts needing review. The workflow
then pushes a rolling release-sync/<version> branch holding the merge with
conflict markers and opens a draft PR into the release branch. While that PR
is open, later runs skip syncing instead of failing again.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 18:04

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.

🟡 Changes recommended

Repair detection is spoofable, while non-marker conflicts can be silently resolved and validation bypassed.

4 open findings
What changed in this PR

Automates human repair when release synchronization encounters unresolved conflicts.

Changes:

  • Adds conflict-specific helper behavior and exit code.
  • Opens and tracks draft repair PRs.
  • Expands merge-helper regression tests.
File Description
.github/​workflows/​update-release-branch.yml Detects and creates repair PRs.
.github/​scripts/​merge-main-into-release.sh Commits conflicts for review.
.github/​scripts/​test-merge-main-into-release.sh Tests new helper behavior.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

- Classify unresolved conflicts (text, binary, deleted-on-main,
  deleted-on-release) and call out the ones without markers in the PR body
- Run the conflict-marker check on every path except unresolved ones
- Match the repair PR head owner so fork branches cannot pause syncing
- Buffer the helper summary so manual-recovery guidance is not duplicated

Co-authored-by: Copilot App <[email protected]>
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Frontend HTML artifact ready

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

VS Code: Open PR #1883 artifacts

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

@IEvangelist
David Pine (IEvangelist) merged commit 4c6faf6 into main Oct 13, 2026
19 checks passed
@IEvangelist
David Pine (IEvangelist) deleted the ievangelist-update-release-branch-failures branch October 13, 2026 20:09
David Pine (IEvangelist) added a commit that referenced this pull request Oct 19, 2026
## Summary

<!-- Describe what this pull request changes and why. -->

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

<!--
List any third-party links added or changed by this pull request and
disclose any
material affiliation with the linked organizations, such as employment,
sponsorship, or ownership. Write "None" if this pull request doesn't add
or
change third-party links.
-->

None.

## Validation

<!-- List the checks you ran or explain why validation isn't needed. -->

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

Co-authored-by: David Pine <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 65be19d6-1259-4301-8367-94450d9a82ba
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