Skip to content

ci(release): retry transient github reads in release scripts - #320

Merged
nixuuu merged 1 commit into
devfrom
ci/promotion-retry
Nov 7, 2026
Merged

nixuuu merged 1 commit into
devfrom
ci/promotion-retry

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 7, 2026

Copy link
Copy Markdown
Member

Automatic promotion failed in 5 of the last 8 scheduled runs on transient GitHub API errors: gh: Server Error (HTTP 502) on run/job lookups and unexpected end of JSON input from a paginated commits/<sha>/pulls read. The scripts made each call once, so one bad response failed the whole promotion.

scripts/release-github.ts (shared by promote, backmerge and release-upload) now retries GET calls and paginated reads on transient failures (HTTP 5xx, cut-off JSON, timeouts, connection resets) after 2, 5, 15 and 30 s. Other errors (404, auth) fail at once as before. Writes (POST/dispatch) never retry: a failed dispatch may still have started a release.

Verified with a fake gh that returns a 502, then a cut-off body, then data: the read succeeds on the third try; a 404 fails immediately. scripts/promote.test.ts passes; typecheck, lint and format are clean.

Copy audit: no UI text changed.

Automatic promotion failed on 502s and cut-off JSON from the GitHub API.
GET calls and paginated reads now retry transient failures with backoff;
writes never retry, since a failed dispatch may still have started a run.
@nixuuu
nixuuu merged commit 9647297 into dev Nov 7, 2026
9 checks passed
@nixuuu
nixuuu deleted the ci/promotion-retry branch November 7, 2026 08:19
nixuuu added a commit that referenced this pull request Nov 8, 2026
…374)

## Change

`v0.2.0-nightly.107` became public at 20:50:02 UTC, but its desktop
channel manifests arrived at 20:53:16. A scheduled update check during
that interval selected the previous version and waited another hour.

Keep releases as drafts while staging server binaries, desktop
installers, blockmaps, cumulative channel feeds, checksums and the final
manifest. Require the macOS arm64, Linux x64 and Windows x64 targets,
plus complete metadata for an included experimental Linux arm64 build.
Verify every uploaded file's state, size and SHA-256 through paginated
GitHub API reads before a single publication PATCH. Stable can become
latest at that point; beta/nightly cannot.

Semantic-release creates drafts and its GitHub `addChannel` hook is
disabled because that hook can publish directly despite `draftRelease`.
Beta/stable promotions rebuild their own versions through the same
publication barrier. Image aliases move afterward; back-merge and
hygiene depend on completed publication. Mobile still runs its separate
EAS/TestFlight/OTA pipeline after a successful Release.

Interrupted uploads resume the same draft and skip matching files.
Published releases are never clobbered on reruns, including a lost
publication response or a later image-alias failure. Shared
transient-read retries from #320 remain intact; exhausted reads fail
closed instead of being treated as a missing release.

Desktop polling stays unchanged: draft visibility removes the race for
existing clients without changing their saved check schedule. Server
updates and channel image aliases now wait for required desktop builds
too. Failed drafts remain available for retries and are excluded from
existing retention.

Related: #14
Related: #320

## Verification

- `bun install`
- `bun run gen:check`, `bun run typecheck`, `bun run lint`, `bun run
format:check`
- `bun test scripts/release.test.ts scripts/release-upload.test.ts`: 21
passed, covering channel visibility, promotion versions, missing
platforms/feeds/blockmaps, upload interruption, verification failures
and publication-response loss.
- `bun run check:tmp`: 1852 passed, 161 skipped, 0 failed across 328
files; no project files left in its private temp directory. Live tests
remained opt-in.
- `bun run --cwd apps/web build`; `mise exec [email protected]
[email protected] -- actionlint`

Release/promotion workflows were not dispatched. No GitHub releases or
tags were created or edited. Actual GitHub publication and platform
signing remain pipeline validation; local tests use isolated fixtures.
Polish release/update documentation describes the publication rule and
retry behavior.
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.

1 participant