fix: extend code queue pr preflight diagnostics

This commit is contained in:
Codex
2026-05-21 01:14:24 +00:00
parent a43c24dd88
commit 9e4561e102
7 changed files with 87 additions and 8 deletions
@@ -66,6 +66,7 @@ function fixtureRuntimePreflight(tokenPresent: boolean): JsonRecord {
knownHostsPresent: true,
privateKeyPresent: true,
},
prCreateDryRun: tokenPresent ? { command: "sh", args: ["-lc", "bun scripts/cli.ts gh pr create --dry-run"], ok: true, exitCode: 0, signal: null, error: null, stdout: "{\"ok\":true,\"data\":{\"dryRun\":true}}", stderr: "" } : undefined,
limitations: tokenPresent ? [] : ["GH_TOKEN/GITHUB_TOKEN is not present; gh cannot create PRs unless another gh credential store is mounted"],
risks: [],
},
@@ -114,6 +115,14 @@ export function runCodeQueuePrPreflightContract(): JsonRecord {
const readyTokenCoverage = asRecord(readyPreflight.tokenCoverage);
assertCondition(readyTokenCoverage.source === "GH_TOKEN", "ready token source should be redacted to key name only", readyTokenCoverage);
const prCreateDryRun = codexPrPreflightQueryForTest(["--remote", "--pr-create-dry-run", "--pr-create-dry-run-head", "codequeue/pr-probe"], (path) => {
assertCondition(path === "/api/microservices/code-queue/proxy/api/runtime-preflight?remote=1&prCreateDryRun=1&prCreateDryRunHead=codequeue%2Fpr-probe", "PR create dry-run options should map to query string", { path });
return fixtureResponse(true);
});
const prCreateDryRunPreflight = asRecord(asRecord(prCreateDryRun).preflight);
const prCreateDryRunProbe = asRecord(prCreateDryRunPreflight.prCreateDryRun);
assertCondition(prCreateDryRunProbe.ok === true, "PR create dry-run probe should be compacted", prCreateDryRunProbe);
return {
ok: true,
checks: [
@@ -121,6 +130,7 @@ export function runCodeQueuePrPreflightContract(): JsonRecord {
"missing GitHub token is infra-blocked",
"token key names are reported without values",
"push dry-run options are forwarded",
"PR create dry-run options are forwarded",
],
};
}