mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-29 19:34:29 +01:00
Let /gstack-ship handle very large results PRs (GST-4003) (#4847)
`/gstack-ship` now works on results PRs with tens of thousands of files and hundreds of megabytes of diff: more exclusion patterns, a secrets check with no size limit, a faster review plan and docs check, and bulleted ruled notes. Why: two 16,000-file results PRs hit each of these limits in real runs. Nothing to do: existing policies keep working unchanged. 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: p2/adversarial-native#1 reader=adversarial-native Review-Finding: p2/outside-voice#1 reader=outside-voice Review-Finding: p2/outside-voice#2 reader=outside-voice Review-Finding: p2/outside-voice#3 reader=outside-voice Review-Finding: p2/outside-voice#4 reader=outside-voice Review-Finding: p2/specialist-batched#2 reader=specialist-batched
This commit is contained in:
1 parent
0febbce1e4
commit
77da8a0160
21 files changed
+756
-101
No files matched your search
+8
-4
@@ -94,7 +94,11 @@ branch that changes the policy.
|
||||
| `changelog_fragments` | `{ dir, required_checks? }` or `null` | `null` | PRs carry unversioned [CHANGELOG fragments](#changelog-fragments) in `dir` (one flat, repo-relative directory, no `..`) and the merge step ([`land`](#land)) assigns the version (under `merge: direct`, the [release PR](#release-stamp) does). `required_checks` (up to 50 distinct names) are the checks [`train land`](#stamped-trains-under-changelog_fragments-train-land) requires present and green on a stamp commit. `null` keeps `[Unreleased]` sections and per-PR stamps. Needs `min_gstack_version`. |
|
||||
|
||||
Containment, checked by `validate` and again at write time: paths and globs are
|
||||
repo-relative with no `..` segment, under 256 characters, at most 64 per list,
|
||||
repo-relative with no `..` segment, under 256 characters, at most 64 per list
|
||||
(`review_exclude_paths` takes up to 256, as long as their exclude pathspecs fit
|
||||
in 24,000 argument bytes together, since every reader's one `git diff` carries
|
||||
all of them; an older gstack reads a list over 64 as invalid, sets the key aside
|
||||
and reviews every file),
|
||||
and a glob's regex expansion under 512 characters; `release_tool` is under 512
|
||||
characters with no newline; a matched file that resolves through a symlink to
|
||||
outside the repository is refused (`POLICY_CONTAINMENT`). A mirror may start
|
||||
@@ -1468,8 +1472,8 @@ 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 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
|
||||
are in `review_exclude_paths` or `review_content_patterns` (257 patterns, say,
|
||||
past the limit of 256) 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
|
||||
@@ -1865,7 +1869,7 @@ with the `gate_id` its gate disposition needs, since a ruling never closes one
|
||||
`gstack-approvals rulings` prints one `Ruled note: …` line per ruling for the
|
||||
Pre-Landing Review and the PR body, `gstack-ship-receipt write` records them as
|
||||
`ruled_notes` (each with its `head`) and refuses a `--body` that does not carry each
|
||||
line word for word, and the READY block prints each as `RULED_NOTE:`.
|
||||
line word for word (bare, or as a `- ` or `* ` list item), and the READY block prints each as `RULED_NOTE:`.
|
||||
Step 11.5 reads the same rulings: `gstack-review-read` applies a ruling to a Step 9
|
||||
or Step 11 row that carries the finding and whose `range_base..commit` holds the
|
||||
ruling's head (a first pass, with no `range_base`: its own commit), lists its
|
||||
|
||||
+10
-4
@@ -3758,8 +3758,9 @@ a typo never silently means "default".
|
||||
`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`), /gstack-ship does not stop: `gstack-review-plan` prints `REVIEW_EXCLUDE:
|
||||
`review_exclude_paths` or `review_content_patterns` (for example `more than 256
|
||||
patterns` in `review_exclude_paths`, or `more than 64 patterns` in
|
||||
`review_content_patterns`), /gstack-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
|
||||
@@ -4011,7 +4012,8 @@ record only when it changes no binary file, adds no numeric claim, touches no
|
||||
results, prereg or eval path, and names no money, security, secret or auth topic; any other docs change
|
||||
needs the reader again (GST-1195). With `--body`, write also refuses, writing
|
||||
nothing, a body that does not carry each line the receipt requires as one line,
|
||||
word for word: every `Ruled note: …` line `gstack-approvals rulings` prints,
|
||||
word for word: every `Ruled note: …` line `gstack-approvals rulings` prints
|
||||
(bare, or as a `- ` or `* ` list item),
|
||||
every `Gate disposition: …` line `gstack-approvals dispositions` prints (and while
|
||||
a gate disposition applies at HEAD, write refuses to run without `--body`),
|
||||
finish's `MECHANICAL:` lines as `Mechanical retake: …`, and accept's
|
||||
@@ -4090,7 +4092,11 @@ the base policy commit.
|
||||
- **A pattern keeps too many files** stops the plan with
|
||||
[`REVIEW_EXCLUDE_KEEP_TOO_LARGE`](#review-exclude-keep-too-large) before any reader runs.
|
||||
- **Still over after exclusion:** add the printed folders to the base policy, or
|
||||
split the PR. When published data under a pattern is kept as `code`
|
||||
split the PR. The fix only suggests data, log and binary folders, never `docs/`
|
||||
(the report is what the reviewer is there to read), and when the printed folders
|
||||
would take the base list past 256 patterns or its 24,000-byte pathspec budget it
|
||||
prints no JSON and asks for the existing patterns to be merged under fewer
|
||||
folder globs instead. When published data under a pattern is kept as `code`
|
||||
(`REVIEW_EXCLUDE_KEPT: code …` on `.patch`, `.sha256` or extension-less files),
|
||||
add [`review_content_patterns`](ship-policy.md#review-content-patterns) for it. Files kept only for a secret line already count as their
|
||||
excerpts ([secret-line excerpts](ship-policy.md#secret-line-excerpts)), and so
|
||||
|
||||
Reference in new issue
Block a user