Skip to content

test(cli): pr, gh and repos command tests patch no names #4085

Closed

Description

@dan-petty

Problem or Motivation

Issue #3769 asks that the command tests patch no name inside devops_cli. This item covers group 2 of #3769: the tests of the pr, gh and repos commands.

An AST count at origin/main 74ba76b finds 266 string patches of a devops_cli name in these files:

  • tests/commands/test_pr_cmd.py: 84
  • tests/commands/test_pr_update.py: 51
  • tests/commands/test_gh_cmd.py: 53
  • tests/commands/test_repos.py: 41
  • tests/commands/test_pr_dry_run.py: 7
  • tests/commands/test_pr_form_check.py: 9
  • tests/commands/test_pr_status.py: 9
  • tests/commands/test_pr_title_labels.py: 6
  • tests/commands/test_github_milestones.py: 6

The patches replace run_gh, check_binary, load_settings, get_repo_origin_name, time.sleep and private helpers of the commands. They break the rule of docs/TESTING.md, and they stop #1336 from turning its ratchet into a ban.

Expected Behavior

Each test reaches the edge of its command through the shared fake: process_fake, git_fake, github_api, GitHubFake, the clock fake, or the config fixture. No test patches a devops_cli name. Logic that sits in a command behind a private helper moves behind a public function in its domain package only where the test needs it.

Acceptance criteria

  • The test files named above hold no string patch of a devops_cli name.
  • Every test of these files keeps its node id, unless the old name was wrong. The behavior that each test checks does not change.
  • Product mutations in a scratch copy make the migrated tests fail.
  • The pull request states the count of patches before and after.

Existing tool considered

No new tool is needed. The fakes of tests/support/fakes/, the config fixture and pytest cover the need.

Related

Activity

  1. added
    source/agent
    type/test
    scope/cli
    status/new
    value/medium
    effort/medium
    on Nov 7, 2026
  2. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/test. The test prefix of the title gives the type.
    • Scope: scope/cli. The (cli) scope of the title gives the scope.
    • Priority: P2-Medium. It unblocks #1336 and enforces the TESTING.md rule, but it is a refactor with no user-facing defect.
    • Value: Medium. It makes 266 test patches use shared fakes, improving maintainability and unblocking the ban in #1336.
    • Effort: Medium. 266 patch sites across 9 files must be rewritten to use process_fake, git_fake, github_api, or the config fixture.
    • Related: test(cli): command tests patch no devops_cli names #3769, which asks for a different change. Both remove internal patches from command tests; #3769 covers all groups, this candidate covers only the pr, gh and repos files.
  3. added
    priority/p2-medium
    on Nov 7, 2026
  4. added
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 8, 2026
  5. removed
    status/in-review
    on Nov 8, 2026
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/mediumpriority/p2-mediumscope/clisource/agenttype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions