Repository navigation
Description
Split from #4852.
The issue title names pr close and pr ready as passing gh arguments, but the body's Proposed Solution only specifies the --body-file change for pr create and pr edit. The pass-through of unknown gh arguments for pr close and pr ready, the removal of non-gh flags (pr ready -m/-f), the removal of pr wait, the rename of pr update to pr update-branch, the removal of REST fallbacks, and the MCP schema changes are not specified in the body. Acceptance criteria: pr close SHALL pass unknown gh arguments unchanged; pr ready SHALL refuse -m/--monitor and -f/--force with exit 2; pr wait MUST exit 2 as an unknown command; pr update-branch SHALL replace pr update; pr create and pr edit MUST have no REST fallback; the MCP schema SHALL reflect the changes.
Proposed design
Problem statement
The devops pr commands do not match gh argument handling. pr close and pr ready drop the gh arguments they do not declare, pr ready accepts the non-gh flags -m/--monitor and -f/--force, pr wait duplicates pr monitor, pr update has a name that gh does not, and pr create and pr edit keep REST fallbacks. The change forwards the gh arguments to gh pr close and gh pr ready, refuses the two non-gh flags, removes pr wait, renames pr update to pr update-branch with its required-check guard, removes the REST fallbacks, and updates the MCP schema from the same command metadata.
Acceptance criteria
Requirement: pr close gh argument pass-through
devops pr close SHALL pass each argument that it does not declare itself to gh pr close unchanged and in the same order.
Scenario: close forwards comment and delete-branch
- WHEN a test runs
devops pr close 42 --comment done --delete-branchwith a fakeghthat records its arguments - THEN the fake
ghreceivespr close 42 --comment done --delete-branch.
Requirement: pr ready gh argument pass-through
devops pr ready SHALL pass each argument that it does not declare itself to gh pr ready unchanged and in the same order, and SHALL skip the readiness verdict and the Status write for --undo.
Scenario: ready forwards undo without the verdict
- WHEN a test runs
devops pr ready 42 --undowith a fakeghthat records its arguments and a pull request that the readiness verdict would refuse - THEN the fake
ghreceivespr ready 42 --undoand the command prints no readiness refusal.
Requirement: pr ready rejects non-gh flags
devops pr ready MUST exit with code 2 when it gets -m, --monitor, -f or --force, and MUST invoke no gh command.
Scenario: ready refuses monitor and force
- WHEN a test runs
devops pr ready 42 -manddevops pr ready 42 --forcewith a fakeghthat records its arguments - THEN each run exits with code 2 and the fake
ghrecords no call.
Requirement: pr wait removal
devops pr wait MUST exit with code 2 as an unknown command.
Scenario: wait is unknown
- WHEN a test runs
devops pr wait 42 - THEN the command exits with code 2 and writes an unknown-command error.
Requirement: pr update-branch replaces pr update
devops pr update-branch SHALL replace devops pr update and SHALL send the update-branch request only when a required check failed on the head and GitHub reports no conflict.
Scenario: update-branch sends only for a failed required check
- WHEN a test runs
devops pr update-branch 42with a fakeghthat reports no conflict, a failed required check on the head and the head SHA - THEN the fake
ghreceivesapi -X PUT repos/<owner>/<repo>/pulls/42/update-branch -f expected_head_sha=<sha>.
Requirement: pr update removal
devops pr update MUST exit with code 2 as an unknown command.
Scenario: update is unknown
- WHEN a test runs
devops pr update 42 - THEN the command exits with code 2 and writes an unknown-command error.
Requirement: no REST fallback
devops pr create and devops pr edit MUST return the gh failure and MUST call no REST fallback.
Scenario: gh failure stops create and edit
- WHEN a test runs
devops pr createordevops pr editwith a fakeghthat exits with code 1 - THEN the command exits with code 1 and the fake
ghrecords noapicall.
Requirement: MCP schema reflects the pr commands
The MCP server SHALL publish pr_update_branch and SHALL publish no pr_update, pr_wait, pr_close comment or delete_branch property, pr_ready monitor option or pr_ready force option.
Scenario: the tool listing names the renamed command
- WHEN
uv run devops ci test tests/ai/mcp/test_mcp_tool_listing.pyruns after the exposure table changes - THEN the snapshot test passes with
pr_update_branchin the listing, nopr_updateorpr_waitentry, nocommentordelete_branchproperty inpr_close, and nomonitororforceproperty inpr_ready.
Existing Tool Considered
No alternatives check has run. gh (GitHub CLI) is the open, maintained tool that covers the need: it provides pr close, pr ready, pr update-branch, pr create and pr edit, with their argument parsing (https://cli.github.com/manual/gh_pr_update-branch, fetched 2026-11-18). It has no pr wait or pr update, so the proposal removes both. gh pr update-branch has no --expected-head-sha flag, so devops pr update-branch keeps the existing gh api request and its required-check guard (docs/SDLC.md:322). The proposal forwards the gh arguments to gh pr close and gh pr ready, deletes the REST fallbacks of pr create and pr edit, and builds no GitHub client of its own.
Key questions
- Which
gh prsubcommands exist for the commands in this issue?:ghprovidespr close,pr ready,pr update-branch,pr createandpr edit; it provides nopr waitorpr update. The repository already calls four of them insrc/devops_cli/github/pr_plans.py(pr_close_args,pr_ready_args,pr_create_args,pr_edit_args), andbuild_updte_branch_cmdinsrc/devops_cli/github/branch_updte.pybuilds thegh api -X PUT .../updte-branchrequest for the fifth. [sources: src/devops_cli/github/pr_plans.py:204, src/devops_cli/github/pr_plans.py:263, src/devops_cli/github/pr_plans.py:144, src/devops_cli/github/pr_plans.py:102] - Should
pr closeforward unknown arguments toghor keep a fixed flag list?: Forward every argument that the command does not declare itself togh pr closeunchanged and in the same order. Declare onlynumber,--repo/-Rand--dry-run; pass--comment,--delete-branchand any laterghflag throughctx.args. (best practice) [sources: src/devops_cli/github/pr_plans.py:263, src/devops_cli/commands/pr.py:1622, src/devops_cli/commands/gh.py:1446]- Chosen: forward undeclared arguments. It keeps the command in step with
ghand adds no flag list to maintain. - Rejected: allow a fixed flag list. It drops a valid
ghflag whenghadds one. - Rejected: reject unknown arguments. It blocks
ghflags that the command does not name.
- Chosen: forward undeclared arguments. It keeps the command in step with
- Should
pr readyforward unknown arguments and reject-m/--monitorand-f/--force?: Yes. Forward every argument that the command does not declare itself togh pr readyunchanged and in the same order, except-m,--monitor,-fand--force, which MUST exit with code 2 before anyghcall. For--undo, forward it and skip the readiness verdict and the Status write; for every other call, run the verdict andmark_readywith the extra arguments. (best practice) [sources: src/devops_cli/commands/pr.py:1516, src/devops_cli/commands/pr.py:1520, src/devops_cli/commands/pr.py:1508]- Chosen: reject the non-gh flags and forward the rest. It matches
gh pr ready, which has no monnitor or force flag, and keeps the readiness verdict for a mark-ready call. - Rejected: keep the flags as devops flags. It keeps two behaviors that
ghdoes not have. - Rejected: forward the flags to
gh.gh pr readyrejects them, so the command fails later. - Rejected: keep the readiness verdict for
--undo. It can refuse an un-draft thatgh pr ready --undoaccepts.
- Chosen: reject the non-gh flags and forward the rest. It matches
- Should
pr updatestay as an alias forpr update-branch?: No. Removepr updateand keep onlypr update-branch. The rename keeps the existing required-check guard and theexpected_head_shalock:gh pr update-branchhas no--expected-head-shaflag, anddocs/SDLC.md(No Catch-Up Updates) forbids an update with no failed required check. (best practice) [sources: docs/SDLC.md:322, openspec/specs/pr-update/spec.md:9, src/devops_cli/commands/pr.py:2003, CONTRIBUTING.md:36, CONTRIBUTING.md:37]- Chosen: rename and keep the guard. One name matches
gh, and the recorded SDLC rule and theexpected_head_shalock stay. - Rejected: delegate unconditionally to
gh pr update-branch. It drops the guard and the lock, andghhas no--expected-head-shaflag. - Rejected: keep
pr updateas an alias. It adds a second name and a test surface for the same action, which the pre-1.0 policy forbids. - Rejected: deprecate
pr updatewith a warning. The pre-1.0 policy forbids deprecation shims.
- Chosen: rename and keep the guard. One name matches
- Should
pr createandpr editkeep a REST fallback whenghfails?: No. Remove_fallback_create_prand_fallback_patch_prand return theghexit status and error. (best practice) [sources: src/devops_cli/commands/pr.py:1400, src/devops_cli/commands/pr.py:949, src/devops_cli/commands/pr.py:1036, src/devops_cli/commands/pr.py:852]- Chosen: remove the REST fallback.
ghis the single write path, so a second path cannot diverge. - Rejected: keep the REST fallback. Two write paths can duplicate or diverge on failure.
- Rejected: use REST first. It bypasses
ghargument handling and its errors.
- Chosen: remove the REST fallback.
- Should
pr waitbe removed?: Yes. Remove thewaitalias ofpr monitor;pr waitthen exits with code 2 as an unknown command.docs/SDLC.mdnamespr monitoras the monitoring command, and the pre-1.0 policy forbids a second name. (best practice) [sources: src/devops_cli/commands/pr.py:733, docs/SDLC.md:358, openspec/specs/command-dry-run-class/spec.md:98, CONTRIBUTING.md:37]- Chosen: remove the alias. One name,
pr monitor, matches the documented command and needs no second test surface. - Rejected: keep the alias. It keeps a second name for the same code, which the pre-1.0 policy forbids.
- Rejected: keep
pr waitand removepr monitor.pr monitoris the name thatdocs/SDLC.mdand the workflows use.
- Chosen: remove the alias. One name,
- Should the MCP schema change be part of this change or deferred?: Part of this change. The MCP tool bridge is generated from Typer/Click metadata driven by
CONST_MCP_EXPOSURE_TABLE, so the rename is one row (src/devops_cli/config/constants.py:415), and the snapshot test (tests/ai/mcp/test_mcp_tool_listing.py:11) and the generateddocs/MCP_TOOLS.mdshow the diff. No schema field is hand-written. (best practice) [sources: src/devops_cli/config/constants.py:415, tests/ai/mcp/test_mcp_tool_listing.py:11, src/devops_cli/ai/mcp/generator.py:1]- Chosen: include the table row and snapshot update. The issue requires the MCP schema to reflect the change, and the path and validator are known.
- Rejected: defer it to a new issue. The change is one table row and a reviewed snapshot diff, and the issue's acceptance criteria name it.
- Rejected: hand-write the schema. The bridge is generated from Typer/Click metadata; a hand-written schema would diverge.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 16, 2026
Both cover pr close and pr ready passing gh arguments, but the candidate adds pr wait removal, pr update-branch rename, REST fallback removal, and MCP schema changes not in the umbrella.devops-cli-service commentedon Nov 18, 2026
Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.
feat(pr): add --body-file option to pr create and pr edit (#7051)