Skip to content

fix(roadmap): plan-check --repo reads the wrong origin and title check #7522

Done

Description

@dan-petty

Problem Description

devops roadmap plan-check <pr> --repo <owner>/<name> does not work for a plan pull request of another repository:

  1. It fetches the head commit of the pull request from the origin of the current folder, not from the repository of --repo. From a devops-cli checkout, each homelab plan pull request fails with git fetch --quiet origin <sha> and fatal: remote error: upload-pack: not our ref <sha>.
  2. When it runs from a checkout of that repository, it reports The pull request has no check Semantic PR title`` for each plan. A repository that calls the reusable title workflow (homelab, danielpetty.com and each repository of the github-workflows template) reports the check as PR title / Semantic PR title, and that check passed.

Reproduction Steps

  1. From /workspaces/devops-cli: uv run devops roadmap plan-check 617 --repo dan-petty/homelab.
  2. From a clone of dan-petty/homelab: uv run --project /workspaces/devops-cli devops roadmap plan-check 617 --repo dan-petty/homelab.

Expected vs Actual Behavior

Expected: both runs fetch the head from dan-petty/homelab, and the title check passes because PR title / Semantic PR title succeeded.

Actual: run 1 stops with Could not check the plan: ... not our ref. Run 2 gives checks: semantic-pr-title: The pull request has no check Semantic PR title. for homelab #584, #611, #617 and #632, on 2026-11-28.

Environment Diagnostics

devops-cli main at 0e2070a. The Service stage of a homelab item runs in its own clone, so this affects the command of an agent or a person that checks a plan of another repository.

Logs, Traces, or Terminal Output

None.

Alternatives check of 2026-11-28: in-use.
The repository already uses this tool.
Tool: cli/cli (https://github.com/cli/cli), MIT, last activity 2026-11-27, maintained.
Reason: Searches returned only unrelated pages; GitHub CLI covers the core capability, reading a pull request head ref and its check-run names from any repository with --repo, but it does not run the plan-check itself.

Covers:

  • Fetch a pull request head from any named repository
  • List check runs and their names for a pull request
  • Runs without a local clone of the target repository

Lacks:

  • No plan-check or plan-file validation logic
  • No built-in match of reusable-workflow check prefixes
  • Not a Python library for in-process calls

Proposed design

Problem statement

The plan-check command of another repository fetches the pull request head from the local origin and does not recognize the reusable title check name. The command fails or reports a false missing title check. The fix reads the target repository and accepts the reusable check name.

Acceptance criteria

Requirement: Target repository head fetch

The plan-check command SHALL fetch the pull request head commit from the repository named by --repo, not from the origin remote of the current folder.

Scenario: Fetch from the named repository

  • WHEN A unit test calls the head fetch with --repo dan-petty/homelab and a head SHA, and origin points to another repository.
  • THEN The test asserts that the git fetch command uses https://github.com/dan-petty/homelab.git and the head SHA, and does not use origin.

Requirement: Reusable title check

The plan-check command SHALL accept a successful check named PR title / Semantic PR title as the semantic pull request title check.

Scenario: Reusable workflow title check passes

  • WHEN A unit test gives a check run named PR title / Semantic PR title with conclusion success.
  • THEN The test asserts that the title check result passes and the command reports no missing Semantic PR title check.

Requirement: Exact title check compatibility

The plan-check command SHALL keep accepting a successful check named Semantic PR title.

Scenario: Direct title check passes

  • WHEN A unit test gives a check run named Semantic PR title with conclusion success.
  • THEN The test asserts that the title check result passes.

Existing Tool Considered

The alternatives block in the issue body records in-use for cli/cli (https://github.com/cli/cli, MIT, maintained). The block lists what the tool covers and lacks. The proposal keeps the existing GitHub session. It adds the target-repository fetch and the reusable-check-name match that the block says cli/cli lacks.

Key questions

  • Which remote should plan-check --repo use to fetch the pull request head?: Use the repository named by --repo as an explicit HTTPS URL in the git fetch of the head SHA. Do not use the local origin. (best practice) [sources: AGENTS.md, tests/commands/test_roadmap_plan_check_cmd.py]
    • Chosen: Explicit target repository URL. The URL names the repository of --repo and needs no local clone or remote setup.
    • Rejected: Local origin. It names the current folder's repository, so it fetches the wrong head.
    • Rejected: Temporary named remote. It adds remote state to the current checkout and needs cleanup.
    • Rejected: gh pr checkout. It changes the current checkout and needs a clone of the target repository.
  • How should the title check match a reusable workflow check name?: Match Semantic PR title exactly, or match the last segment after / in the check name. Accept the check only when that name matches and its conclusion is success. (best practice) [sources: tests/commands/test_roadmap_plan_check_cmd.py]
    • Chosen: Exact or final slash segment. It accepts PR title / Semantic PR title and keeps Semantic PR title.
    • Rejected: Exact name only. It rejects the reusable workflow check name.
    • Rejected: Substring match. It can accept an unrelated check that contains the name.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

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

    @dan-petty
    OwnerAuthor
  3. added
    scope/roadmap
    status/new
    value/medium
    effort/low
    priority/p2-medium
    on Nov 28, 2026
  4. devops-cli-service commented on Nov 28, 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 (10)

    Tools considered:

    Searches run:

    • reusable GitHub Actions workflow check run name "PR title / Semantic PR title", results: 5
    • gh pr view --repo owner/name --json headRefOid statusCheckRollup check name, results: 5
    • GitHub CLI fetch pull request head commit from another repository, results: 5
    • PyGithub get check runs for pull request head commit, results: 5
    • gh pr checkout --repo fetch head commit of pull request GitHub CLI manual, results: 5
    • GitHub API list check runs for a ref filter by name pull request head sha, results: 5
    • gh pr view statusCheckRollup, results: 5
    • GitHub CLI, results: 5
    • pygithub, results: 5
    • cli.github.com manual gh pr checks, 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 28, 2026
  8. removed
    status/in-review
    owner/agent
    on Nov 28, 2026
  9. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-28 20:38 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/p2-mediumscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions