mirror of
https://github.com/garrytan/gstack.git
synced 2026-12-01 20:34:25 +01:00
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:
1 parent
959df8ccc4
commit
8aafd408e2
16 files changed
+175
-23
No files matched your search
@@ -160,6 +160,21 @@ export function latestRunPerName<T extends CheckRun>(runs: T[]): T[] {
|
||||
const suiteOf = (r: Record<string, unknown>) => String((r.check_suite as { id?: unknown } | null | undefined)?.id ?? '');
|
||||
const PASSING = ['success', 'skipped', 'neutral'];
|
||||
|
||||
/**
|
||||
* The cancelled runs latestRunPerName judges by a newer run of the same app and check name that passed or is still
|
||||
* running, such as a pull_request run that concurrency: cancel-in-progress cancelled when the next run on the same head
|
||||
* started (#4807). gstack-pr-wait leaves these out before keeping the worst bucket per name, so the check reads as that
|
||||
* newer run (pass or pending), as ready reads it; every other older run still gates there.
|
||||
*/
|
||||
export function replacedCancels<T extends CheckRun & { conclusion?: unknown }>(runs: T[]): Set<T> {
|
||||
const winners = new Map(latestRunPerName(runs).map(r => [checkKey(r), r] as const).filter(([k]) => k !== null));
|
||||
return new Set(runs.filter(r => {
|
||||
const key = checkKey(r);
|
||||
const by = key === null ? undefined : winners.get(key);
|
||||
return r.status === 'completed' && r.conclusion === 'cancelled' && !!by && by !== r && (by.status !== 'completed' || PASSING.includes(String(by.conclusion)));
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* A CI_SUPERSEDED line for each red run whose check counts by a passing newer run from another check suite, such as a
|
||||
* branch-only dispatch that replaced a red pull_request run, which tested the merge with the base (reports/GSTA-461.md
|
||||
|
||||
Reference in new issue
Block a user