mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-17 13:44:32 +01:00
fix(pregate): pre-landing review fixes for removed paths
A removal owes what an edit owes: manifests, lockfiles, config, fixtures, goldens, workflows and files a config still names keep PREGATE_NO_LANE. A test reading a fully deleted directory is selected again, a deleted Rust module selects its crate's tests, a test renamed to a non-test path is accounted as deleted, and the owning suite is the tests that directly exercise the same files. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
a76620148c
commit
6e69dc3681
6 files changed
+138
-41
No files matched your search
+19
-12
@@ -196,18 +196,25 @@ Two stages with separate clocks, both printed:
|
||||
transitively through
|
||||
non-test files; deleted and renamed files select the tests that named them.
|
||||
A removed path (a deleted file, or a rename's old name) that no remaining
|
||||
test selects owes no lane: it prints `removed (no lane owed): <path> — <why>`
|
||||
and the `lanes` detail adds `N removed path(s)`. A rename's old name defers to
|
||||
the new path (`old name of <new>`); a deleted test runs its owning suite, the
|
||||
remaining tests of the files its merge-base text exercised (`owning suite
|
||||
runs: …`; test helpers and fixtures are not subjects), and names each file
|
||||
left with no test (`coverage removed: <file> has no remaining test`, and
|
||||
`M subject(s) lost their last test` in the detail); any other deleted file
|
||||
has nothing left to test (`no remaining test references it`). A deleted test
|
||||
whose merge-base text cannot be read (a symlink, invalid UTF-8, over 1 MiB)
|
||||
fails closed with `PREGATE_NO_LANE`, and a modified file whose only test the
|
||||
branch deleted still has no lane. /review lists the deletion as a gate edit
|
||||
(RH-1) either way.
|
||||
test selects owes no lane when one of these holds, and prints
|
||||
`removed (no lane owed): <path> — <why>` (the `lanes` detail adds
|
||||
`N removed path(s)`): a rename's old name defers to the new path (`old name
|
||||
of <new>`); a deleted test, or a test renamed to a non-test path, runs its
|
||||
owning suite, the remaining tests that directly exercise the files its
|
||||
merge-base text exercised (`owning suite runs: …`; test helpers and fixtures
|
||||
are not subjects), and names each file left with no test at all (`coverage
|
||||
removed: <file> has no remaining test`, and `M subject(s) lost their last
|
||||
test` in the detail); a deleted code file outside fixture, golden and CI
|
||||
trees that no remaining non-Markdown file names reads `nothing in the tree
|
||||
references it`. Every other removal owes what an edit owes, so it is still
|
||||
`PREGATE_NO_LANE` until a test or a `dependencies` entry covers it: a
|
||||
deleted manifest, lockfile, config, conftest.py, fixture, golden or workflow,
|
||||
a deleted file a config or script still names, and a deleted test whose
|
||||
merge-base text cannot be read (a symlink, invalid UTF-8, over 1 MiB). A
|
||||
modified file whose only test the branch deleted still has no lane, a
|
||||
remaining test that reads a deleted file or directory is selected, and a
|
||||
deleted Rust module selects its crate's tests. /review lists a deleted test
|
||||
as a gate edit (RH-1) either way.
|
||||
An extensionless JS/TS import (relative, a tsconfig/jsconfig `paths` alias or
|
||||
`baseUrl`) tries the exact path, then `.ts`, `.tsx`, `.js`, `.jsx`, `.mjs`,
|
||||
`.cjs`, `.mts`, `.cts`, then `index.ts`, `index.tsx`, `index.js`, `index.jsx`
|
||||
|
||||
@@ -3211,12 +3211,15 @@ versions, line endings or any non-version byte changed, one under a test,
|
||||
fixture, golden, `.gstack/` or workflow tree, or one added, deleted, renamed
|
||||
or re-moded, is still this error; `--explain` prints `not version-stamp-only (<reason>)`
|
||||
for it.
|
||||
A path the branch removed is not this error either: a deleted file, or a
|
||||
rename's old name, that no remaining test selects prints `removed (no lane
|
||||
owed): <path> — <why>` instead (a deleted test runs its owning suite or says
|
||||
`coverage removed: <file> has no remaining test`). A modified file whose only
|
||||
test the branch deleted is still this error, and so is a deleted test whose
|
||||
merge-base text cannot be read (a symlink, invalid UTF-8, over 1 MiB).
|
||||
A path the branch removed is usually not this error either: a rename's old
|
||||
name, a deleted test, and a deleted code file nothing in the tree still names
|
||||
print `removed (no lane owed): <path> — <why>` instead (a deleted test runs its
|
||||
owning suite or says `coverage removed: <file> has no remaining test`). A
|
||||
removal owes what an edit owes, so these are still this error: a deleted
|
||||
manifest, lockfile, config, conftest.py, fixture, golden or workflow, a deleted
|
||||
file a config or script still names, a deleted test whose merge-base text
|
||||
cannot be read (a symlink, invalid UTF-8, over 1 MiB), and a modified file whose
|
||||
only test the branch deleted.
|
||||
|
||||
**Fix.** Add a test that names the file, or declare its lane (an explicit `[]`
|
||||
for files with no behaviour) under `dependencies` in `.gstack/pregate.json` (or the user-owned file the message names).
|
||||
|
||||
Reference in new issue
Block a user