Skip to content

ci(release): merge each release back into dev automatically - #1109

Merged
singaraiona merged 3 commits into
devfrom
ci/release-merge-back
Nov 11, 2026
Merged

singaraiona merged 3 commits into
devfrom
ci/release-merge-back

Conversation

@singaraiona

@singaraiona singaraiona commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Merging a release PR leaves a commit on master that dev lacks. The next release PR is then out of date with master and, after a squash, shows conflicts that aren't real. #1108 showed 72 conflicting files even though master had no content dev lacked.

RELEASE.md asks for a manual merge-back, but nothing enforced it and it was skipped after v2.11.5 and v3.0.1. #985 tried to repair the ancestry, but it merged before #984 existed, so it could only tie dev to v2.11.5.

Change

  • New merge-back job in release.yml: it checks out the release commit and runs the helper from a copy in RUNNER_TEMP, so the dev tip can't change which helper runs. It runs after prepare and doesn't wait for the build, because the commit is on master whether or not the build succeeds. It isn't best-effort, so a failure shows red.
  • New .github/release-merge-back.sh: it checks that the release tree equals the PR head and that dev contains the PR head, then does a -s ours merge and confirms that no files changed. It retries if dev moves during the push, and does nothing if dev already contains the release.
  • RELEASE.md: the manual fallback runs the same helper with the release PR's SHAs, so it applies the same checks. When a check fails, it says to do a normal, reviewed merge and never -s ours.

Testing

The workflow job itself hasn't run. I tested the script against a local bare repo:

Scenario Result
Squash release, dev moved on Merged, tree unchanged, next release merges cleanly
Re-run No-op
Merge-commit release Merged
master carries a hotfix Fails with an error, dev untouched
dev lacks the PR head Fails with an error, dev untouched
Push rejected once Retried and merged

Before merging

The job pushes with the existing PAT secret, because GITHUB_TOKEN can't get past the required rayforce-audit check on dev. No current workflow uses that secret, so its owner and scopes are unverified. It needs to belong to an admin, and it may need the workflow scope. If it can't push, the job fails with instructions for the manual step.

@morsel-ray morsel-ray left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Source review: the guarded ours strategy is appropriate here, not a content merge. For the reviewed script/trusted event inputs, release-tree==PR-head-tree plus PR-head ancestry in current dev establish the intended case; the merge preserves dev content and adds the specific release ancestry. The non-force fetch/recheck/retry loop handles ordinary forward dev movement. Manual dispatch/prepare-failure skip semantics and publish depending only on prepare/build are clear.

Two execution/documentation follow-ups below. I read the complete172-line change and relevant owning workflow/script/docs; independently verified six immutable Git snapshots plus the derived diff by applying it to an external index and reproducing the exact head tree (with the new script executable mode restored from Git metadata). This is source/provenance review, NOT my repetition of your bare-repo tests or an actual Actions/credential test.

Credential owner/scopes and any operator-approved protected-branch exception remain yours to verify without disclosing the secret. I have not inspected the credential, changed permissions/protection, run the workflow/script, approved or merged this automation.

Comment thread .github/workflows/release.yml Resolved
Comment thread RELEASE.md Resolved

@morsel-ray morsel-ray left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Both earlier requests are source-addressed in 407830ad: the workflow checks out the immutable release commit and copies the helper outside the worktree before it switches branches; the manual fallback invokes that same checked helper with the release PR SHAs and explicitly rejects an unchecked -s ours fallback. I read the complete 80-line repair, the job context and the unchanged helper (byte-identical to the earlier reviewed version).

Resolving my two source-review threads. This is not a workflow execution or verification of the deployment prerequisites listed in the PR: the existing PAT configuration/permissions remain an operator check. I have not inspected secret values, exercised a release, or established that the automation can push. No new merge-back or release action was performed.

Merging a release PR leaves a commit on master that dev lacks. The next
release PR is then out of date with master and, after a squash, shows
conflicts that aren't real, as #1108 did. RELEASE.md asked for a manual
merge-back, which was skipped after v2.11.5 and v3.0.1.

Add a merge-back job to the Release workflow. It verifies that dev already
has everything the release shipped, then records the ancestry with a -s ours
merge that changes no files. If master carries changes of its own, it fails
instead of merging.
The job checked out dev and ran whatever helper dev held when the runner
started, with the PAT persisted. It now checks out the release commit the
PR merged, and runs a copy from RUNNER_TEMP, since the helper switches the
working tree to dev while bash is still reading it.

RELEASE.md's manual fallback ran a bare -s ours merge of moving
origin/master, skipping the checks the job applies. It now runs the same
helper with the release PR's SHAs, and says to do a normal, reviewed merge
when a check fails instead of forcing -s ours.
@singaraiona
singaraiona force-pushed the ci/release-merge-back branch from 407830a to ba969eb Compare November 8, 2026 17:46
@singaraiona
singaraiona merged commit c3353ff into dev Nov 11, 2026
32 of 41 checks passed
@singaraiona
singaraiona deleted the ci/release-merge-back branch November 11, 2026 17:20
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.

2 participants