Skip to content

fix(pr): the failed check hint names devops gh, not bare gh #7224

Done

Description

@dan-petty

Problem or Motivation

devops pr monitor and devops pr check-readiness end a failure with this line: "Inspect failed job logs via: gh run view --log-failed <run_id>" (src/devops_cli/commands/pr.py, the print_warning call near line 699). Rule 7 of AGENTS.md says "Never run bare gh", and .claude/settings.json denies Bash(gh *). The tool tells an agent to run a command that the rules forbid. devops gh run view <run_id> --log-failed exists and does the same.

Seen on 2026-11-25 in the output of uv run devops pr monitor 7218.

Proposed Solution

Disposition: change the code.

Print devops gh run view --log-failed <run_id>. Put the text in the message catalog if it is not there. Add the run id of the failed check to the line when the command knows it.

Proof: a test of the command output that finds devops gh run view and no bare gh run view.

Existing Tool Considered

None. This is one message of the command.

Alternatives check of 2026-11-25: none.
Tool: none found.
Reason: Searches for a tool that rewrites bare gh hints or supplies the catalog string found nothing relevant; the need is a one-line fix inside the project's own pr.py warning, which no external tool covers.

Lacks:

  • Hint text that names the wrapper instead of bare gh
  • Run id added to the failure line
  • Test asserting no bare gh run view

Proposed design

Problem statement

The failed-check warning of devops pr monitor and devops pr check-readiness names bare gh run view. AGENTS.md rule 7 forbids bare gh, and .claude/settings.json denies Bash(gh *). The warning must name the devops gh wrapper and must not print a bare gh command.

Acceptance criteria

Requirement: Failed-check hint uses devops gh

The failed-check hint SHALL print devops gh run view --log-failed <run_id> and SHALL NOT print a bare gh run view command.

Scenario: Monitor reports a failed check

  • WHEN devops pr monitor exits with a failed check and no known run id
  • THEN the warning line is Inspect failed job logs via: devops gh run view --log-failed <run_id>.

Requirement: Check-readiness hint uses devops gh

The check-readiness failed-check hint SHALL name devops gh run view and SHALL NOT name bare gh run view.

Scenario: Check-readiness reports a failed check

  • WHEN devops pr check-readiness reports a failed check
  • THEN the captured warning contains devops gh run view --log-failed and no line starts with Inspect failed job logs via: gh run view.

Requirement: Catalog message holds the hint

The failed-check hint SHALL be defined in the PR message catalog and formatted with the run id placeholder.

Scenario: Catalog formatting

  • WHEN the failed-check hint is rendered
  • THEN the warning equals MESSAGES.pr.failed_check_log_hint.format(run_id='<run_id>').

Existing Tool Considered

The alternatives check of 2026-11-25 in the issue body records verdict none and Tool: none found. No open, maintained tool covers this one-line hint. The written cost of the in-repo change is about 2,000 tokens and 15 minutes to build, keep and fix.

Key questions

  • Which command should the failed-check hint name?: Use devops gh run view --log-failed <run_id>. Do not print bare gh run view. (best practice) [sources: AGENTS.md, .claude/settings.json, src/devops_cli/commands/gh.py, docs/adr/0037-tool-commands-mirror-and-pass-through-options.md]
    • Rejected: Bare gh run view. AGENTS.md rule 7 forbids bare gh, and .claude/settings.json denies Bash(gh *).
    • Chosen: devops gh run view. devops gh is the required wrapper and mirrors the GitHub CLI options.
    • Rejected: New PR-specific command. devops gh already covers the command, so a new command adds no value.
  • Does the monitor know the failed run id?: No. _handle_monitor_exit reads status.checks_failed, and the check records expose a link, not a run id. Keep <run_id> as a placeholder. [sources: src/devops_cli/commands/pr.py]
  • Where should the hint text live?: Add MESSAGES.pr.failed_check_log_hint to the PR message catalog and format it with the run id placeholder. (best practice) [sources: src/devops_cli/commands/pr.py]
    • Rejected: Keep the literal in pr.py. pr.py already reads PR messages from MESSAGES.pr, so a literal adds a second source.
    • Chosen: Add a PR catalog message. The issue asks for the catalog when the text is absent, and the command already uses MESSAGES.pr.
  • Should the hint parse a run id from the failed check link?: No. Parsing the link is fragile, and the issue asks for the run id only when the command knows it. Keep the placeholder. (best practice) [sources: src/devops_cli/commands/pr.py]
    • Rejected: Parse the link. The link format is not a stable run id field, and parsing adds failure modes.
    • Chosen: Keep <run_id>. The monitor path has no run id field, and the placeholder matches the current hint.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    on Nov 25, 2026
  2. dan-petty commented on Nov 25, 2026

    @dan-petty
    OwnerAuthor
  3. added
    status/new
    effort/low
    value/low
    scope/pr
    priority/p3-low
    on Nov 25, 2026
  4. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (3)

    Tools considered:

    Searches run:

    • Python library message catalog for CLI warning strings with placeholders, results: 5
    • tool that rewrites bare gh commands to a wrapper CLI, gh run view --log-failed hint, results: 5
    • existing CLI that blocks bare gh and wraps GitHub CLI commands for AI agents, results: 5

    Sources:

  5. added
    status/ready
    and removed
    status/new
    on Nov 28, 2026
  6. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  7. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 29, 2026
  8. removed
    status/in-review
    owner/agent
    on Nov 29, 2026
  9. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 05:10 UTC

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/agenttype/bugvalue/low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions