Skip to content

fix(pr): pr monitor fits a repository with no CI #5144

Closed

Description

@dan-petty

Problem Description

In a repository with no GitHub Actions workflow, devops pr monitor and devops pr check-readiness take the head commit with no check as a running check. The check verdict puts the pending stand-in "no checks reported" in place of the missing checks. check-readiness exits 1 with "PR # has 1 check(s) still running: no checks reported.", and pr monitor waits until its timeout and exits 3. No check will start in such a repository, for example dan-petty/homelab (actions/workflows total_count 0 on 2026-11-12).

Pull request #5142 (#3767) fixes the same case for devops pr ready only: when the head commit reports no check and GitHubClient.count_workflows gives 0, it does not judge the checks. pr monitor and check-readiness read the merge-readiness verdict and did not change.

Reproduction Steps

  1. Open a draft pull request in a repository with no workflow, such as dan-petty/homelab.
  2. Run uv run devops pr check-readiness <n> --repo dan-petty/homelab.
  3. Run uv run devops pr monitor <n> --repo dan-petty/homelab.

Expected vs Actual Behavior

Expected: both commands use the rule of pr ready. When the head commit reports no check run and no commit status and the repository has no workflow, the missing checks are no blocker, and the output says that the repository has no CI.

Actual: check-readiness exits 1 with a running-check blocker. pr monitor waits for the stand-in until the timeout and exits 3.

Environment Diagnostics

devops-cli at origin/main after #5142. The verdict is assess_merge_readiness in src/devops_cli/github/merge_readiness.py (_judge_checks); the stand-in is no_checks_reported() in src/devops_cli/github/check_verdict.py, and CheckVerdictSummary.reports_nothing detects it.

Logs, Traces, or Terminal Output

Before #5142, devops pr ready 19 --repo dan-petty/homelab refused with "A check runs: no checks reported" (0 check runs, 0 statuses). The same stand-in reaches check-readiness and pr monitor through the verdict.

Pre-Submission Checklist

  • I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
  • I have checked existing issues and pull requests to ensure this is not a duplicate.

Source: #3767

Alternatives check of 2026-11-16: none.
Tool: none found.

Proposed design

Problem statement

A repository with no pull-request workflow gives the head commit no check. devops pr check-readiness exits 1 and devops pr monitor waits until timeout because both read the pending stand-in no checks reported. The existing count_workflows test counts workflows on any branch and does not read the triggers. The fix SHALL read the workflows at the head commit and suppress the stand-in when no workflow can run on a pull request. It SHALL also stop pr monitor on a merge conflict before it waits on that stand-in.

Acceptance criteria

Requirement: No workflow at head suppresses pending check

When the head commit reports no check and holds no workflow file, the merge-readiness verdict SHALL NOT add a pending-check blocker.

Scenario: No workflow at head

  • WHEN A test calls assess_merge_readiness with a fake session that returns no check runs and a 404 for contents/.github/workflows at the head SHA.
  • THEN The test asserts that BlockerKind.CHECKS_PENDING is not in verdict.kinds and that an INFO advisory says the repository has no CI for the pull request.

Requirement: Pull-request workflow keeps pending check

When a workflow at the head commit lists pull_request or pull_request_target, the merge-readiness verdict SHALL keep the pending stand-in until a check starts.

Scenario: Pull-request workflow exists

  • WHEN A test gives the head commit one workflow file whose on key lists pull_request and gives no check runs.
  • THEN The test asserts that BlockerKind.CHECKS_PENDING is in verdict.kinds and that verdict.pending_checks contains no checks reported.

Requirement: Non-pull-request workflow suppresses pending check

When every workflow at the head commit lists only triggers other than pull_request and pull_request_target, the merge-readiness verdict SHALL NOT add a pending-check blocker.

Scenario: Workflow with push and workflow_dispatch only

  • WHEN A test gives the head commit one workflow file with only push and workflow_dispatch triggers and gives no check runs.
  • THEN The test asserts that BlockerKind.CHECKS_PENDING is not in verdict.kinds and that the no-CI advisory is present.

Requirement: Unread workflow fails closed

When the workflow read fails, the merge-readiness verdict MUST keep the pending stand-in.

Scenario: Workflow read error

  • WHEN A test makes the workflow contents read raise GitHubOperationError and gives no check runs.
  • THEN The test asserts that BlockerKind.CHECKS_PENDING is in verdict.kinds and that verdict.pending_checks contains no checks reported.

Requirement: check-readiness reports no CI

devops pr check-readiness SHALL exit 0 with a no-CI message when no workflow can run on the head commit and no other blocker applies.

Scenario: check-readiness on a repository with no CI

  • WHEN A test runs devops pr check-readiness with a fake GitHub session for a pull request whose head commit holds no workflow and no check.
  • THEN The test asserts exit code 0 and that the output contains the no-CI advisory.

Requirement: pr monitor does not wait for no CI

devops pr monitor SHALL stop without a timeout when no workflow can run on the head commit and no other blocker applies.

Scenario: pr monitor on a repository with no CI

  • WHEN A test runs devops pr monitor with a fake clock and a pull request whose head commit holds no workflow and no check.
  • THEN The test asserts exit code 0 and that the monitor made no sleep call.

Requirement: pr ready uses head workflow read

devops pr ready SHALL use the head-workflow read instead of GitHubClient.count_workflows to decide that no check can start.

Scenario: pr ready with a push-only workflow

  • WHEN A test runs devops pr ready for a pull request whose head commit holds a workflow with only push and workflow_dispatch triggers and no check.
  • THEN The test asserts that pr ready marks the draft ready and does not refuse with the no checks reported blocker.

Requirement: pr monitor stops on conflict before pending checks

devops pr monitor SHALL report a merge conflict and stop before it waits on the pending no-checks stand-in.

Scenario: Conflict with no checks

  • WHEN A test gives assess_merge_readiness a mergeable_state of dirty and no check runs, then runs devops pr monitor.
  • THEN The test asserts that the output names the merge conflict and that the monitor made no sleep call.

Existing Tool Considered

The alternatives check of 2026-11-16 found no open, maintained tool or library that covers this need. The change edits existing code in src/devops_cli/github/merge_readiness.py, src/devops_cli/github/check_verdict.py and src/devops_cli/commands/pr.py; it adds no dependency. Written cost: about 8,000 tokens and 1 engineer-day to build and test. Keep cost: no new component, only the existing test suite.

Key questions

  • Which function detects the pending stand-in for a commit that reports no check?: CheckVerdictSummary.reports_nothing returns true when the summary has no unread reason and its items equal [no_checks_reported()]. [sources: src/devops_cli/github/check_verdict.py]
  • How does the code decide that no CI can run on the head commit?: It lists .github/workflows at the head SHA and parses each YAML file's on key. It treats the commit as no-CI only when no file lists pull_request or pull_request_target. A 404 or an empty folder means no CI. A read error keeps the pending stand-in. (best practice) [sources: src/devops_cli/github/merge_readiness.py, src/devops_cli/github/check_verdict.py, src/devops_cli/github/client.py]
    • Rejected: Use GitHubClient.count_workflows. It counts workflows on any branch and ignores triggers, so it gives false positives for a workflow on another branch or a workflow with no pull-request trigger.
    • Rejected: Read workflow files at the head SHA only. A workflow file with only push or workflow_dispatch triggers cannot start a check on the pull request.
    • Chosen: Read workflow files at the head SHA and parse their triggers. It answers whether a check can start on the head commit and covers both the no-workflow and the wrong-trigger cases.
  • Where does the no-CI rule live so all three commands use it?: It lives in _judge_checks of assess_merge_readiness, so pr check-readiness, pr monitor and pr ready share one verdict. pr ready uses the same helper in place of its count_workflows branch. (best practice) [sources: src/devops_cli/github/merge_readiness.py:259, src/devops_cli/github/pr_monitor.py, src/devops_cli/commands/pr.py]
    • Rejected: Fix each command separately. Three copies drift, and fix(pr): pr create fits a repository without openspec #5142 already left pr monitor and check-readiness behind.
    • Chosen: Share the rule in the merge-readiness verdict. All three commands read the same verdict, and one test covers the shared decision.
  • What does the verdict report when no CI can run on the pull request?: It adds no CHECKS_PENDING blocker. It adds an INFO advisory that the repository has no CI for the pull request. The checks summary stays as read. (best practice) [sources: src/devops_cli/github/merge_readiness.py, src/devops_cli/github/check_verdict.py]
    • Rejected: Suppress the blocker with no message. A person must see why no check appears.
    • Rejected: Add a warning advisory. No action is needed, so a warning adds noise.
    • Chosen: Add an INFO advisory. It explains the missing check without blocking the pull request.
  • How does pr monitor handle a merge conflict when the head reports no check?: It reads the CONFLICT blocker before the pending checks and stops at once. It names the conflict and does not sleep for the pending stand-in. (best practice) [sources: src/devops_cli/github/merge_readiness.py, src/devops_cli/github/pr_monitor.py]
    • Rejected: Wait for checks. No check starts on a dirty pull request, so the monitor times out.
    • Chosen: Stop on conflict before pending checks. The conflict is the real blocker and the verdict already names it.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/bug
    scope/pr
    status/new
    value/medium
    effort/low
    on Nov 12, 2026
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    A second case of the same rule, in devops pr ready (2026-11-12).

    GitHubClient.count_workflows reads repos/<repo>/actions/workflows, which counts each workflow that ran on any branch. dan-petty/homelab PR #28 adds .github/workflows/lint.yml, and its run registered the workflow, so total_count became 1. main and the heads of PRs #26 and #27 hold no workflow file, so no check can start on them (commits/8717904/check-runs total_count 0). Then devops pr ready 26 --repo dan-petty/homelab refused: "Cannot mark PR #26 as ready for review: A check runs: no checks reported." I used --force for #26 and #27.

    Expected: the rule asks whether a workflow can run on the head commit, for example contents/.github/workflows?ref=<head sha> (a 404 or an empty folder means no CI for that pull request), not whether the repository registers a workflow. The fix of this issue for pr monitor and check-readiness can use the same read.

  6. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    A second case with the same symptom, in a repository that has CI: a pull request with a merge conflict.

    On 2026-11-13, pull request #5312 got a conflict when #5309 merged. GitHub gave mergeable_state: dirty and started no pull_request workflow, so the head commit had no check run. devops pr monitor 5312 showed the stand-in and waited until its timeout. It did not name the conflict:

    $ uv run devops pr monitor 5312 --interval 30 --timeout 90
    ℹ [0s] Checks: 0/1 passed (0/1 done)
     no checks reported  -         ● pending
    ✗ PR #5312 monitoring timed out after 90s: 1 check(s) pending: no checks reported.
    

    A run with the default 1800 s timeout waits 30 minutes for a check that cannot start. Expected: when the pull request is dirty (or mergeable is false) and the head reports no check, the monitor stops at once and names the conflict as the blocker. The CONFLICT verdict of #5021 covers this case too.

  7. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    devops pr ready has a related gap: a repository that has a workflow, but no workflow that runs on a pull request.

    On 2026-11-13, uv run devops pr ready 2 --repo retric-ai/retric.ai refused with "A check runs: no checks reported." The head commit had 0 check runs and 0 commit statuses. The repository has one workflow, .github/workflows/pages.yml, with only the push (branch main) and workflow_dispatch triggers. Thus count_workflows gives 1, and the #5142 rule does not apply. No check will start on this pull request.

    Expected: pr ready, pr check-readiness and pr monitor treat a repository with no workflow that triggers on pull_request or pull_request_target the same as a repository with no workflow.

    That pull request stays a draft until a person marks it ready.

  8. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: The issue is a bug fix in the project's own code (devops-cli): pr monitor and pr check-readiness must stop treating the absence of checks as a pending stand-in when a repository has no CI workflow. Searches for an external tool or library that handles PR readiness for repositories with no CI found no applicable product; this is internal logic the project implements itself in its merge-readiness and check-verdict modules.

    Tool: none found

    Searches run:

    • github merge readiness "no workflow" "check runs" python library tool, results: 5
    • github PR monitor "no CI" "no checks reported" check readiness workaround library, results: 5
    • "devops pr monitor" OR "pr check-readiness" github actions no CI "no checks" fix, results: 5
    • github pull request readiness checker handle repository without CI workflows, results: 5

    Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.

  9. added
    status/ready
    and removed
    status/new
    on Nov 17, 2026
  10. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at c58b592 (see proposed design in issue body).

  11. added
    status/in-review
    and removed
    status/ready
    on Nov 17, 2026
  12. removed
    status/in-review
    on Nov 17, 2026
  13. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-17 15:42 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/prsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions