gstack-pr-wait ignores cancelled checks a newer pass replaced, and the npm git-dependency hint names allow-git (#4832)

`gstack-pr-wait` no longer blocks on a cancelled check that a newer run
of the same check replaced, and the `DEPS_MISSING` stop names npm 12's
`allow-git` setting when the lockfile installs a package from git.

The docs audit that /gstack-ship launches also starts after a reviewer's
install, and a refused launch no longer uses up its one retry.

Nothing for you to do. Fixes #4807 and #4815; thanks to exGeni for both
reports and the repro.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/red-team#1 reader=red-team
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-25 18:13:02 +00:00
1 parent 959df8ccc4
commit 8aafd408e2
16 files changed
+175 -23

No files matched your search

+7 -2
View File
@@ -15,6 +15,7 @@
import type { GhResult, GhRunner } from './ci-gate';
import { headCheckRows } from './ci-head-checks';
import { parseHeadChecks, parsePullState, rateLimitKind, type PullState } from './gh-poll';
import { replacedCancels } from './ship-queue';
export class GhError extends Error {
constructor(message: string, readonly transient: boolean) {
@@ -183,12 +184,16 @@ function restList(env: GhEnv, path: string, key: string): unknown[] {
* statuses (the same rows `gh pr checks` reads through GraphQL) plus CI at the
* head as gstack-ship-queue ready reads it (lib/ci-head-checks.ts: a failed
* check whose rerun attempt created no jobs, a workflow run that failed with
* no jobs), duplicates collapsed to the worst bucket. An unknown read is a
* no jobs), duplicates collapsed to the worst bucket. A cancelled run that a
* newer passing or still-running run of the same app and check name replaced is left out first,
* as that reader leaves it out (replacedCancels, #4807). An unknown read is a
* transient GhError, so the poll loop tries again.
*/
export function fetchChecks(env: GhEnv, repo: string, head: string): Map<string, Check> {
const runs = restList(env, `repos/${repo}/commits/${head}/check-runs?per_page=100`, 'check_runs') as Array<Record<string, unknown>>;
const replaced = replacedCancels(runs);
const listed = parseHeadChecks(
restList(env, `repos/${repo}/commits/${head}/check-runs?per_page=100`, 'check_runs'),
runs.filter(r => !replaced.has(r)),
restList(env, `repos/${repo}/commits/${head}/status?per_page=100`, 'statuses'),
);
const ci = headCheckRows(args => runGh(env, args), repo, head);