feat(home): a Pull request track builds a Longshot pull request, with one warning for a BigBean's or an approved one and two for any other #199

Merged
HumanBean merged 1 commit from HumanBean/LongshotLauncher:feat/pr-track into main 2026-11-18 07:23:03 +00:00
Owner

To try a Longshot pull request today, a tester has to check it out and build it from source, so most of the hardware we need never runs a change before it is merged. This adds a Pull request track to the home. It builds an open pull request on the tester's PC the way Beanstalk's agents do. It warns once for a BigBean's or a Beanstalk-approved pull request, and twice for any other.

It rebuilds #59 on today's home (the Track and Version dropdowns), and #59 can be closed in favour of it.

Requires: Beanstalk#90 (GET /api/v1/public/pulls). It is merged and deployed: production runs coordinator image 51, at e4316243.

What changed

  • Track: Pull request (HomeViewModel, VersionPick.OfPullRequests). The Version list shows:

    • the installed pull requests;
    • then the open ones a BigBean wrote or approved, each by number and title, noted BigBean or approved;
    • Find a pull request… takes any other open one by its number or link.

    Drafts (Forgejo's mark or WIP:) and pull requests labelled for the other system are left out.

  • Switching: picking another pull request shows Switch to #N. It builds in the installed one's place, in its folder (builds/pr/pr-<number>-<commit>, renamed). Build another version still builds one beside it.

  • Updates: a pull request's only update is a newer push of the same pull request (UpdatePolicy). Opposite the title it says "#1548 has a newer push: a7c4410e", with Read it in place of What's new. Once the pull request is merged or closed, its row says so.

  • Warnings (PullRequestViewModels.cs). They come before any build of new pull request code: a first build, a switch, or an update to a new push. A rebuild of a push already built skips them.

    • A BigBean's, or approved for the Test Farm: one softer warning. It says who vouches for the PR, that the code is built and run on this PC, and that saves are shared (export them first).
    • Any other: the same first warning with Continue, then a red second one. It says nobody who reviews Longshot has looked at the code and that it runs with your rights. Cancel is the primary button and Build it anyway is red.
    • Approval is pinned to a commit, as on the Test Farm. A newer push of an approved pull request gets both warnings until it is approved again.
  • No load on git.magicbean.dev (Core/PullRequests.cs):

    • Everything about pull requests comes from Beanstalk in one request. Beanstalk answers from its own copy of the list, cached for a minute.
    • The update check asks only when a pull request's build is installed, once for all of them. Picking the track asks at most once a minute.
    • Only Beanstalk can say who is a BigBean: the forge's team, member and collaborator lists all return 401 without a token.
  • The build (PullRequestSource, Toolchains.InstallPullRequest). It is Beanstalk's recipe: the PR's source over main's tools, which here means the newest nightly's.

    • The PR is read again first. It must be open, out of draft, and still at that commit.
    • The source is archive/<full hash>.tar.gz, and its pax header must name that commit. The archive is plain files only, with nothing outside its folder.
    • The nightly's tools are hard-linked, about 50 MB of new disk beside the nightly's 900 MB. The native helpers are copied, never linked.
    • A PR whose tools.lock differs from the nightly's is refused.
    • The PR toolchain's record keeps only the parts the source didn't replace. A later version can reuse its tools but never picks up its source.
    • Nothing of a PR is fetched before its warnings: the early tools download skips pull requests.
  • Builds stay fast. These were already in place, and this keeps them working for pull requests:

    • Builds share the work folder, so Longshot's lift and object stores apply. The lift store is keyed by the translator, not the version, so a PR that leaves nx2/ alone takes the nightly's translation instead of translating again.
    • Game files are linked from another build of the same dump.
    • Shader caches carry over, because the PR record keeps the compiler parts the cache key reads.
  • A bigger window: 1040×680, up from 960×600 (MainWindow.axaml). It still fits a Steam Deck (1280×800) and a 1366×768 laptop, and every page stretches to it.

  • Docs: docs/pull-requests.md covers the flow, the warnings, where the facts come from and the risk. I didn't touch docs/releases.md, since it is shared with Longshot's repository. The README's feature table links the new page.

  • Tests:

    • tests/launcher_core/PullRequestChecks.cs covers:
      • names, updates and folders;
      • link parsing and Beanstalk's list (bad entries, error pages);
      • the track's versions and switching;
      • the archive: wrong or missing commit, links, ../;
      • InstallPullRequest: source replaces, removed files gone, helpers copied, record trimmed, nightly untouched and deletable, a different tools.lock refused and leaving nothing;
      • the home's routing through the warnings.
    • tests/test_launcher_core.py: pr- entries in the track and unordered vectors.
    • Screenshot scenes: home-pr-track, home-pr-versions, home-pr-switch, pr-warning-trusted, pr-warning, pr-confirm, pr-find.

Screenshots

The Pull request track: a build behind its newer push, who wrote it, Read it, Find a pull request
The Version list on the track: the installed one, then the ones a BigBean wrote or approved, and one found by number
Another pull request picked: Switch to it, in place of the installed one
A BigBean's pull request: one softer warning
Any other pull request: the first warning, Continue
…then the second warning to confirm: Cancel is the default, Build it anyway in red
Find a pull request by number or link
The build page at the new size
Build settings at the new size

Testing

Tested (Linux, .NET 10):

  • dotnet build LongshotLauncher.slnx: 0 warnings, 0 errors.
  • python -I tests/test_launcher_core.py: 2247 checks pass, with one exception. The existing BuildReportChecks "home folder taken out before a line is cut" check fails on this PC, and it fails the same way on a clean main (67ee5f82). With it skipped locally, everything after it passes; the check itself is unchanged.
  • python -I tests/test_release.py: OK.
  • scripts/translations.py: no new faults. The new texts show in English, like the 230-odd already missing from every catalog.
  • The screenshots below, drawn by tools/screenshots.
  • A real Longshot PR archive (#1558, b268d901, 20 MB) has the commit in its pax header and only files and folders.

Not tested:

  • End to end: nobody has yet picked a PR in the launcher and played its build. Beanstalk#90 isn't deployed yet.
  • Windows: the Windows tools layout is covered by the unit checks only.

Risk and rollback

  • Unreviewed code runs on the tester's PC, with no sandbox. The two-step warning is the guard. The launcher fetches only the commit Beanstalk names as the head, by its full hash over https, and checks the archive is of that commit.
  • Disk: each PR's tools are about 50 MB beside the nightly's. If no nightly build remains, the nightly's tools are pruned and the next PR downloads them again (about 900 MB).
  • Rollback: revert this. Installed PR builds stay as versions the player can delete.
  • Screenshots, Windows paths: the existing Windows-path screenshot scenes drop their builds when drawn on Linux, because BuildRegistry.Gone treats C:\… as a deleted folder. The new scenes use Linux paths, and that bug is left for another PR.

🤖 Generated with Claude Code

To try a Longshot pull request today, a tester has to check it out and build it from source, so most of the hardware we need never runs a change before it is merged. This adds a **Pull request** track to the home. It builds an open pull request on the tester's PC the way Beanstalk's agents do. It warns once for a BigBean's or a Beanstalk-approved pull request, and twice for any other. It rebuilds #59 on today's home (the Track and Version dropdowns), and #59 can be closed in favour of it. **Requires:** [Beanstalk#90](https://git.magicbean.dev/MagicBeanDev/Beanstalk/pulls/90) (`GET /api/v1/public/pulls`). It is merged and deployed: production runs coordinator image 51, at e4316243. ## What changed - **Track: Pull request** (`HomeViewModel`, `VersionPick.OfPullRequests`). The Version list shows: - the installed pull requests; - then the open ones a BigBean wrote or approved, each by number and title, noted *BigBean* or *approved*; - *Find a pull request…* takes any other open one by its number or link. Drafts (Forgejo's mark or `WIP:`) and pull requests labelled for the other system are left out. - **Switching:** picking another pull request shows **Switch to #N**. It builds in the installed one's place, in its folder (`builds/pr/pr-<number>-<commit>`, renamed). *Build another version* still builds one beside it. - **Updates:** a pull request's only update is a newer push of the same pull request (`UpdatePolicy`). Opposite the title it says "#1548 has a newer push: a7c4410e", with *Read it* in place of What's new. Once the pull request is merged or closed, its row says so. - **Warnings** (`PullRequestViewModels.cs`). They come before any build of new pull request code: a first build, a switch, or an update to a new push. A rebuild of a push already built skips them. - *A BigBean's, or approved for the Test Farm:* one softer warning. It says who vouches for the PR, that the code is built and run on this PC, and that saves are shared (export them first). - *Any other:* the same first warning with **Continue**, then a red second one. It says nobody who reviews Longshot has looked at the code and that it runs with your rights. **Cancel** is the primary button and **Build it anyway** is red. - Approval is pinned to a commit, as on the Test Farm. A newer push of an approved pull request gets both warnings until it is approved again. - **No load on git.magicbean.dev** (`Core/PullRequests.cs`): - Everything about pull requests comes from Beanstalk in one request. Beanstalk answers from its own copy of the list, cached for a minute. - The update check asks only when a pull request's build is installed, once for all of them. Picking the track asks at most once a minute. - Only Beanstalk can say who is a BigBean: the forge's team, member and collaborator lists all return 401 without a token. - **The build** (`PullRequestSource`, `Toolchains.InstallPullRequest`). It is Beanstalk's recipe: the PR's source over `main`'s tools, which here means the newest nightly's. - The PR is read again first. It must be open, out of draft, and still at that commit. - The source is `archive/<full hash>.tar.gz`, and its pax header must name that commit. The archive is plain files only, with nothing outside its folder. - The nightly's tools are hard-linked, about 50 MB of new disk beside the nightly's 900 MB. The native helpers are copied, never linked. - A PR whose `tools.lock` differs from the nightly's is refused. - The PR toolchain's record keeps only the parts the source didn't replace. A later version can reuse its tools but never picks up its source. - Nothing of a PR is fetched before its warnings: the early tools download skips pull requests. - **Builds stay fast.** These were already in place, and this keeps them working for pull requests: - Builds share the work folder, so Longshot's lift and object stores apply. The lift store is keyed by the translator, not the version, so a PR that leaves `nx2/` alone takes the nightly's translation instead of translating again. - Game files are linked from another build of the same dump. - Shader caches carry over, because the PR record keeps the compiler parts the cache key reads. - **A bigger window:** 1040×680, up from 960×600 (`MainWindow.axaml`). It still fits a Steam Deck (1280×800) and a 1366×768 laptop, and every page stretches to it. - **Docs:** `docs/pull-requests.md` covers the flow, the warnings, where the facts come from and the risk. I didn't touch `docs/releases.md`, since it is shared with Longshot's repository. The README's feature table links the new page. - **Tests:** - `tests/launcher_core/PullRequestChecks.cs` covers: - names, updates and folders; - link parsing and Beanstalk's list (bad entries, error pages); - the track's versions and switching; - the archive: wrong or missing commit, links, `../`; - `InstallPullRequest`: source replaces, removed files gone, helpers copied, record trimmed, nightly untouched and deletable, a different `tools.lock` refused and leaving nothing; - the home's routing through the warnings. - `tests/test_launcher_core.py`: `pr-` entries in the track and unordered vectors. - Screenshot scenes: `home-pr-track`, `home-pr-versions`, `home-pr-switch`, `pr-warning-trusted`, `pr-warning`, `pr-confirm`, `pr-find`. ## Screenshots ![The Pull request track: a build behind its newer push, who wrote it, Read it, Find a pull request](https://git.magicbean.dev/attachments/1a54b20b-7081-4727-8142-88c084bc754e) ![The Version list on the track: the installed one, then the ones a BigBean wrote or approved, and one found by number](https://git.magicbean.dev/attachments/954ddb16-d036-46a3-afd2-bd7cb940327e) ![Another pull request picked: Switch to it, in place of the installed one](https://git.magicbean.dev/attachments/3a4983c4-55e0-4062-a681-d45f7020d283) ![A BigBean's pull request: one softer warning](https://git.magicbean.dev/attachments/8f70bd86-8249-483a-a3a1-7cca97814a0b) ![Any other pull request: the first warning, Continue](https://git.magicbean.dev/attachments/de0c1052-d804-4519-8ddf-6cb073a4b367) ![…then the second warning to confirm: Cancel is the default, Build it anyway in red](https://git.magicbean.dev/attachments/7bdabddc-99f6-4490-8cde-4d5da5b369df) ![Find a pull request by number or link](https://git.magicbean.dev/attachments/438e80f0-5559-4ce9-8292-c908ae2016f2) ![The build page at the new size](https://git.magicbean.dev/attachments/4555b266-705e-44a8-8706-a59b77fea560) ![Build settings at the new size](https://git.magicbean.dev/attachments/50f179df-5e43-4244-8f22-e612a905130f) ## Testing **Tested** (Linux, .NET 10): - `dotnet build LongshotLauncher.slnx`: 0 warnings, 0 errors. - `python -I tests/test_launcher_core.py`: **2247 checks pass**, with one exception. The existing `BuildReportChecks` "home folder taken out before a line is cut" check fails on this PC, and it fails the same way on a clean `main` (67ee5f82). With it skipped locally, everything after it passes; the check itself is unchanged. - `python -I tests/test_release.py`: OK. - `scripts/translations.py`: no new faults. The new texts show in English, like the 230-odd already missing from every catalog. - The screenshots below, drawn by `tools/screenshots`. - A real Longshot PR archive (#1558, `b268d901`, 20 MB) has the commit in its pax header and only files and folders. **Not tested:** - **End to end:** nobody has yet picked a PR in the launcher and played its build. Beanstalk#90 isn't deployed yet. - **Windows:** the Windows tools layout is covered by the unit checks only. ## Risk and rollback - **Unreviewed code runs on the tester's PC**, with no sandbox. The two-step warning is the guard. The launcher fetches only the commit Beanstalk names as the head, by its full hash over https, and checks the archive is of that commit. - **Disk:** each PR's tools are about 50 MB beside the nightly's. If no nightly build remains, the nightly's tools are pruned and the next PR downloads them again (about 900 MB). - **Rollback:** revert this. Installed PR builds stay as versions the player can delete. - **Screenshots, Windows paths:** the existing Windows-path screenshot scenes drop their builds when drawn on Linux, because `BuildRegistry.Gone` treats `C:\…` as a deleted folder. The new scenes use Linux paths, and that bug is left for another PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

Screenshots (tools/screenshots):

The Pull request track: a build behind its newer push, who wrote it, Read it, Find a pull request
The Version list on the track: the installed one, then the ones a BigBean wrote or approved, and one found by number
Another pull request picked: Switch to it, in place of the installed one
A BigBean's pull request: one softer warning
Any other pull request: the first warning, Continue
…then the second warning to confirm: Cancel is the default, Build it anyway in red
Find a pull request by number or link

Screenshots (tools/screenshots): ![The Pull request track: a build behind its newer push, who wrote it, Read it, Find a pull request](https://git.magicbean.dev/attachments/eb585167-c25f-4bdb-a68d-6ab16f9f86d7) ![The Version list on the track: the installed one, then the ones a BigBean wrote or approved, and one found by number](https://git.magicbean.dev/attachments/a5b3fbfd-7fce-46f5-9861-df337f1f9986) ![Another pull request picked: Switch to it, in place of the installed one](https://git.magicbean.dev/attachments/f9ff434a-df42-40c1-b5f3-b6234620f069) ![A BigBean's pull request: one softer warning](https://git.magicbean.dev/attachments/a2392752-cf8d-4228-b371-9877be627a24) ![Any other pull request: the first warning, Continue](https://git.magicbean.dev/attachments/18c0315d-45e6-4724-aaec-1d6ec1b62b41) ![…then the second warning to confirm: Cancel is the default, Build it anyway in red](https://git.magicbean.dev/attachments/52f89e22-8d78-4545-b182-71701b6e1741) ![Find a pull request by number or link](https://git.magicbean.dev/attachments/7d659bd9-d086-4269-a965-3f25bc6733d5)
HumanBean force-pushed feat/pr-track from 88e760f181
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
to ac12faca3f
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
2026-11-18 07:20:11 +00:00
Compare
Author
Owner

The window is now 1040×680, up from 960×600. Screenshots retaken at the new size:

The Pull request track: a build behind its newer push, who wrote it, Read it, Find a pull request
The Version list on the track: the installed one, then the ones a BigBean wrote or approved, and one found by number
Another pull request picked: Switch to it, in place of the installed one
A BigBean's pull request: one softer warning
Any other pull request: the first warning, Continue
…then the second warning to confirm: Cancel is the default, Build it anyway in red
Find a pull request by number or link
The build page at the new size
Build settings at the new size

The window is now 1040×680, up from 960×600. Screenshots retaken at the new size: ![The Pull request track: a build behind its newer push, who wrote it, Read it, Find a pull request](https://git.magicbean.dev/attachments/1a54b20b-7081-4727-8142-88c084bc754e) ![The Version list on the track: the installed one, then the ones a BigBean wrote or approved, and one found by number](https://git.magicbean.dev/attachments/954ddb16-d036-46a3-afd2-bd7cb940327e) ![Another pull request picked: Switch to it, in place of the installed one](https://git.magicbean.dev/attachments/3a4983c4-55e0-4062-a681-d45f7020d283) ![A BigBean's pull request: one softer warning](https://git.magicbean.dev/attachments/8f70bd86-8249-483a-a3a1-7cca97814a0b) ![Any other pull request: the first warning, Continue](https://git.magicbean.dev/attachments/de0c1052-d804-4519-8ddf-6cb073a4b367) ![…then the second warning to confirm: Cancel is the default, Build it anyway in red](https://git.magicbean.dev/attachments/7bdabddc-99f6-4490-8cde-4d5da5b369df) ![Find a pull request by number or link](https://git.magicbean.dev/attachments/438e80f0-5559-4ce9-8292-c908ae2016f2) ![The build page at the new size](https://git.magicbean.dev/attachments/4555b266-705e-44a8-8706-a59b77fea560) ![Build settings at the new size](https://git.magicbean.dev/attachments/50f179df-5e43-4244-8f22-e612a905130f)
HumanBean changed title from WIP: feat(home): a Pull request track builds a Longshot pull request, with one warning for a BigBean's or an approved one and two for any other to feat(home): a Pull request track builds a Longshot pull request, with one warning for a BigBean's or an approved one and two for any other 2026-11-18 07:22:59 +00:00
HumanBean deleted branch feat/pr-track 2026-11-18 07:23:03 +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!199
No description provided.