fix: extend code queue pr preflight diagnostics
This commit is contained in:
@@ -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",
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user