The justfile grew a recipe at a time, and nothing says what a local run guarantees
- 主要語言
- Rust
- 星號
- 9
- 分支
- 1
- 平均合併
- 11 小時 46 分鐘
- 30 天內合併 PR
- 62
描述
## What
The `justfile` grew one recipe at a time, each addition arguing its own case
in its own comment, and nothing anywhere says what a local run is supposed to
guarantee and what is left to CI. This asks for that statement first, and for
the edits it licenses second.
Measured on `main`:
| | |
| --- | --- |
| `justfile` lines | 489 — 301 begin with `#` (three of those are shebangs), 133 are recipe bodies, variables and headers, 55 blank |
| Recipes | 37, of which CI invokes 11 |
| Recipes written as `bash` with `set -euo pipefail` | 3 — `test-mirrors`, `test-doc-packaged`, `doc-declared` |
| `jq` invocations | 8, three of them multi-line programs inside `test-doc-packaged` |
| Required contexts on `main` | 9 — Format Check, Test ×3 (pinned), Clippy, Documentation, Code Coverage, Declared Versions, Doc Tests |
## Three questions the stocktake should settle
**What `pre-commit` is for.** It is `fmt-check clippy test clippy-loom
test-mirrors test-doc`. Held against the nine required contexts, it reaches
Format Check, Clippy and Test, and reaches half of Doc Tests — `test-doc`,
but not `test-doc-packaged`. It reaches neither of the Documentation job's
two renders, nor Code Coverage. So a clean `just pre-commit` is consistent
with a red required check today, and the file says nothing about which of
those absences are deliberate. Either it is a deliberate subset — in which
case say which and why those — or the missing pieces belong in it.
**Which side owns which check.** `ci.yml` routes 11 steps through `just`, and
says why in its own comments: "so the local and CI invocations are
identical". It then restates four commands rather than calling a recipe:
- `cargo fmt --all -- --check`, which is `just fmt-check` character for
character
- `cargo test --lib --bins --tests --examples --features …`, which is `just
test` character for character — this one is #373
- `cargo check --all-targets --features …` (MSRV), which has no recipe
- `cargo test --test api_surface -- --ignored`, which has no recipe
Two of the four duplicate a recipe verbatim, and two have no recipe at all,
so "local and CI are identical" is a rule that holds for 11 steps and is
silent about 4. Whichever way it should go, it should go one way.
**What the comments are load-bearing for.** 60 comment lines sit inside the
three `bash` recipes alone. Some record a decision that would otherwise be
re-litigated — why `bench` names its targets rather than passing
`--all-targets`, why `loom-core` is excluded from `build_features`. Others
describe mechanics a reader could run in a second. The first kind is the
reason this file is readable at all; the second kind is maintenance. Where a
comment exists because the shape underneath is surprising, the question to
ask is whether the shape should change.
## What the stocktake would also catch
- `just deny` runs `cargo deny check`, there is no `deny.toml` in the repo,
and no job invokes it. Dependency policy is a recipe nobody runs.
- `outdated` and `update` overlap with what `dependabot.yml` already does.
- 19 recipes are named by neither CI nor another recipe. That is not waste on
its own — a `justfile` is partly a menu for a human — but it is the part of
the file a division-of-labour statement would license keeping or dropping.
## Why an umbrella rather than more of the same
Four open issues are instances of this one: #373 (a target list in two
places), #374 (no merge-blocking check builds a benchmark), #371 (nothing
checks that every declared bench has a runner), #368 (what the load harness
should do under `cargo test`). Each can be closed on its own terms, and each
closure adds another local mechanism whose relationship to CI is decided
again from scratch. Settling the division first is what lets them be closed
as one class.
## What would close it
A short statement — in the `justfile` header or under `docs/` — of what a
local run guarantees and what is left to CI, and the edits that make the file
match it: the pieces missing from `pre-commit` added or explicitly excluded,
the four restated CI commands routed through recipes or the "identical
invocations" rationale dropped, and any recipe the statement does not justify
removed.
## How it surfaced
While reviewing #394, which adds a third `jq` program to `test-doc-packaged`,
a recipe, and a CI step — each defensible on its own, and each decided
without a rule to decide it by.
貢獻指南
評估
這個 Issue 還沒有評估資料。