mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-05 08:23:59 +01:00
fix(pregate): treat planning and evidence markdown as an empty lane
A docs-only diff with no .gstack/pregate.json failed lanes as
PREGATE_NO_LANE. Planning and evidence Markdown is now a docs/no-tests
empty lane. Unmapped source files still fail closed.
Co-authored-by: Nick <surlymo@apache.org>
(cherry picked from commit e8793e59e8)
This commit is contained in:
1 parent
83d9c9717f
commit
801195f4e3
9 files changed
+208
-15
No files matched your search
+8
-2
@@ -59,6 +59,7 @@ the byte-pinned `/ship` renders in `test/fixtures/golden/`).
|
||||
|---|---|
|
||||
| `runner` | the local test command with `{files}` (gstack: `bun test {files}`); without it `lanes` is `incomplete` |
|
||||
| `dependencies` | glob → test files for subprocess targets, runtime reads and generated inputs the import graph cannot see; `[]` declares "no lane needed" (docs, licences) |
|
||||
| `empty_lanes` | extra globs for the docs/no-tests empty lane. Planning and evidence Markdown already qualifies with no pin file (a `docs/` / `doc/` / `documentation/` tree, a `.work` plan, `plans/` / `evidence/` / `redproof/`, and markdown named plan, planning, redproof or evidence, plus README, CHANGELOG, CONTRIBUTING, LICENSE, AGENTS, CLAUDE). Source code and files under a test directory never qualify. A test that names the file still selects that test |
|
||||
| `selection` | `workflow.yml/job` → a command printing the lane's file list, for matrices a planner computes (gstack: `scripts/test-free-shards.ts --list`) |
|
||||
| `warn` | check ids downgraded to warn; `secrets` and required lanes never |
|
||||
| `strays.allow` | intentional root files or new top-level directories |
|
||||
@@ -118,8 +119,13 @@ Two stages with separate clocks, both printed:
|
||||
(static imports ∪ repo-path string literals ∪ the `bin/<name>` →
|
||||
`test/<name>*.test.ts` convention ∪ `dependencies`), transitively through
|
||||
non-test files; deleted and renamed files select the tests that named them.
|
||||
A touched file with no lane is `FAIL lanes — <file> has no test lane`, never
|
||||
a pass. Lanes and platform tiers come from `.github/workflows/*.yml`
|
||||
A touched source file with no lane is `FAIL lanes — <file> has no test lane`,
|
||||
never a pass. Planning and evidence Markdown is a docs/no-tests empty lane
|
||||
instead (`docs/no-tests: N documentation file(s)`), including when the base
|
||||
branch has no `.gstack/pregate.json`. `empty_lanes` adds globs for other
|
||||
documentation; it cannot clear a source file or a file under a test
|
||||
directory. A test that names a Markdown file still selects that test.
|
||||
Lanes and platform tiers come from `.github/workflows/*.yml`
|
||||
(`gstack-pregate lanes` prints them): local ones run through the runner under
|
||||
`set -o pipefail`, judged on the runner's summary line (zero tests ran is a
|
||||
failure, a `| tail`-hidden exit is still an exit); a platform lane this
|
||||
|
||||
@@ -2756,12 +2756,17 @@ and Heavy-only files included.
|
||||
<a id="pregate-no-lane"></a>
|
||||
### `PREGATE_NO_LANE`
|
||||
|
||||
**Meaning.** A touched file maps to no test through static imports, repo-path
|
||||
string literals, the `bin/<name>` → `test/<name>*.test.ts` convention or a
|
||||
`dependencies` declaration. That is a failure, not a pass.
|
||||
**Meaning.** A touched source file maps to no test through static imports,
|
||||
repo-path string literals, the `bin/<name>` → `test/<name>*.test.ts` convention
|
||||
or a `dependencies` declaration. That is a failure, not a pass. Planning and
|
||||
evidence Markdown is a docs/no-tests empty lane and is not this error: a `docs/`
|
||||
tree, a `.work` plan, a redproof or evidence note, and README/CHANGELOG/LICENSE.
|
||||
A test that names one of those files still selects that test. An unmapped
|
||||
source or code file still fails.
|
||||
|
||||
**Fix.** Add a test that names the file, or declare its lane (an explicit `[]`
|
||||
for files with no behaviour, such as docs) in `.gstack/pregate.json`. `--explain`
|
||||
for files with no behaviour) under `dependencies` in `.gstack/pregate.json`.
|
||||
Other documentation goes in `empty_lanes` on the base branch. `--explain`
|
||||
prints every mapping and why. For a file with no lane it also prints the import
|
||||
specifiers in test files that resolved to no repo file (for example a
|
||||
`tsconfig.json` `paths` alias such as `@/lib/x` whose target is missing) and any
|
||||
|
||||
Reference in new issue
Block a user