[PR #236] [MERGED] pr_ready: one self-check for agents and contributors, CONTRIBUTING.md and a PR template #2425

Closed
opened 2026-11-02 15:55:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/pr-ready


📝 Commits (1)

  • 48c85fa Add tools/pr_ready.py, CONTRIBUTING.md and a pull request template

📊 Changes

8 files changed (+634 additions, -11 deletions)

View changed files

➕ .github/pull_request_template.md (+19 -0)
➕ CONTRIBUTING.md (+77 -0)
📝 README.md (+3 -7)
📝 docs/parity-workflow.md (+2 -0)
➕ tests/test_pr_ready.py (+116 -0)
📝 tools/ci/vanilla-data.sh (+2 -1)
📝 tools/parity.py (+9 -3)
➕ tools/pr_ready.py (+406 -0)

📄 Description

What

  • tools/pr_ready.py: the one self-check before asking for review (SYSTEM.md §3, §5). From git diff <base>...HEAD (plus uncommitted files) it decides what to run and prints one Markdown block for the PR body; exits non-zero on any failure.
    • Scope: files and lines; warns over 500 lines of code (docs and tests not counted) or when game / launcher / website / CI are mixed.
    • cargo fmt --check, cargo clippy --workspace --all-targets --locked -- -D warnings, cargo test for the touched crates only (paths → packages from cargo metadata; Cargo.toml/Cargo.lock → whole workspace).
    • The launcher's own workspace (fmt, clippy, lib tests) when launcher/, horizon-prepare or horizon-theme changed; --features gpui/runtime_shaders on a Mac without the Metal toolchain, as launcher.yml does; nix-shell on NixOS hosts without the GPUI libraries.
    • website/src/tokens.css up to date (horizon-theme's own test), Cargo.lock changing only with a Cargo.toml, Python tests, public-tree check.
    • Parity: imports tools/parity.py's affected_harnesses (what CI's parity job uses through --changed). On --host macmini it runs them with CI's own runner-env.sh + vanilla-data.sh on the parity runner's workspace (as the second runner does: shared vanilla data, preparations, recorded dependencies, passes and machine slots; parity state and probe builds per checkout under ~/.cache/pr-ready). Locally it runs them when .local/ holds vanilla data; otherwise (and with --quick) it lists them "to run in CI".
    • Label suggestion from release_train.player_facing; total time.
    • --host macmini|thinkpad goes through ~/fleet/rbuild; without --host everything runs locally, for contributors without the fleet.
  • tools/parity.py --changed-files FILE: the --changed selection for a copy without Git history (rbuild's). tools/ci/vanilla-data.sh accepts HORIZON_PREPARE_KEY for the same reason.
  • CONTRIBUTING.md (linked from the README's Contributing section, which now points at pr_ready) and .github/pull_request_template.md.
  • Unit tests: tests/test_pr_ready.py (path → crate, workspace membership, scope, Cargo.lock rule, label, harness selection via parity.py, output parsing).

Why

Agents and contributors run one command instead of a checklist, and orchestrators review from the pasted block instead of rerunning builds (Kira card#26).

How tested

  • --host macmini --quick with a scratch edit in crates/horizon-theme: fmt, clippy, horizon-theme tests, tokens, launcher fmt/clippy/tests (26 passed, runtime_shaders picked automatically) all green, 81 harnesses listed.
  • --host macmini with a scratch edit in tools/test_food_parity.py: 1 affected, 1 passed (2 min 34 s), on the runner's vanilla data.
  • Its own branch (below):

pr_ready (tools/pr_ready.py --host macmini on macmini, against origin/main at 830e8adbe, 28 s)

Check Result
Scope ✅ 8 files, +634 −11
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 196 passed (19 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ✅ no harness affected (1 s)
Label skip-release

Needs Ludovic

Nothing. Note: --host macmini harness runs write passes into the parity runner's shared-local/parity-shared and may add a preparation to its prepared/ (it keeps the four newest), exactly as the runners do.

🤖 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/236 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/pr-ready` --- ### 📝 Commits (1) - [`48c85fa`](https://github.com/horizon-rust/horizon/commit/48c85fa19fc7eeb03757d068fd49007d439ee5a1) Add tools/pr_ready.py, CONTRIBUTING.md and a pull request template ### 📊 Changes **8 files changed** (+634 additions, -11 deletions) <details> <summary>View changed files</summary> ➕ `.github/pull_request_template.md` (+19 -0) ➕ `CONTRIBUTING.md` (+77 -0) 📝 `README.md` (+3 -7) 📝 `docs/parity-workflow.md` (+2 -0) ➕ `tests/test_pr_ready.py` (+116 -0) 📝 `tools/ci/vanilla-data.sh` (+2 -1) 📝 `tools/parity.py` (+9 -3) ➕ `tools/pr_ready.py` (+406 -0) </details> ### 📄 Description ## What - **`tools/pr_ready.py`**: the one self-check before asking for review (SYSTEM.md §3, §5). From `git diff <base>...HEAD` (plus uncommitted files) it decides what to run and prints one Markdown block for the PR body; exits non-zero on any failure. - Scope: files and lines; warns over 500 lines of code (docs and tests not counted) or when game / launcher / website / CI are mixed. - `cargo fmt --check`, `cargo clippy --workspace --all-targets --locked -- -D warnings`, `cargo test` for the touched crates only (paths → packages from `cargo metadata`; `Cargo.toml`/`Cargo.lock` → whole workspace). - The launcher's own workspace (fmt, clippy, lib tests) when `launcher/`, `horizon-prepare` or `horizon-theme` changed; `--features gpui/runtime_shaders` on a Mac without the Metal toolchain, as `launcher.yml` does; `nix-shell` on NixOS hosts without the GPUI libraries. - `website/src/tokens.css` up to date (horizon-theme's own test), `Cargo.lock` changing only with a `Cargo.toml`, Python tests, public-tree check. - Parity: imports `tools/parity.py`'s `affected_harnesses` (what CI's parity job uses through `--changed`). On `--host macmini` it runs them with CI's own `runner-env.sh` + `vanilla-data.sh` on the parity runner's workspace (as the second runner does: shared vanilla data, preparations, recorded dependencies, passes and machine slots; parity state and probe builds per checkout under `~/.cache/pr-ready`). Locally it runs them when `.local/` holds vanilla data; otherwise (and with `--quick`) it lists them "to run in CI". - Label suggestion from `release_train.player_facing`; total time. - `--host macmini|thinkpad` goes through `~/fleet/rbuild`; without `--host` everything runs locally, for contributors without the fleet. - `tools/parity.py --changed-files FILE`: the `--changed` selection for a copy without Git history (rbuild's). `tools/ci/vanilla-data.sh` accepts `HORIZON_PREPARE_KEY` for the same reason. - **CONTRIBUTING.md** (linked from the README's Contributing section, which now points at pr_ready) and **`.github/pull_request_template.md`**. - Unit tests: `tests/test_pr_ready.py` (path → crate, workspace membership, scope, Cargo.lock rule, label, harness selection via parity.py, output parsing). ## Why Agents and contributors run one command instead of a checklist, and orchestrators review from the pasted block instead of rerunning builds (Kira card#26). ## How tested - `--host macmini --quick` with a scratch edit in `crates/horizon-theme`: fmt, clippy, horizon-theme tests, tokens, launcher fmt/clippy/tests (26 passed, runtime_shaders picked automatically) all green, 81 harnesses listed. - `--host macmini` with a scratch edit in `tools/test_food_parity.py`: 1 affected, 1 passed (2 min 34 s), on the runner's vanilla data. - Its own branch (below): **pr_ready** (`tools/pr_ready.py --host macmini` on macmini, against origin/main at 830e8adbe, 28 s) | Check | Result | | --- | --- | | Scope | ✅ 8 files, +634 −11 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 196 passed (19 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ✅ no harness affected (1 s) | | Label | `skip-release` | ## Needs Ludovic Nothing. Note: `--host macmini` harness runs write passes into the parity runner's `shared-local/parity-shared` and may add a preparation to its `prepared/` (it keeps the four newest), exactly as the runners do. 🤖 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-02 15:55:58 +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#2425
No description provided.