mirror of
https://github.com/garrytan/gstack.git
synced 2026-12-01 04:13:55 +01:00
Clearer errors for GitHub email-privacy pushes, approval refusals and bisect case names (#4748)
/ship now tells you to fix your commit email when GitHub refuses a push with GH007, instead of sending you into a pointless merge; `gstack-approvals` says which `--owner-ref` check failed; and the merge queue's bisect accepts a red judge case whose name has a space. Why: three small, plainly correct fixes from outside reports (#4738, #4718 with #4720, #4724 for #3580), taken as one batch. Nothing to do. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Co-authored-by: Barack-zero-to-one <121355791+Barack-zero-to-one@users.noreply.github.com> Review-Finding: p1/outside-voice#1 reader=outside-voice Review-Finding: p1/outside-voice#2 reader=outside-voice Review-Finding: p1/adversarial-native#1 reader=adversarial-native Review-Finding: p1/adversarial-native#3 reader=adversarial-native Review-Finding: p1/specialist-batched#1 reader=testing
This commit is contained in:
14 files changed
+174
-21
No files matched your search
@@ -29,7 +29,7 @@ import { spawnSync } from 'node:child_process';
|
||||
import * as path from 'node:path';
|
||||
import { EXIT, exitTableHelp } from '../lib/headless-artifacts';
|
||||
import { appendRows, branchExists, buildRow, importAutoplan, locate, readRecord, renderMode, renderRecord, repoVisibility, syncRecord, type RecordError, type StoreLocation } from '../lib/approval-record';
|
||||
import { isGstackActor, isGstackActorName, openShipRun, OWNER_REF, RULED_NOTE_SCOPE, ruledNoteRow, ruledNoteSource, ruledNotes, ruledNoteText } from '../lib/ruled-notes';
|
||||
import { isGstackActor, isGstackActorName, openShipRun, OWNER_REF, OWNER_REF_SHAPE, RULED_NOTE_SCOPE, ruledNoteRow, ruledNoteSource, ruledNotes, ruledNoteText } from '../lib/ruled-notes';
|
||||
import { resultLine } from '../lib/result-codes';
|
||||
import { parsePlanLine, publicPlanLine, resolvePlan } from '../lib/plan-record';
|
||||
import { TEST_LANE_EXCEPTION_SCOPE, testLaneExceptionRow } from '../lib/test-lane-exception';
|
||||
@@ -50,6 +50,7 @@ const HELP = `gstack-approvals — the per-thread approval record (capy/skill/gs
|
||||
counts that finding closed on a fix-check whose range_base..commit holds the head, and the receipt and PR body
|
||||
list it; inside this checkout's open /ship run it needs --owner-ref, the message the lane relays the owner's
|
||||
words from, and the row, receipt and Ruled note line then say relayed from it (APPROVAL_RULING_RUN_OPEN without);
|
||||
the ref is ${OWNER_REF_SHAPE};
|
||||
--not-security: the owner's call that a red-team finding is not security class, so public text shows it;
|
||||
refused while a /ship run is open on this checkout
|
||||
rulings the "Ruled note: …" lines the Pre-Landing Review and the PR body carry
|
||||
@@ -64,7 +65,7 @@ const HELP = `gstack-approvals — the per-thread approval record (capy/skill/gs
|
||||
round-grant --pr <n> --head <the head that needs the round> --kind extra-round|fix-check --reason <why, one line>
|
||||
--by <the lane or its Captain> [--words <their words; default the reason>]
|
||||
[--owner-ref <thread code>:<message id or timestamp>: relays the grant from the lane's or Captain's message, so it
|
||||
records while a stopped /ship run is still open on this checkout; needs --words]
|
||||
records while a stopped /ship run is still open on this checkout; needs --words; the same shape as rule's]
|
||||
[--stop-run <run> --findings <ids>: fix-check only, the stop gstack-ship-receipt stop recorded and the findings
|
||||
its fix round is for; it buys one scoped fix-check of the PR's own change since that stop's head. A fix-check
|
||||
with neither buys one scoped fix-check of the change since --head, the reviewed head: a post-review edit (the
|
||||
@@ -189,7 +190,8 @@ function main(argv: string[]): number {
|
||||
if (!flags['--head'] || head.status !== 0) return invalid('round-grant needs --head <the head that needs the round, a commit in this repository>');
|
||||
if (!by || isGstackActorName(by)) return invalid('round-grant needs --by <the lane or its Captain>: gstack never grants itself a round');
|
||||
const ownerRef = flags['--owner-ref']?.trim();
|
||||
if (ownerRef !== undefined && (!OWNER_REF.test(ownerRef) || !(flags['--words'] ?? '').trim())) return invalid('--owner-ref relays the lane\'s or Captain\'s grant: <thread code>:<message id or timestamp> (GSTA-36:2026-11-19T12:29:59Z), with --words <their exact words>');
|
||||
if (ownerRef !== undefined && !OWNER_REF.test(ownerRef)) return invalid(`--owner-ref is not ${OWNER_REF_SHAPE}`);
|
||||
if (ownerRef !== undefined && !(flags['--words'] ?? '').trim()) return invalid('--owner-ref relays the lane\'s or Captain\'s grant, so round-grant needs --words <their exact words>');
|
||||
const stopRun = (flags['--stop-run'] ?? '').trim(), findings = [...new Set((flags['--findings'] ?? '').split(',').map(f => f.trim()).filter(Boolean))];
|
||||
const open = openShipRun(process.cwd());
|
||||
const ownStop = open?.state === 'stopped' && !open.claim && kind === 'fix-check' && stopRun === open.run && open.stop?.head === head.stdout.trim().toLowerCase();
|
||||
@@ -222,7 +224,9 @@ function main(argv: string[]): number {
|
||||
if (!flags['--head'] || head.status !== 0) return invalid('rule needs --head <the stop head the owner ruled at, a commit in this repository>');
|
||||
if (isGstackActor(flags['--by'] ?? '')) return invalid('--by names gstack; a ruling is the owner\'s, so --by names who ruled');
|
||||
const ownerRef = flags['--owner-ref']?.trim(), notSecurity = bools.has('--not-security');
|
||||
if (ownerRef !== undefined && (!OWNER_REF.test(ownerRef) || !(flags['--words'] ?? '').trim() || !(flags['--by'] ?? '').trim())) return invalid('--owner-ref relays the owner\'s ruling: <thread code>:<message id or timestamp> (GSTA-36:2026-11-19T12:29:59Z), with --by <the owner> and --words <their exact words>');
|
||||
if (ownerRef !== undefined && !OWNER_REF.test(ownerRef)) return invalid(`--owner-ref is not ${OWNER_REF_SHAPE}`);
|
||||
if (ownerRef !== undefined && !(flags['--words'] ?? '').trim()) return invalid('--owner-ref relays the owner\'s ruling, so rule needs --words <the owner\'s exact words>');
|
||||
if (ownerRef !== undefined && !(flags['--by'] ?? '').trim()) return invalid('--owner-ref relays the owner\'s ruling, so rule needs --by <the owner>');
|
||||
if (notSecurity && !/:red-team$/i.test(finding)) return invalid('--not-security is the owner\'s call on a red-team finding (path:line:red-team); a security, auth or secret finding is security class by its category');
|
||||
const open = openShipRun(process.cwd());
|
||||
if (open && notSecurity) return invalid(`--not-security lifts a red-team finding's redaction, so it is recorded only outside a /ship run: ${open.line}; record it after the run ends`);
|
||||
|
||||
Reference in new issue
Block a user