Repository navigation
Description
Split from #5148.
Problem: _run_gh_pr_command and _resolve_pr_head_sha in src/devops_cli/commands/pr.py have no caller in src or in the tests. Why deferred: the issue body orders their deletion after the deletion of devops pr update, which changes the same file and has not merged. Acceptance criteria: src/devops_cli/commands/pr.py SHALL hold no _run_gh_pr_command and no _resolve_pr_head_sha; a test imports the module and asserts that hasattr is False for both names. The work waits on the deletion of devops pr update.
Proposed design
Problem statement
src/devops_cli/commands/pr.py keeps two private helpers, _run_gh_pr_command and _resolve_pr_head_sha. The issue body states that no caller remains in src or the tests. The code map lists the defining file as the caller file for both names. The module still imports the pr update helpers, so devops pr update is still in the file. The change deletes both names after the devops pr update deletion merges. It adds a test that the module defines neither name.
Acceptance criteria
Requirement: Unused PR helpers removed
The devops_cli.commands.pr module SHALL define neither _run_gh_pr_command nor _resolve_pr_head_sha.
Scenario: Both helper names are absent
- WHEN A test imports
devops_cli.commands.prand checkshasattrfor each helper name. - THEN The test asserts
not hasattr(module, "_run_gh_pr_command")andnot hasattr(module, "_resolve_pr_head_sha"), and both assertions pass.
Existing Tool Considered
No alternatives check has run. vulture (https://github.com/jendrikseipp/vulture) is the open, maintained dead-code finder for Python, and it covers the detection of an unused private function. It lacks a regression guard: it reports a dead name on a run and adds no check that fails when the name returns. It also lacks deletion, and its confidence setting can miss a name that a decorator or a string reaches. The change deletes the two helpers by hand and adds one regression test. It builds no dead-code finder.
Key questions
- Do the helpers still have a caller, and which item deletes that caller?: The issue body states that no caller remains in
srcor the tests. The code map listssrc/devops_cli/commands/pr.pyas the caller file for both names, and lists no test file. The module still importsplan_update_single_prandDEFAULT_PR_UPDATE_HEAD_POLL_ATTEMPTS, sodevops pr updateis still in the file. The body names no issue number for the deletion ofdevops pr update. [sources: src/devops_cli/commands/pr.py:126, src/devops_cli/commands/pr.py:396, src/devops_cli/commands/pr.py] - Where does the regression test belong, and how does it check that both names are absent?: Add the check to the test module that covers the
prcommand group. Importdevops_cli.commands.prand assertnot hasattr(module, name)for each helper name. The negated attribute check proves that the imported module does not define either name. (best practice) [sources: docs/TESTING.md, AGENTS.md, src/devops_cli/commands/pr.py:126]- Chosen: Attribute check in the
prcommand test module. It proves that the imported module does not define either name, and theprcommand group already has one test module. - Rejected: Source text search. A comment or a string can hold the name, so the check passes while the function is still present.
- Rejected: No regression test. A later change can add the name back with no failing check.
- Chosen: Attribute check in the
Fit
Fits in one pull request.
Suspected block
The deletion of devops pr update must merge first; it changes src/devops_cli/commands/pr.py, and the body names no issue number.
Dependencies
None.
Watched files
A commit on the default branch that changes one of these files starts the next refine round.
src/devops_cli/commands/pr.py
Activity
devops-cli-service commentedon Nov 20, 2026
Small dead-code removal with no user-facing impact and no deadline.Both remove dead code, but #94 is a broad umbrella while the candidate targets two specific functions left by devops pr update.devops-cli-service commentedon Nov 20, 2026
Owner question: See Suspected block and Watched files in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 23, 2026
Owner question: See Suspected block and Watched files in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 25, 2026
Owner question: See Suspected block and Watched files in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence