mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-24 17:11:28 +01:00
A base branch with too many review_exclude_paths patterns no longer stops every /ship (GST-3399) (#4637)
When the base branch's ship policy fails only because of its `review_exclude_paths` or `review_content_patterns` list (for example 65 patterns, one over the limit of 64), /ship now reviews every file instead of stopping. Why: harness-evals main went to 65 patterns, and every /ship there stopped with POLICY_INVALID, including the PR that shortens the list. Nothing to do: the plan prints a `REVIEW_EXCLUDE: fallback (WARNING: ...)` line naming the error and the fix, and `gstack-ship-policy validate` still reports the list. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/specialist-batched#1 reader=testing Review-Finding: lib/ship-receipt-depth.ts:69:stale-comment reader=core
This commit is contained in:
1 parent
2887261a47
commit
dd611038ca
15 files changed
+211
-19
No files matched your search
+15
-3
@@ -1464,9 +1464,21 @@ whose content files `/ship`'s reviewers leave out:
|
||||
the base commit it already resolved (`origin/<base>`, or `<base>`), never
|
||||
the branch's copy, so a branch cannot exclude its own files. A branch that adds
|
||||
the key gets `REVIEW_EXCLUDE: none (head sets review_exclude_paths; it applies
|
||||
after it lands on <base>)` and a normal review. A base policy that does not
|
||||
validate stops the plan (`POLICY_INVALID`), and a base git cannot read stops it
|
||||
(`POLICY_SOURCE_UNAVAILABLE`); neither turns exclusion off quietly.
|
||||
after it lands on <base>)` and a normal review. A base policy whose only errors
|
||||
are in `review_exclude_paths` or `review_content_patterns` (65 patterns, say,
|
||||
past the limit of 64) does not stop the plan: both keys are set aside, every
|
||||
file is reviewed as if the base excluded nothing, and every other key, the
|
||||
readers' `forbid_paths` included, applies as committed. The plan prints
|
||||
`REVIEW_EXCLUDE: fallback (WARNING: …)` naming each error and the fix, on
|
||||
stdout and stderr, `--json` carries `review_exclude.state: "fallback"`, the
|
||||
ship receipt records it as `review_exclude_fallback`, and every other step that
|
||||
reads the base policy (`gstack-ship-policy show-effective`, which prints the
|
||||
same warning on stderr, the pregate, the receipts, the merge step) reads it the
|
||||
same way, so the PR that corrects the list can be reviewed and land.
|
||||
`gstack-ship-policy validate` still reports the list as invalid. The PR's own
|
||||
list still doesn't count until it lands (GST-3399). Any other
|
||||
error in a base policy stops the plan (`POLICY_INVALID`), and a base git cannot
|
||||
read stops it (`POLICY_SOURCE_UNAVAILABLE`); neither turns exclusion off quietly.
|
||||
|
||||
**Land the setting first.** Because the branch's copy doesn't count, a PR that adds bulk
|
||||
data lands its `review_exclude_paths` entry, and any secrets `allowlist` entries it needs
|
||||
|
||||
@@ -3842,6 +3842,14 @@ a typo never silently means "default".
|
||||
**Fix.** `gstack-ship-policy validate` lists every problem;
|
||||
`gstack-ship-policy init --explain` prints each key, its meaning and default.
|
||||
|
||||
When the invalid file is the base branch's and its only errors are in
|
||||
`review_exclude_paths` or `review_content_patterns` (for example `more than 64
|
||||
patterns`), /ship does not stop: `gstack-review-plan` prints `REVIEW_EXCLUDE:
|
||||
fallback (WARNING: …)`, reviews every file and applies the base's other keys,
|
||||
so open a PR that corrects the list and ship it as usual
|
||||
([review_exclude_paths](ship-policy.md#review-exclude-paths)). Any other error
|
||||
on the base stops the plan and the merge step until a PR fixes it.
|
||||
|
||||
<a id="policy-containment"></a>
|
||||
### `POLICY_CONTAINMENT`
|
||||
|
||||
|
||||
Reference in new issue
Block a user