Skip to content

refactor(pr): delete the helpers left by devops pr update #6492

Open

Description

@devops-cli-service

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.pr and checks hasattr for each helper name.
  • THEN The test asserts not hasattr(module, "_run_gh_pr_command") and not 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 src or the tests. The code map lists src/devops_cli/commands/pr.py as the caller file for both names, and lists no test file. The module still imports plan_update_single_pr and DEFAULT_PR_UPDATE_HEAD_POLL_ATTEMPTS, so devops pr update is still in the file. The body names no issue number for the deletion of devops 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 pr command group. Import devops_cli.commands.pr and assert not 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 pr command test module. It proves that the imported module does not define either name, and the pr command 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.

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

  1. added
    type/refactor
    source/agent
    status/new
    effort/low
    value/low
    scope/pr
    on Nov 20, 2026
  2. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    ContributorAuthor
  3. added
    priority/p3-low
    on Nov 20, 2026
  4. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  5. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  6. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p3-lowscope/prsource/agentstatus/newtype/refactorvalue/low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions