Skip to content

Retry release sync after concurrent branch updates - #1701

Open
David Pine (IEvangelist) with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-github-actions-job
Open

David Pine (IEvangelist) with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-github-actions-job

Conversation

Copilot AI commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

The release-sync job failed when release/13.6 advanced after checkout but before the automated merge push. The workflow now refreshes the release tip and retries the sync instead of failing on a transient non-fast-forward rejection.

  • Release sync retry
    • Fetches main and the active release branch for each attempt.
    • Resets the local release branch to its current remote tip.
    • Retries rejected pushes up to three times.
for attempt in {1..3}; do
  git fetch origin main "$BRANCH"
  git checkout -B "$BRANCH" "origin/$BRANCH"
  # merge pinned main, then push
done
  • Regression coverage
    • Adds assertions to the existing release-sync test script for the refresh-and-retry workflow contract.

Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job for merging main Retry release sync after concurrent branch updates Sep 19, 2026
@IEvangelist
David Pine (IEvangelist) marked this pull request as ready for review September 19, 2026 00:29
Copilot AI lite review requested due to automatic review settings September 19, 2026 00:29

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.

Copilot review overview

🟡 Changes recommended

The retry implementation can become non-deterministic (re-pinning main on each attempt) and currently retries on any push failure rather than confirming a push race, which can mask real failures.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity

Open (2)
What changed in this PR

Improves the release-branch sync GitHub Actions workflow to better tolerate concurrent updates to the release branch by adding a refresh-and-retry loop around the merge/push, and adds lightweight regression assertions to ensure the workflow retains this behavior.

Changes:

  • Add a 3-attempt loop that re-fetches and re-checks out the release branch before re-running the sync and pushing.
  • Emit workflow warnings on transient push rejection and fail after exhausting retries.
  • Add script assertions that the workflow includes retry/refresh/push-handling logic.
File Description
.github/​workflows/​update-release-branch.yml Adds refresh-and-retry behavior around the merge helper + push to handle non-fast-forward races.
.github/​scripts/​test-merge-main-into-release.sh Adds grep-based assertions to enforce the workflow’s retry/refresh contract.

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

Comment thread .github/workflows/update-release-branch.yml Outdated
Comment thread .github/workflows/update-release-branch.yml Outdated
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Frontend HTML artifact ready

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

VS Code: Open PR #1701 artifacts

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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
David Pine (IEvangelist) added a commit that referenced this pull request Oct 13, 2026
## 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).

---------

Co-authored-by: David Pine <7679720+IEvangelist@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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