Uh oh!
There was an error while loading. Please reload this page.
fix(ci): cut the release branch from current main, not the stale run SHA - #61
Conversation
dev/test-release-branch-race.sh extracts and runs the real 'Create release branch and push' step from cron-build-and-release.yml against a fake origin whose main advances mid-build, so it cannot drift from the step it guards. Asserts the condition GitHub actually rejects on: whether the pushed branch's workflow files differ from the default branch's. Fails against the current (pre-fix) step; passes once the branch is cut from origin/main. Also documents the release-job failure class in docs/build-fix.md.
Applies the workflow hunk from the PR body that claude[bot] could not push (its App token lacks the workflows permission). Verified locally: ./dev/test-release-branch-race.sh fails 3/6 assertions against the pre-fix step and passes 6/6 with this change; zizmor findings are unchanged from main.
Claude finished @sbs44's task in 10m 17s —— View job Code reviewNo blocking issues found. Checked for bugs, git-semantics correctness, historical context, prior PR feedback, and code-comment accuracy. (This repo has no I independently exercised the new regression test rather than trusting the PR body:
Non-blocking notes (scored below the reporting bar, recorded for the record)
🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Uh oh!
There was an error while loading. Please reload this page.
Fixes the nightly failure on vscode 1.136.0.
Refs #59
This was not a build failure
Run 33795347082 built both targets green —
Build BradfordCode (macOS arm64)andBuild REH server (linux x64)both succeeded. Patches,npm ciand the compile are all fine on 1.136.0; #60 already landed those fixes. The only failing job wasPublish release + update versions pin:Root cause: the release branch is cut from a stale SHA
The release commit touches only
upstream/stable.jsonandversions/stable/darwin-arm64/latest.json(1 file changedin the log) — it never touchesclaude-build-fix.yml. The error names a file the push did not modify because GitHub compares the pushed branch's workflow files against the default branch, not the diff of the commits being pushed.The timeline, from the run's own job timings:
actions/checkoutpinsGITHUB_SHA=42e1e60(main's tip)bf86348, changing onlyclaude-build-fix.ymlandclaude-code-review.ymlrelease/1.136.05923from the now-stale42e1e60and pushes → rejectedbf86348's parent is exactly42e1e60, confirming main moved 82 seconds into the run. The branch's workflow files were a version behind main, which reads to GitHub as "updating a workflow".GITHUB_TOKENis a GitHub App token with noworkflowspermission, and there is noworkflows:key forpermissions:— it cannot be granted in the workflow. So the fix has to remove the drift, not acquire the permission.This is a live race, not a one-off: the build window is ~15 minutes and dependabot bumps action pins inside
.github/workflows/on a schedule.The fix
Cut the release branch from current
origin/maininstead of the run's checked-out SHA, re-applying the two generated release files on top. Side benefits: the auto-release PR merges cleanly, andgh release create --targetstops tagging a stale tree.The workflow hunk could not be pushed. The fix loop's own
claude[bot]token has the same missingworkflowspermission asGITHUB_TOKEN:The contents API is gated identically (
403 Resource not accessible by integration), so there is no transport available to this token. Routing the logic into a shell script would not help — the workflow must still be edited to call it.So this PR contains the regression test and the docs; a human must apply the workflow hunk below. Please apply it to this branch (it is verified — see below):
git applythis patch to.github/workflows/cron-build-and-release.ymlWorth considering separately: granting the release job a token with
workflowspermission would also unblock the fix loop the next time this class of bug appears.Verification
dev/test-release-branch-race.sh(new) extracts and runs the real "Create release branch and push" step out of the workflow against a fake origin whose main advances mid-build, so it cannot drift from the step it guards. It asserts the exact condition GitHub rejects on.Against the pre-fix step (what is on main today) — reproduces the failure:
Against the fixed step:
Pin consistency:
upstream/stable.jsonalready pins1.136.0/520fb30b2d3d324b4cb2342f6e88e2cd93751de1, which matchesgit ls-remote refs/tags/1.136.0. This PR changes no build inputs, so no bump is needed.CI_BUILD=yes ./dev/ci-verify.sh --commit 520fb30b2d3d324b4cb2342f6e88e2cd93751de1— passed (overlay + patches +npm ci+ TypeScript compile):Tier reached: compile passed. Not run:
--full(vscode-min-prepackminify + ASCII hygiene) and packaging/signing.Note that
ci-verifyis not the load-bearing check for this change: it exercises patches and the compile, and this PR touches no build inputs. The build was already proven green at this tree by the failing run itself, whose only delta to main is workflow files.