fix: allow gh pr numbers after options

This commit is contained in:
Codex
2026-05-29 09:36:50 +00:00
parent 93d305b0f6
commit a6b185354f
3 changed files with 44 additions and 8 deletions
+7
View File
@@ -517,6 +517,12 @@ export async function runGhCliPrContract(): Promise<JsonRecord> {
assertCondition(aliasPreflightData.command === "preflight", "top-level gh preflight should report alias command", aliasPreflightData);
assertCondition((aliasPreflightData.policy as JsonRecord).mergesPr === false, "top-level gh preflight alias must not merge", aliasPreflightData);
const optionsFirstPreflight = await runCli(["gh", "pr", "preflight", "--repo", "pikasTech/unidesk", "42"], env);
assertCondition(optionsFirstPreflight.status === 0, "pr preflight should accept PR number after --repo", optionsFirstPreflight.json ?? { stdout: optionsFirstPreflight.stdout });
const optionsFirstPreflightData = dataOf(optionsFirstPreflight.json ?? {});
assertCondition(optionsFirstPreflightData.command === "pr preflight", "options-first pr preflight should report command", optionsFirstPreflightData);
assertCondition((optionsFirstPreflightData.pullRequest as JsonRecord).number === 42, "options-first pr preflight should read the requested PR", optionsFirstPreflightData);
const fullPreflight = await runCli(["gh", "pr", "preflight", "42", "--repo", "pikasTech/unidesk", "--full"], env);
assertCondition(fullPreflight.status === 0, "pr preflight --full should succeed", fullPreflight.json ?? { stdout: fullPreflight.stdout });
const fullPreflightData = dataOf(fullPreflight.json ?? {});
@@ -736,6 +742,7 @@ export async function runGhCliPrContract(): Promise<JsonRecord> {
"pr read unsupported fields fail structurally with supported closeout fields listed",
"pr preflight exposes redacted auth plus compact merge/status closeout metadata",
"top-level gh preflight alias works for commander closeout",
"pr preflight accepts the PR number after options",
"pr preflight --full is the explicit status-context disclosure path",
"pr create dry-run exposes planned operation",
"pr comment dry-run preserves markdown text",