fix(release): a read the forge cuts off or fails with a 5xx is made again, as in the launcher's copy #1547

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

Type: fix · Risk: low · Tested on: Linux (CachyOS, kernel 7.3.3), Python 3.12.16, no GPU needed: tests/test_release.py (three new tests) and tests/run_all.py · Needs: none

TL;DR

The Longshot Launcher's v1.0.0-rc.11 stopped at its very last step, with every file built and signed: the forge cut off its list of releases halfway, and the release script gave up. This PR has the script ask again, up to four times, whenever a read from the forge breaks or the forge answers with a server error. A new test cuts the list off on purpose: it fails without the change and passes with it.

Breakdown

  • Who it helps: players waiting on a release or nightly, and whoever cuts one: a dropped connection no longer ends a release whose files are ready.
  • What was wrong: the script read each answer once, and the upload retries (#598) did not catch an answer cut off halfway.
  • What changes: a read from the forge is made again after 5, 10 and 15 seconds before the release fails.
  • What does not change: anything that changes the forge (a new release, an upload, a deletion) is never sent twice behind its caller's back; the game and the builders are untouched.
  • How it was checked: the release tests (three new) and tests/run_all.py pass.
  • What is still open: a real publish: the next nightly after the merge runs it.
  • Risk: low: a release that fails for good takes about 30 s longer per read to fail.

Why

The launcher's v1.0.0-rc.11 run (LongshotLauncher's run 634), step Publish, ended:

  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)

The same evening a CI runner logged connection resets against git.magicbean.dev, and a long issue listing broke off the same way. This file is the same in both repositories (docs/releases.md), so the fix goes to both: LongshotLauncher#197.

How to reproduce

Seen on: CI's Sign and publish, Ubuntu runner, LongshotLauncher v1.0.0-rc.11
Settings and switches: defaults
Steps: release.py publish while the forge cuts an answer off (tests/test_release.py's test_a_list_of_releases_cut_off_is_asked_again does that on purpose)
Expected: the list is asked for again and the release is published
Actual: IncompleteRead, and the run ends with no release

What changed

api() makes a GET again when it fails for the server's reasons. The launcher's copy's two small differences come with it, so the two repositories' files are the same again.

  • scripts/release.py: api() makes a GET again, READ_TRIES (4) times in all, after READ_PAUSE (5 s) × the attempt; one request is api_once(). http.client.HTTPException (an answer cut off) counts as server trouble, for upload_file()'s retries too. From the launcher's copy: .nx among the files never released (LongshotLauncher#77), and nightly-news's docstring without a nightly name.
  • tests/test_release.py: FakeForgejo.read_trouble cuts a GET off or answers it with a code. New tests: cut off then 502, published whole; cut off every time, nothing made; a POST answered 500 is not sent again by api().

Measurements

Nothing to measure: a release script, checked by its tests.

Flags and settings

None

Testing

Tested: on Linux, python -I tests/test_release.py passes (OK), and the cut-off test fails with the retry taken out. python -I -B tests/run_all.py in a fresh clone (no build, no Vulkan or SPIR-V headers): 627 passed, 40 failed, 103 skipped. 39 of the 40 fail on main (ef6038ab) in the same clone too: C++ and game tests that need a build or headers this clone doesn't have. The 40th, tests/test_compute_warm_apart.py, passes alone on this branch three times out of three (in the full run, clang stopped on an unused variable in its generated C++); it reads nothing of release.py.

The 40 failures, also failing on main
  • tests/test_bug_report.py
  • tests/test_bug_report_defaults.py
  • tests/test_compute_warm_apart.py
  • tests/test_cpu_report.py
  • tests/test_crash_groups.py
  • tests/test_crt_options.py
  • tests/test_damage_debug_menu.py
  • tests/test_dev_packs.py
  • tests/test_discover.py
  • tests/test_display_startup_failure.py
  • tests/test_dlss_feature_size.py
  • tests/test_failed_compile_keeps_objects.py
  • tests/test_guest_imported.py
  • tests/test_hardware_report.py
  • tests/test_hud_layout_row.py
  • tests/test_invalidate_quick.py
  • tests/test_invalidate_vcore.py
  • tests/test_libc_hooks.py
  • tests/test_lift_lookups.py
  • tests/test_linux_preflight.py
  • tests/test_linux_pressure.py
  • tests/test_linux_update.py
  • tests/test_log_open_failure.py
  • tests/test_mirror_budget.py
  • tests/test_missing_nup.py
  • tests/test_mods_size_table.py
  • tests/test_pending_guest_import.py
  • tests/test_pipeline_play_cache.py
  • tests/test_present_thread.py
  • tests/test_profiling_mode.py
  • tests/test_psychov35_fsr3_fg.py
  • tests/test_readback_timeout_source.py
  • tests/test_run_all_changed.py
  • tests/test_slow_frames.py
  • tests/test_switch_table.py
  • tests/test_target_image_pool.py
  • tests/test_upscaler_rows.py
  • tests/test_vcore_escape.py
  • tests/test_walk.py
  • tests/test_walk_key.py

Not tested: a real publish against git.magicbean.dev: the next nightly after the merge is the first.

Must be tested:

  • None: the next nightly's Sign and publish runs it, and its page shows whether it published.

Risks

What could break: a publish that keeps failing takes longer to fail (5 + 10 + 15 s per read).

Turning it off: revert the commit

Compatibility: Nothing changes

Issues

See LongshotLauncher#197

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A game-free test added for the fix, failing on main and passing here.

🤖 Generated with Claude Code

**Type:** fix · **Risk:** low · **Tested on:** Linux (CachyOS, kernel 7.3.3), Python 3.12.16, no GPU needed: `tests/test_release.py` (three new tests) and `tests/run_all.py` · **Needs:** none ## TL;DR The Longshot Launcher's v1.0.0-rc.11 stopped at its very last step, with every file built and signed: the forge cut off its list of releases halfway, and the release script gave up. This PR has the script ask again, up to four times, whenever a read from the forge breaks or the forge answers with a server error. A new test cuts the list off on purpose: it fails without the change and passes with it. ## Breakdown - **Who it helps:** players waiting on a release or nightly, and whoever cuts one: a dropped connection no longer ends a release whose files are ready. - **What was wrong:** the script read each answer once, and the upload retries (#598) did not catch an answer cut off halfway. - **What changes:** a read from the forge is made again after 5, 10 and 15 seconds before the release fails. - **What does not change:** anything that changes the forge (a new release, an upload, a deletion) is never sent twice behind its caller's back; the game and the builders are untouched. - **How it was checked:** the release tests (three new) and `tests/run_all.py` pass. - **What is still open:** a real publish: the next nightly after the merge runs it. - **Risk:** low: a release that fails for good takes about 30 s longer per read to fail. ## Why The launcher's v1.0.0-rc.11 run (LongshotLauncher's run 634), step *Publish*, ended: ``` 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) ``` The same evening a CI runner logged connection resets against git.magicbean.dev, and a long issue listing broke off the same way. This file is the same in both repositories (docs/releases.md), so the fix goes to both: LongshotLauncher#197. ## How to reproduce **Seen on:** CI's *Sign and publish*, Ubuntu runner, LongshotLauncher v1.0.0-rc.11 **Settings and switches:** defaults **Steps:** `release.py publish` while the forge cuts an answer off (`tests/test_release.py`'s `test_a_list_of_releases_cut_off_is_asked_again` does that on purpose) **Expected:** the list is asked for again and the release is published **Actual:** `IncompleteRead`, and the run ends with no release ## What changed `api()` makes a GET again when it fails for the server's reasons. The launcher's copy's two small differences come with it, so the two repositories' files are the same again. - `scripts/release.py`: `api()` makes a GET again, `READ_TRIES` (4) times in all, after `READ_PAUSE` (5 s) × the attempt; one request is `api_once()`. `http.client.HTTPException` (an answer cut off) counts as server trouble, for `upload_file()`'s retries too. From the launcher's copy: `.nx` among the files never released (LongshotLauncher#77), and `nightly-news`'s docstring without a nightly name. - `tests/test_release.py`: `FakeForgejo.read_trouble` cuts a GET off or answers it with a code. New tests: cut off then 502, published whole; cut off every time, nothing made; a POST answered 500 is not sent again by `api()`. ## Measurements Nothing to measure: a release script, checked by its tests. ### Flags and settings None ## Testing **Tested:** on Linux, `python -I tests/test_release.py` passes (OK), and the cut-off test fails with the retry taken out. `python -I -B tests/run_all.py` in a fresh clone (no build, no Vulkan or SPIR-V headers): 627 passed, 40 failed, 103 skipped. 39 of the 40 fail on `main` (ef6038ab) in the same clone too: C++ and game tests that need a build or headers this clone doesn't have. The 40th, `tests/test_compute_warm_apart.py`, passes alone on this branch three times out of three (in the full run, clang stopped on an unused variable in its generated C++); it reads nothing of `release.py`. <details><summary>The 40 failures, also failing on main</summary> - `tests/test_bug_report.py` - `tests/test_bug_report_defaults.py` - `tests/test_compute_warm_apart.py` - `tests/test_cpu_report.py` - `tests/test_crash_groups.py` - `tests/test_crt_options.py` - `tests/test_damage_debug_menu.py` - `tests/test_dev_packs.py` - `tests/test_discover.py` - `tests/test_display_startup_failure.py` - `tests/test_dlss_feature_size.py` - `tests/test_failed_compile_keeps_objects.py` - `tests/test_guest_imported.py` - `tests/test_hardware_report.py` - `tests/test_hud_layout_row.py` - `tests/test_invalidate_quick.py` - `tests/test_invalidate_vcore.py` - `tests/test_libc_hooks.py` - `tests/test_lift_lookups.py` - `tests/test_linux_preflight.py` - `tests/test_linux_pressure.py` - `tests/test_linux_update.py` - `tests/test_log_open_failure.py` - `tests/test_mirror_budget.py` - `tests/test_missing_nup.py` - `tests/test_mods_size_table.py` - `tests/test_pending_guest_import.py` - `tests/test_pipeline_play_cache.py` - `tests/test_present_thread.py` - `tests/test_profiling_mode.py` - `tests/test_psychov35_fsr3_fg.py` - `tests/test_readback_timeout_source.py` - `tests/test_run_all_changed.py` - `tests/test_slow_frames.py` - `tests/test_switch_table.py` - `tests/test_target_image_pool.py` - `tests/test_upscaler_rows.py` - `tests/test_vcore_escape.py` - `tests/test_walk.py` - `tests/test_walk_key.py` </details> **Not tested:** a real publish against git.magicbean.dev: the next nightly after the merge is the first. **Must be tested:** - None: the next nightly's *Sign and publish* runs it, and its page shows whether it published. ## Risks **What could break:** a publish that keeps failing takes longer to fail (5 + 10 + 15 s per read). **Turning it off:** revert the commit **Compatibility:** Nothing changes ## Issues See LongshotLauncher#197 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A game-free test added for the fix, failing on `main` and passing here. 🤖 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, as in the launcher's copy
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 10s
Third-party parts / As their notes say (pull_request) Successful in 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
384307a43d
The launcher's v1.0.0-rc.11 Sign and publish ended with every file built and signed:
git.magicbean.dev cut the list of releases off mid-answer (IncompleteRead), which the upload
retries (#598) do not cover. A GET changes nothing, so api() makes it again, four times in all.
The launcher's .nx rule (LongshotLauncher#77) and nightly-news docstring come with it, so
scripts/release.py and tests/test_release.py are the same files in both repositories again
(LongshotLauncher#197).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch fix/release-read-retry 2026-11-18 04:10:28 +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/Longshot!1547
No description provided.