fix(release): a read the forge cuts off or fails with a 5xx is made again, and uploads are retried as in Longshot's copy #197

Merged
HumanBean merged 1 commit from HumanBean/LongshotLauncher:fix/release-read-retry into main 2026-11-18 04:10:23 +00:00
Owner

Type: fix · Risk: low · Tested on: Linux (CachyOS, kernel 7.3.3), Python 3.12.16: the release tests (42, three new); the launcher's core tests stop at main's own Linux failure (the home folder cut from a log line), which this leaves alone · Needs: nothing: CI's next publish runs it

TL;DR

v1.0.0-rc.11's Sign and publish failed after every file was built and signed: git.magicbean.dev cut the list of releases off mid-answer, and release.py publish stopped. Reading something changes nothing, so a GET to the forge is now made again, four times in all, before a release fails. scripts/release.py and tests/test_release.py are also the same as Longshot's again: the launcher never got Longshot's upload retries.

Breakdown

  • Who it helps: whoever cuts a release, and players waiting on it: a dropped connection no longer stops a release or a nightly with its files ready.
  • What was wrong: api() read each answer once. A connection cut mid-answer (http.client.IncompleteRead, not an OSError) or a 5xx on a GET ended the run.
  • What changes: a GET that the server fails with a 5xx, that never gets its answer, or whose answer never comes whole is made again after 5, 10 and 15 s. A POST, PATCH or DELETE is never sent twice behind its caller's back.

Why

Run 634 (the tag v1.0.0-rc.11), step Publish:

  File "scripts/release.py", line 594, in publish
    found = [r for r in releases(repo) if r["tag_name"] == tag]
  File "scripts/release.py", line 569, in releases
    items = api("GET", "/repos/%s/releases?limit=50&page=%d" % (repo, page)) or []
http.client.IncompleteRead: IncompleteRead(103099 bytes read)

That evening the CI runner on a maintainer's PC also logged connection resets against git.magicbean.dev, and a long listing of Longshot's issues broke off the same way.

What changed

  • scripts/release.py:
    • api() makes a GET again, READ_TRIES (4) times, after READ_PAUSE × the attempt (5 s). The single request is api_once().
    • http.client.HTTPException counts as server trouble, so a cut-off answer is retried (and an upload's retry catches one too).
    • Longshot's UPLOAD_TRIES, ServerTrouble and upload_file() (Longshot#598), which the launcher's copy never got.
  • tests/test_release.py: Longshot's file (its upload retry tests), plus:
    • the list of releases cut off, then a 502: published whole;
    • cut off every time: nothing made, no upload;
    • a POST answered with a 500 is not sent again by api().
  • Kept from the launcher's copy, and going to Longshot's in its own pull request: .nx among the files never released (#77), and the nightly-news docstring without Longshot's nightly name.

How it was tested

  • python -I tests/test_release.py: 42 tests, OK.
  • The new cut-off test fails with the retry taken out (tries = 1), and passes with it.
  • python -I tests/test_launcher_core.py: stops at main's own Linux failure, "The home folder taken out before a line is cut: no cut leaves part of the user's name" (#196 saw it too). This changes no C# file.

Not tested

  • A real publish. The next nightly after the merge is the first run of it.

Risks

  • A release that fails for good now takes about 30 s longer per GET to fail.

Overlaps

  • Longshot: the same two files, in a pull request of their own, so the two copies match.
  • docs/releases.md differs between the repositories too (Longshot's third-party objects, play profiles). That's Longshot's text, not touched here.

Questions for you

  • After the merge: tag v1.0.0-rc.12 from main, or delete v1.0.0-rc.11 and tag it again? A re-run of run 634 runs the old release.py, which would retry nothing.

🤖 Generated with Claude Code

**Type:** fix · **Risk:** low · **Tested on:** Linux (CachyOS, kernel 7.3.3), Python 3.12.16: the release tests (42, three new); the launcher's core tests stop at main's own Linux failure (the home folder cut from a log line), which this leaves alone · **Needs:** nothing: CI's next publish runs it ## TL;DR v1.0.0-rc.11's *Sign and publish* failed after every file was built and signed: git.magicbean.dev cut the list of releases off mid-answer, and `release.py publish` stopped. Reading something changes nothing, so a GET to the forge is now made again, four times in all, before a release fails. `scripts/release.py` and `tests/test_release.py` are also the same as Longshot's again: the launcher never got Longshot's upload retries. ## Breakdown - **Who it helps:** whoever cuts a release, and players waiting on it: a dropped connection no longer stops a release or a nightly with its files ready. - **What was wrong:** `api()` read each answer once. A connection cut mid-answer (`http.client.IncompleteRead`, not an `OSError`) or a 5xx on a GET ended the run. - **What changes:** a GET that the server fails with a 5xx, that never gets its answer, or whose answer never comes whole is made again after 5, 10 and 15 s. A POST, PATCH or DELETE is never sent twice behind its caller's back. ## Why Run 634 (the tag v1.0.0-rc.11), step *Publish*: ``` File "scripts/release.py", line 594, in publish found = [r for r in releases(repo) if r["tag_name"] == tag] File "scripts/release.py", line 569, in releases items = api("GET", "/repos/%s/releases?limit=50&page=%d" % (repo, page)) or [] http.client.IncompleteRead: IncompleteRead(103099 bytes read) ``` That evening the CI runner on a maintainer's PC also logged connection resets against git.magicbean.dev, and a long listing of Longshot's issues broke off the same way. ## What changed - `scripts/release.py`: - `api()` makes a GET again, `READ_TRIES` (4) times, after `READ_PAUSE` × the attempt (5 s). The single request is `api_once()`. - `http.client.HTTPException` counts as server trouble, so a cut-off answer is retried (and an upload's retry catches one too). - Longshot's `UPLOAD_TRIES`, `ServerTrouble` and `upload_file()` (Longshot#598), which the launcher's copy never got. - `tests/test_release.py`: Longshot's file (its upload retry tests), plus: - the list of releases cut off, then a 502: published whole; - cut off every time: nothing made, no upload; - a POST answered with a 500 is not sent again by `api()`. - Kept from the launcher's copy, and going to Longshot's in its own pull request: `.nx` among the files never released (#77), and the nightly-news docstring without Longshot's nightly name. ## How it was tested - `python -I tests/test_release.py`: 42 tests, OK. - The new cut-off test fails with the retry taken out (`tries = 1`), and passes with it. - `python -I tests/test_launcher_core.py`: stops at main's own Linux failure, "The home folder taken out before a line is cut: no cut leaves part of the user's name" (#196 saw it too). This changes no C# file. ## Not tested - A real publish. The next nightly after the merge is the first run of it. ## Risks - A release that fails for good now takes about 30 s longer per GET to fail. ## Overlaps - Longshot: the same two files, in a pull request of their own, so the two copies match. - `docs/releases.md` differs between the repositories too (Longshot's third-party objects, play profiles). That's Longshot's text, not touched here. ## Questions for you - After the merge: tag v1.0.0-rc.12 from main, or delete v1.0.0-rc.11 and tag it again? A re-run of run 634 runs the old `release.py`, which would retry nothing. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(release): a read the forge cuts off or fails with a 5xx is made again, and uploads are retried as in Longshot's copy
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
4e47079bd6
v1.0.0-rc.11's Sign and publish ended with every file built and signed: git.magicbean.dev cut the
list of releases off mid-answer (IncompleteRead). A GET changes nothing, so api() makes it again,
four times in all. scripts/release.py and tests/test_release.py are Longshot's again (its upload
retries, #598 there), with the launcher's .nx rule (#77) and nightly-news docstring.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch fix/release-read-retry 2026-11-18 04:10:23 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!197
No description provided.