mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-23 00:21:14 +01:00
Pull requests that merged a release reuse their earlier test run when the release only regenerated a declared file (GST-3067) (#4483)
When a pull request merges a release whose only extra change is a generated file the repo lists under `release_outputs`, its earlier remote test run now counts for it, if the clear command gets `--allow-repo-commands`. Why: gbrain paid one extra full CI run for each such pull request, several a day. Without the flag nothing changes except that the refusal now says to pass it; a hand edit to the generated file, or any other changed file, is still refused. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
ed4086e262
commit
12bd33b648
10 files changed
+206
-30
No files matched your search
+9
-2
@@ -663,7 +663,7 @@ receipt for H when the two trees differ only as a stamp does:
|
||||
`version-manifest`, `manifest-version`, `lockfile-root-version`,
|
||||
`changelog-heading`, `changelog-fragments` for the CHANGELOG under the fold,
|
||||
`changelog_fragments` for a folded fragment's deletion, `stamp_files`,
|
||||
`stamp_paths`, `release_outputs`). `clear` prints the same
|
||||
`stamp_paths`, `release_outputs`, `release_tool`). `clear` prints the same
|
||||
as `PREGATE_RECEIPT_SUBSTITUTED: …`, `verify` repeats it on its ok line, and
|
||||
the ship receipt carries the receipt string. The receipt's own tests and
|
||||
failed checks apply as before (its exit status is checked only when
|
||||
@@ -687,7 +687,14 @@ receipt for H when the two trees differ only as a stamp does:
|
||||
`*_KEY_VERSION` written as the next minor, #3512) (so two trees
|
||||
at the same version refuse such a hunk as `other`), while the built-in
|
||||
version-file, manifest, lockfile and CHANGELOG rules compare content and do
|
||||
not check the direction of the version move. The obligation stays uncleared; rerun
|
||||
not check the direction of the version move. A `release_outputs` file that is
|
||||
more than those rewrites, such as a generated file a merged release commit
|
||||
added rows to, is a stamp, rule `release_tool`, when the policy's
|
||||
`release_tool`, rerun on pregate.json's head, writes it byte for byte (the
|
||||
tree receipt's rule, GST-1176, GST-3067). The tool is repo code, so `clear`
|
||||
reruns it only with `--allow-repo-commands`; without the flag the file is
|
||||
refused and the refusal says to pass it. A `release_outputs` path is judged
|
||||
by this rule even when `stamp_files` does not list it. The obligation stays uncleared; rerun
|
||||
the gate on the head, or make the extra change a stamp under the repo's
|
||||
rule.
|
||||
|
||||
|
||||
+6
-3
@@ -3012,9 +3012,12 @@ rule. The tool is repo code, so the receipt reruns it only with
|
||||
each stamped prefix; without the flag the file stays `changed`. The rerun is
|
||||
the Version Gate's: the stamped head (CHANGELOG folded, fragments deleted), a
|
||||
bare environment and a 120-second limit, so an output that depends on anything
|
||||
else fails closed as `changed`. With `stamp_files` set, a file outside it
|
||||
is `changed (stamp_files: not in the repo's stamp_files allowlist)` whatever
|
||||
its diff. Any other byte is a change. A diff git cannot produce between the two
|
||||
else fails closed as `changed`. `gstack-pregate clear --receipt
|
||||
--allow-repo-commands` applies the same rule to a remote gate receipt from a
|
||||
predecessor tree (GST-3067). With `stamp_files` set, a file outside it and
|
||||
outside `release_outputs` is `changed (stamp_files: not in the repo's
|
||||
stamp_files allowlist)` whatever its diff; a `release_outputs` path is judged
|
||||
by the release-output rule above. Any other byte is a change. A diff git cannot produce between the two
|
||||
heads fails closed with `EVIDENCE_IDENTITY_UNKNOWN` and git's reason; it never
|
||||
reads as no change.
|
||||
|
||||
|
||||
@@ -4803,13 +4803,17 @@ it refuses `caller_job_skipped` when its `<calling job> / <lane job>` job did no
|
||||
|
||||
Another tree is accepted in exactly one case: it differs from `pregate.json`'s
|
||||
tree only in the repo's stamp rule (`.gstack/ship-policy.json` on the base
|
||||
branch: `stamp_files`, `stamp_patterns`, the built-in version, manifest,
|
||||
lockfile and CHANGELOG forms), judged by the tree receipt's own classifier on a
|
||||
branch: `stamp_files`, `stamp_patterns`, `release_outputs`, the built-in
|
||||
version, manifest, lockfile and CHANGELOG forms), judged by the tree receipt's own classifier on a
|
||||
`git diff` of the two trees ([the gate ran ahead of the
|
||||
stamp](pregate.md#remote-gate-stamp-only)). The refusal line then says `and the
|
||||
trees differ beyond the stamp rule of <policy>: <path> (<rule>: <why>, line
|
||||
<n>)`, and the path it names is the one that is not a stamp: a file outside
|
||||
`stamp_files`, or a stamp file with a hunk that is not the old → new rewrite.
|
||||
A `release_outputs` file that is more than that rewrite is a stamp (rule
|
||||
`release_tool`) only when `release_tool`, rerun on the head, writes it byte for
|
||||
byte; `clear` reruns it only with `--allow-repo-commands`, and without the flag
|
||||
the refusal's reason includes `release_tool reruns only under --allow-repo-commands`.
|
||||
`the gated tree <t> is not an object in this repository` means the gated
|
||||
commit is not fetched here, so the two trees cannot be compared. Three more
|
||||
refusals close the substitution without classifying anything: `lists the test
|
||||
|
||||
Reference in new issue
Block a user