Repository navigation
ci(release): merge each release back into dev automatically - #1109
Conversation
morsel-ray
left a comment
There was a problem hiding this comment.
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.
morsel-ray
left a comment
There was a problem hiding this comment.
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.
407830a to
ba969eb
Compare
Problem
Merging a release PR leaves a commit on
masterthatdevlacks. The next release PR is then out of date withmasterand, after a squash, shows conflicts that aren't real. #1108 showed 72 conflicting files even thoughmasterhad no contentdevlacked.RELEASE.mdasks 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 tiedevto v2.11.5.Change
merge-backjob inrelease.yml: it checks out the release commit and runs the helper from a copy inRUNNER_TEMP, so the dev tip can't change which helper runs. It runs afterprepareand doesn't wait for the build, because the commit is onmasterwhether or not the build succeeds. It isn't best-effort, so a failure shows red..github/release-merge-back.sh: it checks that the release tree equals the PR head and thatdevcontains the PR head, then does a-s oursmerge and confirms that no files changed. It retries ifdevmoves during the push, and does nothing ifdevalready 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:
devmoved onmastercarries a hotfixdevuntoucheddevlacks the PR headdevuntouchedBefore merging
The job pushes with the existing
PATsecret, becauseGITHUB_TOKENcan't get past the requiredrayforce-auditcheck ondev. No current workflow uses that secret, so its owner and scopes are unverified. It needs to belong to an admin, and it may need theworkflowscope. If it can't push, the job fails with instructions for the manual step.