Fix ship-queue ready tests after the pre-merge check got stricter (GST-2282) (#4271)

* Give the ship-queue ready tests complete pregate records

The notes-push and fresh-base suites wrote a one-check pregate record, which ready refuses as a partial run since #4258. They now write every registered check, as the other queue tests do.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* Add a changelog entry for the ship-queue ready test fix

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-10 02:46:56 +00:00
1 parent ccc3f0fc14
commit b1702eea91
3 files changed
+7 -2

No files matched your search

+3 -1
View File
@@ -8,6 +8,7 @@ import { afterEach, describe, expect, test } from 'bun:test';
import * as fs from 'node:fs';
import * as path from 'node:path';
import { EXIT } from '../lib/headless-artifacts';
import { CHECK_IDS } from '../lib/pregate/index';
import { REVIEW_EXCLUDE_KEY_VERSION } from '../lib/ship-policy';
import { BASE_POLICY, cleanup, makeFixtureRepo, runBin, type FixtureRepo } from './helpers/restamp-fixture';
import { ghQueueShim } from './helpers/ship-queue-fixture';
@@ -17,6 +18,7 @@ const repos: FixtureRepo[] = [];
afterEach(() => { while (repos.length) cleanup(repos.pop()!); });
const green = { check_runs: [{ status: 'completed', conclusion: 'success' }] };
const FULL_CHECKS = CHECK_IDS.map(id => ({ id, status: 'pass' }));
const queue = (repo: FixtureRepo, args: string[], env: Record<string, string>) => runBin(repo, 'gstack-ship-queue', [...args, '--base', 'main'], env);
function write(repo: FixtureRepo, files: Record<string, string>, message: string): string {
@@ -55,7 +57,7 @@ function stackedAfterParentLanded() {
const landed = land(repo, 'parent');
const tree = runBin(repo, 'gstack-wtree', []).out.trim();
const pregate = path.join(repo.root, 'pregate.json');
fs.writeFileSync(pregate, JSON.stringify({ schema_version: 1, tree, head, verdict: 'pass', checks: [{ id: 'unit', status: 'pass' }] }));
fs.writeFileSync(pregate, JSON.stringify({ schema_version: 1, tree, head, verdict: 'pass', checks: FULL_CHECKS }));
const ready = (digest: string) => queue(repo, ['ready', '--pr', '2', '--pregate', pregate], ghQueueShim(repo, { prs: { '2': { headRefOid: head, url: 'https://github.com/o/r/pull/2', body: shippedBody('2', head, { review_exclude: { source: 'origin/main', patterns: ['fixtures/goldens/**'], applied: ['fixtures/goldens/**'], excluded: 1, excluded_bytes: 0, kept: 0, gate_tagged: [], patterns_sha256: 'b'.repeat(64), list_sha256: 'c'.repeat(64), digest } }) } }, checks: { [head]: green } }));
const probe = ready('a'.repeat(64));
expect(probe.status, probe.out + probe.err).toBe(EXIT.refused);