[PR #2859] [MERGED] Nightly: trusted reviewers pick the pull requests with /nightly #4659

Closed
opened 2026-11-03 05:07:00 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2859
Author: @ludovic111
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: feat/nightly-reviewers-wire


📝 Commits (4)

  • 79eddec Nightly: trusted reviewers pick the pull requests with /nightly
  • c6633ea Merge branch 'feat/nightly-set' into feat/nightly-reviewers-wire
  • 7efd8ef Nightly tests: the scheduled refresh, the notes and the repo's reviewers list
  • 8d54244 Nightly: nothing an unreviewed build leaves reaches a release

📊 Changes

10 files changed (+425 additions, -35 deletions)

View changed files

➕ .github/nightly-reviewers.txt (+7 -0)
📝 .github/workflows/game-build.yml (+21 -4)
📝 .github/workflows/nightly-build.yml (+69 -6)
➕ .github/workflows/nightly-command.yml (+46 -0)
📝 .github/workflows/release.yml (+1 -0)
📝 docs/release-flow.md (+61 -12)
📝 tests/test_nightly.py (+73 -0)
📝 tests/test_nightly_set.py (+5 -0)
📝 tools/ci/nightly.py (+139 -11)
📝 tools/ci/runner-env.sh (+3 -2)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Part 2 of 2 of nightly-2, stacked on #2858 (review that one first; this diff includes it until it merges). Ludovic's decision (2026-10-27), from kacpherek's proposal under #2779: the Nightly becomes the place where contributors test pull requests before the gate. kacpherek, rdbtCVS and levzzz5154 pick them; Ludovic keeps control.

What changes

  • .github/nightly-reviewers.txt: the three logins, each with who added it and when. Ludovic is always allowed and isn't listed. A lone paused line stops every reviewer, but not Ludovic. Removing a line revokes that login. No repository role is involved: on a personal repo there's no Triage role, and /nightly doesn't need one.
  • .github/workflows/nightly-command.yml (new, issue_comment):
    • It handles /nightly 2640 2642, add, remove, clear, status and dry-run in any issue or pull request.
    • It checks who asked, saves the set on nightly-state, starts nightly build, and answers with one comment starting "🤖 Nightly:": the set and the run.
    • Any other comment skips at the job's if, before a runner starts, and joins no concurrency group, so it never replaces a waiting nightly.
  • .github/workflows/nightly-build.yml:
    • pick builds main plus the set and pushes it as nightly/build-<date>-<n>.
    • The scheduled run (20:17 UTC) takes each pull request's newest head and drops the merged and closed ones; the notes say so.
    • Without a set, it builds the proven union or main, as today.
    • build, sign and publish are unchanged.
    • A new answer job tells the thread how the build ended: published (with the tag), dry run done, nothing new, or failed. A conflict pick explains itself: which two pull requests, which files, and that an integration pull request from a fork can replace them.
  • Notes: a Nightly "can include pull requests not reviewed yet, picked by trusted reviewers". Each pull request is listed with its title, author, head and who picked it. The title-screen label stays "Nightly · ".
  • docs/release-flow.md "Nightly channel": who can pick and how, the refusals, and how Ludovic removes or pauses someone.

Why the signing key still never meets a pull request's code

  • Both workflows run from main's copy: issue_comment and schedule always use the default branch, and uses: ./… takes the caller's commit. A pull request that changes .github/, tools/ci/ or any other CODEOWNERS path is refused, both at the command (from the API's file list) and in pick (from git, for the exact head it merges).
  • nightly command never checks out, fetches or merges a pull request. The comment's text and author reach main's script as env vars, never in a shell line.
  • pick runs main's script and merges with git merge-tree --write-tree, which writes git objects only: no working tree, so no file, hook, filter or attribute driver of a pull request reaches the runner. It holds contents: write only to push nightly/build-* and nightly-state; main stays protected.
  • The pull requests' code runs only in build (game-build.yml): no secrets, a read-only token not kept in the checkout, macOS signed ad hoc. This is the same exposure as their CI parity today.
  • sign still checks out only main's sign_release.sh and signs the hashes with the nightly-tagged message, which release launchers refuse (#2792). publish verifies with main's horizon-release-sign.

Nothing an unreviewed build leaves reaches a release (review fix, 8d54244)

game-build.yml has a new trusted input: true only from release.yml, false from nightly-build.yml.

  • Rust cache (GitHub-hosted Linux and Windows): an untrusted build uses its own key (nightly-<name>) and never saves (save-if: false). A release restores only what a release saved.
  • macOS: an untrusted build's exporters and build jobs run on [self-hosted, macOS, horizon-game]. That is ludovics-mac-mini, the runner that already runs pull requests' parity jobs. It is never the release runner (MAC_RUNNER = horizon-release, ludovics-mac-mini-release) and never parity-main's.
  • sccache: a trusted build doesn't read the machine's shared sccache, which pull requests' jobs write (HORIZON_NO_SCCACHE in runner-env.sh). The release's exporters job used to compile horizon-prepare through it.
  • tests/test_nightly.py pins all three.

Limits

  • At most 30 pull requests in a set.
  • At most 6 builds a day. The scheduled one always runs, and dry runs count.
  • Ludovic's /nightly remove keeps a pull request out until he adds it back. His clear always applies.

Proof

  • tests/test_nightly.py (7) covers the scheduled refresh, the notes and the repo's list. tests/test_nightly_set.py (#2858) covers parsing, the allow list, refusals, assembly with a fixture repo, and the state branch. actionlint is clean.
  • The first real run is only possible after the merge, since issue_comment runs main's copy. Then, from Ludovic's account and marked "🤖 Agent:", I'll comment /nightly dry-run <two open contributor PRs> and check the answer, the run and the notes. After that comes a real /nightly with the launcher install, as for nightly-1.
python3 tools/pr_ready.py --quick
Python tests ✅ 360 passed · no Rust change · Public tree ✅

.github/ and tools/ci/ are Ludovic's under CODEOWNERS: merged by hand.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2859 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/nightly-reviewers-wire` --- ### 📝 Commits (4) - [`79eddec`](https://github.com/horizon-rust/horizon/commit/79eddec09c8c219c3232c5aec1a893496f7370e1) Nightly: trusted reviewers pick the pull requests with /nightly - [`c6633ea`](https://github.com/horizon-rust/horizon/commit/c6633ea1bbc76c919b6159289f0230f02125aff3) Merge branch 'feat/nightly-set' into feat/nightly-reviewers-wire - [`7efd8ef`](https://github.com/horizon-rust/horizon/commit/7efd8ef33a5bb2cb54af239d7b51e3c8c464e81c) Nightly tests: the scheduled refresh, the notes and the repo's reviewers list - [`8d54244`](https://github.com/horizon-rust/horizon/commit/8d5424408c2bf1d1d5ab512acccbd5a01671b91f) Nightly: nothing an unreviewed build leaves reaches a release ### 📊 Changes **10 files changed** (+425 additions, -35 deletions) <details> <summary>View changed files</summary> ➕ `.github/nightly-reviewers.txt` (+7 -0) 📝 `.github/workflows/game-build.yml` (+21 -4) 📝 `.github/workflows/nightly-build.yml` (+69 -6) ➕ `.github/workflows/nightly-command.yml` (+46 -0) 📝 `.github/workflows/release.yml` (+1 -0) 📝 `docs/release-flow.md` (+61 -12) 📝 `tests/test_nightly.py` (+73 -0) 📝 `tests/test_nightly_set.py` (+5 -0) 📝 `tools/ci/nightly.py` (+139 -11) 📝 `tools/ci/runner-env.sh` (+3 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Part 2 of 2 of nightly-2, stacked on #2858 (review that one first; this diff includes it until it merges). Ludovic's decision (2026-10-27), from kacpherek's proposal under #2779: the Nightly becomes the place where contributors test pull requests **before** the gate. kacpherek, rdbtCVS and levzzz5154 pick them; Ludovic keeps control. ## What changes - **`.github/nightly-reviewers.txt`:** the three logins, each with who added it and when. Ludovic is always allowed and isn't listed. A lone `paused` line stops every reviewer, but not Ludovic. Removing a line revokes that login. No repository role is involved: on a personal repo there's no Triage role, and `/nightly` doesn't need one. - **`.github/workflows/nightly-command.yml` (new, `issue_comment`):** - It handles `/nightly 2640 2642`, `add`, `remove`, `clear`, `status` and `dry-run` in any issue or pull request. - It checks who asked, saves the set on `nightly-state`, starts `nightly build`, and answers with one comment starting "🤖 Nightly:": the set and the run. - Any other comment skips at the job's `if`, before a runner starts, and joins no concurrency group, so it never replaces a waiting nightly. - **`.github/workflows/nightly-build.yml`:** - `pick` builds main plus the set and pushes it as `nightly/build-<date>-<n>`. - The scheduled run (20:17 UTC) takes each pull request's newest head and drops the merged and closed ones; the notes say so. - Without a set, it builds the proven union or main, as today. - `build`, `sign` and `publish` are unchanged. - A new `answer` job tells the thread how the build ended: published (with the tag), dry run done, nothing new, or failed. A conflict `pick` explains itself: which two pull requests, which files, and that an integration pull request from a fork can replace them. - **Notes:** a Nightly "can include pull requests not reviewed yet, picked by trusted reviewers". Each pull request is listed with its title, author, head and who picked it. The title-screen label stays "Nightly <date> · <sha>". - **docs/release-flow.md "Nightly channel":** who can pick and how, the refusals, and how Ludovic removes or pauses someone. ## Why the signing key still never meets a pull request's code - Both workflows run from main's copy: `issue_comment` and `schedule` always use the default branch, and `uses: ./…` takes the caller's commit. A pull request that changes `.github/`, `tools/ci/` or any other CODEOWNERS path is refused, both at the command (from the API's file list) and in `pick` (from git, for the exact head it merges). - `nightly command` never checks out, fetches or merges a pull request. The comment's text and author reach main's script as env vars, never in a shell line. - `pick` runs main's script and merges with `git merge-tree --write-tree`, which writes git objects only: no working tree, so no file, hook, filter or attribute driver of a pull request reaches the runner. It holds `contents: write` only to push `nightly/build-*` and `nightly-state`; main stays protected. - The pull requests' code runs only in `build` (game-build.yml): no secrets, a read-only token not kept in the checkout, macOS signed ad hoc. This is the same exposure as their CI parity today. - `sign` still checks out only main's `sign_release.sh` and signs the hashes with the nightly-tagged message, which release launchers refuse (#2792). `publish` verifies with main's `horizon-release-sign`. ## Nothing an unreviewed build leaves reaches a release (review fix, 8d54244) `game-build.yml` has a new `trusted` input: true only from `release.yml`, false from `nightly-build.yml`. - **Rust cache** (GitHub-hosted Linux and Windows): an untrusted build uses its own key (`nightly-<name>`) and never saves (`save-if: false`). A release restores only what a release saved. - **macOS:** an untrusted build's exporters and build jobs run on `[self-hosted, macOS, horizon-game]`. That is `ludovics-mac-mini`, the runner that already runs pull requests' parity jobs. It is never the release runner (`MAC_RUNNER` = `horizon-release`, `ludovics-mac-mini-release`) and never parity-main's. - **sccache:** a trusted build doesn't read the machine's shared sccache, which pull requests' jobs write (`HORIZON_NO_SCCACHE` in `runner-env.sh`). The release's exporters job used to compile `horizon-prepare` through it. - `tests/test_nightly.py` pins all three. ## Limits - At most 30 pull requests in a set. - At most 6 builds a day. The scheduled one always runs, and dry runs count. - Ludovic's `/nightly remove` keeps a pull request out until he adds it back. His `clear` always applies. ## Proof - `tests/test_nightly.py` (7) covers the scheduled refresh, the notes and the repo's list. `tests/test_nightly_set.py` (#2858) covers parsing, the allow list, refusals, assembly with a fixture repo, and the state branch. `actionlint` is clean. - The first real run is only possible after the merge, since `issue_comment` runs main's copy. Then, from Ludovic's account and marked "🤖 Agent:", I'll comment `/nightly dry-run <two open contributor PRs>` and check the answer, the run and the notes. After that comes a real `/nightly` with the launcher install, as for nightly-1. ``` python3 tools/pr_ready.py --quick Python tests ✅ 360 passed · no Rust change · Public tree ✅ ``` `.github/` and `tools/ci/` are Ludovic's under CODEOWNERS: merged by hand. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:07:00 +07:00
Sign in to join this conversation.
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
horizon-rust/horizon#4659
No description provided.