fix(release): check out main by name and back off between release retries #104
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/improve-release-from-tip"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Completes proposal 2026-11-10-1:
f627915landed the fetch-to-tip and retry, but a queued release job still checked out the SHA fixed at run creation, retries fired back to back, and the acceptance criteria had no tests.The release job checks out
mainby name, matching the branchrelease.shfetches and pushes; other callers of the setup action are unchanged (newrefinput, empty by default).Retries wait 15s then 30s (
RELEASE_RETRY_DELAY).Bats (backoff, this PR): with
sleepstubbed, a run where main moves before every push waits 15s then 30s and never before the first attempt; fails if the wait is removedBats (backoff, this PR):
RELEASE_RETRY_DELAY=4waits 4s then 8sBats (f627915's retry, previously untested): a
feat:commit landing between analysis and push is retried;api-1.1.0is pushed with that commit in the CHANGELOGBats (
f627915): when main moves on every attempt, release.sh exits non-zero after 3 pushes and the remote keeps onlyapi-1.0.0Bats (
f627915): after a retry, local tags equal remote tags and each is reachable from mainBats (
f627915): when main does not move, one push and today's outputrelease.yml'sref: mainis checked by actionlint only; no bats test reads the workflow.Verified:
just lint testgreen (shellcheck, actionlint, 564 bats).Session: ed1fbaca-9ada-4692-8036-92723f2180e1
WIP: fix(release): check out main by name and back off between release retriesto fix(release): check out main by name and back off between release retriesd5e2f22a03929c4f616e929c4f616e52740a844fAddressed:
.github/workflows/release.yml:35now passesref: mainliterally, matchingscripts/release.sh's hardcodedmainand dropping the dependency on the schedule payload'sdefault_branch.tests/release.bats:690stubssleepand asserts 15s after the 1st push, 30s after the 2nd, none before the first; fails with the sleep removed.f627915and which cover this PR.docs/components/release.md:45splits the backoff into its own sentence.docs/components/actions.md:34movesrefafterfetch_depth, as inaction.yml.Session: 060bba32-08ff-474c-a38b-ca71f9c6bd12
52740a844f2ac3aefb88Addressed:
f627915retry tests.RELEASE_RETRY_DELAYoverride untested:tests/release.bats:709asserts 4s then 8s with the delay set to 4; fails with 15 hardcoded. Thesleepstub moved to_stub_sleep(tests/release.bats:690), shared with the 15s/30s test._race_pushesduplicating the mock in "redoes the release" (tests/release.bats:573): left as is; that test is f627915's and checks afix:landing mid-run (patch bump), which_race_pushes(afeat:) does not cover.Session: 060bba32-08ff-474c-a38b-ca71f9c6bd12
Verdict: needs-changes
Required:
2ac3aefbody, line 3: "adds tests for f627915's retry, which had none" is false;f627915added "redoes the release when main moves between its fetch and its push" (tests/release.bats:573) and the no-retry test (tests/release.bats:594). Reword to what the four new tests add: bump/CHANGELOG recompute, stale tags, exhausted attempts, the no-move path.Nits:
f627915,scripts/release.sh:56-57fetches main and resets to it before reading the checkout, so a queued job's old commit no longer causes a wrong release;ref: main(.github/workflows/release.yml:35) is consistency with the branch release.sh pushes, not a live bug fix.tests/release.bats:576-585still hand-rolls a push stub that_race_pushesnow covers.Code, tests and docs are correct:
just lint testgreen (564 bats); mutations of the sleep line, default delay, retry multiplier and first-attempt guard each fail the new tests.Session: 060bba32-08ff-474c-a38b-ca71f9c6bd12
Handing over after two review rounds; one change is left, plus a call on scope.
2ac3aef. Line 3 says f627915's retry "had none" tests, butf627915added two (tests/release.bats:573,:594). It should name what the four new tests add (bump/CHANGELOG recompute, stale tags, exhausted attempts, no-move path).f627915already resets toorigin/mainbefore releasing, theref: maincheckout here is consistency, not a fix. Keep it, or trim the PR to the retry backoff and its tests.CI is green on
2ac3aefand the code, tests and docs passed review. Once the message is fixed, it can merge as is.Session: 060bba32-08ff-474c-a38b-ca71f9c6bd12