Repository navigation
Description
Problem
devops pr ready refuses a pull request in a repository whose workflows never run on a pull request. On 2026-11-13, uv run devops pr ready 2 --repo retric-ai/retric.ai said "Cannot mark PR #2 as ready for review: A check runs: no checks reported." The repository has one workflow, pages.yml, which runs only on a push to main and on workflow_dispatch, so no check will ever come for the pull request.
Cause
_no_ci in src/devops_cli/commands/pr.py (#3767) treats a pull request as one with no CI only when its head reports nothing and the repository has no GitHub Actions workflow at all (count_workflows(repo) == 0). A repository with workflows that do not trigger on pull_request (or pull_request_target) gets the wait answer for ever.
Proposed fix
Count only the workflows whose on: holds pull_request or pull_request_target for the base branch (read the workflow files at the base, or use the workflow runs of the head after a short wait). With none, mark the pull request ready and print the no-CI line.
Acceptance criteria
- A test with a repository whose only workflow runs on
pushgives the no-CI answer for a head with no checks. It fails onmain(devops ci fail-to-pass). - A repository with a
pull_requestworkflow and a head with no checks yet still waits.
Existing tool considered
The GitHub workflows API and the workflow files. No new tool. Cost: about 80,000 tokens, 1 hour elapsed.
Alternatives check of 2026-11-22: partly.
Tool: wcmatch (https://pypi.org/project/wcmatch), MIT, last activity 2026-11-20, maintained.
Reason: Searches found no tool that decides whether a pull request's workflows can start a check; the glob library wcmatch covers only matching changed files against the paths, paths-ignore and branches filters.
Covers:
- Glob matching with
**,?, brace and!patterns Gitignore-style mode forpathsandpaths-ignorelists Match each changed file against a filter list, no home-grown matcher
Lacks:
- Reads no workflow YAML, so no
on:trigger decision Fetches no changed-file list from the pull request API Says nothing about pending versus failing checks; GitHub filter semantics need checking
Proposed design
Problem statement
The issue reported that devops pr ready waits for ever when a repository has GitHub Actions workflows but none of them runs on a pull request: _no_ci asked whether the repository had any workflow, not whether a workflow could start a check on the pull request. At this commit the behavior is already fixed by #5144: the merge-readiness verdict reads the workflows at the head commit, counts pull_request and pull_request_target, and sets no_ci, so a push-only repository gets the no-CI line while a pull_request workflow still waits. What remains is to pin the pull_request_target trigger with a test, which no test covers, and to correct the devops pr ready help text and generated docs, which still state the old repository-wide rule.
Acceptance criteria
Requirement: Push-only repository is no CI
devops pr ready SHALL print the no-CI line and mark the pull request ready when the head commit reports no check and no workflow at that commit lists pull_request or pull_request_target.
Scenario: Only a push workflow
- WHEN
uv run devops ci test tests/commands/test_pr.py -k test_pr_ready_marks_a_pull_request_ready_when_only_push_workflows_existruns the push-only fixture, whose head commit reports no check. - THEN The test passes:
pr readyexits 0, prints the no-CI line, and marks the pull request ready.
Requirement: Pull request workflow waits
devops pr ready SHALL exit 8 and mark nothing when the head commit reports no check and a workflow at that commit lists pull_request.
Scenario: Checks not started
- WHEN
uv run devops ci test tests/commands/test_pr.py -k test_pr_ready_exits_on_the_checks_of_the_verdictruns thechecks-not-startedscenario, whose head holds apull_requestworkflow and reports no check. - THEN The test asserts exit 8 and that the pull request stays a draft.
Requirement: Pull request target workflow waits
The merge-readiness verdict SHALL count a workflow that lists pull_request_target as one that can start a check, so devops pr ready SHALL wait when the head commit reports no check.
Scenario: Target trigger with no checks
- WHEN
uv run devops ci test tests/github/test_merge_readiness.py -k pull_request_targetruns a fixture whose only workflow listspull_request_targetand whose head commit reports no check. - THEN The test asserts that the verdict holds a pending-check blocker and that
no_ciis false.
Requirement: pr ready help text states the pull-request rule
The devops pr ready help text and the generated command docs MUST say that the wait ends when no workflow at the head commit runs on a pull request, not when the repository has no GitHub Actions workflow.
Scenario: The generated docs match the help text
- WHEN The docstring is updated and
uv run devops docs generateruns. - THEN
uv run devops ci --check --only docspasses.
Requirement: The MCP tool listing holds the new description
The MCP tool listing snapshot MUST hold the revised pr_ready description.
Scenario: The tool listing matches the snapshot
- WHEN
uv run pytest tests/ai/mcp/test_mcp_tool_listing.py --snapshot-updateruns after the docstring change. - THEN
uv run devops ci test tests/ai/mcp/test_mcp_tool_listing.pypasses.
Existing Tool Considered
No open, maintained tool or library covers this need: the alternatives check of 2026-11-17 (issue body) recorded verdict none and tool none found after five searches, and no searched tool decides whether a repository has a workflow triggered by pull_request/pull_request_target. The project keeps its own parser, _runs_on_pull_request at src/devops_cli/github/client.py:408, which reads the on: key with PyYAML, already a project dependency; the #5144 proposal (openspec/changes/archive/2026-11-17-5144-pr-monitor-fits-a-repository-with/proposal.md:42) records about 8,000 tokens and one engineer-day to build and test it, and keeping it costs nothing beyond that dependency. The residual work in this proposal — one pull_request_target test, the pr ready docstring, the regenerated docs and the MCP snapshot — costs about 2,000 tokens and half an hour.
Key questions
- Which workflow events count as a pull request trigger?:
pull_requestandpull_request_targetcount, because both start a workflow run on pull request activity;push,workflow_dispatchand every other event do not. The project records the pair in thepr-merge-readinessspec and in_PULL_REQUEST_TRIGGERS, and GitHub's events reference lists both events. (best practice) [sources: openspec/specs/pr-merge-readiness/spec.md:131, src/devops_cli/github/client.py:47, https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows]- Chosen: Both pull request events. Both start a check for pull request activity; the spec and
_PULL_REQUEST_TRIGGERSrecord the pair, and GitHub's events reference lists both. - Rejected: Only
pull_request. It missespull_request_target, which also starts a check on a pull request. - Rejected: Any workflow event. It repeats the defect for push-only and manual workflows.
- Chosen: Both pull request events. Both start a check for pull request activity; the spec and
- At which ref should the workflow triggers be read?: At the head commit of the pull request, which is what the merge-readiness verdict already does and what the
pr-merge-readinessspec records;GitHubClient.pull_request_workflow_atlists.github/workflowsat that ref. Reading the base branch instead would miss apull_requestworkflow that the head adds and GitHub runs, so the issue's suggestion to read at the base is not taken. (best practice) [sources: openspec/specs/pr-merge-readiness/spec.md:129, src/devops_cli/github/merge_readiness.py:263, src/devops_cli/github/client.py:718]- Chosen: Read the head commit. The recorded decision and the existing code read the workflows at the head commit, which is the tree a
pull_requestworkflow runs from. - Rejected: Read the base branch. It contradicts the spec and misses a workflow the head adds, which GitHub runs on
pull_request. - Rejected: Wait for workflow runs. It adds latency and cannot tell a slow workflow from no workflow.
- Chosen: Read the head commit. The recorded decision and the existing code read the workflows at the head commit, which is the tree a
- Is the reported defect already fixed at this commit?: Yes.
_no_ciatsrc/devops_cli/commands/pr.py:1441readsverdict.no_ci;_judge_checkssets it when the head reports no check and_can_run_on_pull_requestfinds no qualifying workflow; and the command-level tests already cover the push-only case (tests/commands/test_pr.py:589) and the waitingpull_requestcase (tests/commands/test_pr.py:532). No behavior change is left, and the issue's 'fails onmain' criterion cannot hold: the test passes onmain. [sources: src/devops_cli/commands/pr.py:1441, src/devops_cli/github/merge_readiness.py:316, src/devops_cli/github/client.py:718, tests/commands/test_pr.py:589, tests/commands/test_pr.py:532] - Does any test cover the
pull_request_targettrigger?: No._PULL_REQUEST_TRIGGERSholds both events, but the trigger tests exercise onlypull_requestandpush, so a test that namespull_request_targetis the one piece of the trigger decision that no test pins. [sources: src/devops_cli/github/client.py:47, tests/github/test_merge_readiness.py:551, tests/github/test_merge_readiness.py:578] - Does the
pr readyhelp text still describe the old rule?: Yes. The docstring atsrc/devops_cli/commands/pr.py:1533and the generateddocs/commands/pr.md:264say the wait ends when the repository has no GitHub Actions workflow, which is the rule fix(pr): pr monitor fits a repository with no CI #5144 replaced; the MCP tool listing snapshot repeats the same text. The docstring, the generated docs and the snapshot need the new rule. [sources: src/devops_cli/commands/pr.py:1533, docs/commands/pr.md:264, tests/ai/mcp/snapshots/test_mcp_tool_listing/test_the_tool_listing_matches_the_snapshot.json:3998] - What title must the residual pull request take?: A non-
fixtitle such astest(pr): pin the pull_request_target trigger(ordocs(pr): ...if the work is split), because the fail-to-pass job runs only for afix(/fix:/fix!title and replays changed tests against the base; a newpull_request_targettest passes on base since the behavior landed in fix(pr): pr monitor fits a repository with no CI #5144, so afixtitle would fail that gate. (best practice) [sources: .github/workflows/fail-to-pass.yml:8, .github/workflows/fail-to-pass.yml:46, .agents/skills/devops-pr-ci/SKILL.md:13]- Chosen:
test(pr): .... The fail-to-pass job runs only for a fix title, so a test-only pull request is not replayed against base. - Rejected:
fix(pr): ...withFail-to-pass: not applicable. No defect remains to replay; the not-applicable line is for a fix whose replay cannot run, not for a fix that is already on main. - Rejected: Split into
test(pr):anddocs(pr):issues. One pull request can carry the test, the docstring, the generated docs and the snapshot.
- Chosen:
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
Both fix no-CI detection for PR commands, but #5144 covers repos with zero workflows while the candidate covers repos whose workflows never trigger on pull_request.devops-cli-service commentedon Nov 17, 2026
Alternatives check: none
Reason: Searches for a tool that decides whether a repository has a workflow triggered by
pull_request/pull_request_targetreturned only unrelated pages, and no open tool or library answers that question. The need is an internal change to the project's own_no_cicheck insrc/devops_cli/commands/pr.py, which the issue itself plans to make through the GitHub workflows API and workflow files with no new tool.Tool: none found
Lacks:
on:holdspull_requestorpull_request_targetfor the base branch_no_ciwait logic indevops pr readyTools considered:
Searches run:
Sources:
Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 2620fae (see proposed design in issue body).
dan-petty commentedon Nov 18, 2026
Evidence 2026-11-18: a case that #5144 does not cover. The proposed design above says that #5144 already fixed this item. It fixed only a repository with no
pull_requestworkflow.README.md. Both workflows run onpull_request, but withpathsfilters that leaveREADME.mdout (k8s.yml:k8s/**and two script paths;lint.yml:**/*.yaml,**/*.yml,ansible/**and more). No check starts for this pull request.devops pr readysaid "A check runs: no checks reported." and needed--force.pull_request_workflow_atinsrc/devops_cli/github/client.py:718reads only the trigger names. A workflow withpull_requestcounts as one that can start a check, also when itspaths,paths-ignoreorbranchesfilter leaves the pull request out._judge_checksinsrc/devops_cli/github/merge_readiness.py:323then keeps the pending stand-in.Two ways to close the gap:
GET /repos/{owner}/{repo}/pulls/{n}/files) against thepathsandpaths-ignorefilters of eachpull_requestworkflow, and the base branch againstbranchesandbranches-ignore. The filters use the GitHub glob syntax (*,**,?,!). Use an open glob library for it; do not write a new matcher.pathspecis a dependency already, but its gitignore rules differ from the GitHub rules (a pattern with no slash matches at each depth), so check it against the GitHub filter examples or usewcmatchglobmatchwithGLOBSTAR.GET /repos/{owner}/{repo}/rules/branches/{branch}). A pull request with no required check and no reported check has no check that applies.The message should tell "no check applies to this pull request" apart from "checks pending" and "checks failing".
Added criterion: a test with a
pull_requestworkflow that haspaths: [k8s/**]and a pull request that changes onlyREADME.mdgives the no-CI answer. A pull request that changesk8s/app.yamlstill waits.dan-petty commentedon Nov 22, 2026
Another case for this item, found on 2026-11-22: dan-petty/homelab PR #97 changes only
.github/renovate.json. Both workflows of homelab listpull_request, but theirpathsfilters skip that file, so the head commit gets no check run, anddevops pr readywaits and then refuses. The rule of the refined design ("no workflow at that commit lists pull_request") does not cover it: a workflow lists the event, but its path filter skips the change. The rule needs to read thepathsandpaths-ignorefilters too (or the workflow runs that GitHub records for the head commit).dan-petty commentedon Nov 22, 2026
New case on 2026-11-22: dan-petty/homelab#97 changes only
.github/renovate.jsonandREADME.md. Both workflows of homelab run onpull_request, but withpathsfilters (k8s.yml:k8s/**and others;lint.yml:**/*.yaml,**/*.yml,ansible/**and others) that match neither file. So no check starts on the head commit (0 check runs), anddevops pr ready 97 --repo dan-petty/homelabwaits for ever ("Pass --force to override failing check verification."). The trigger check of #6173 (_runs_on_pull_requestinsrc/devops_cli/github/client.py) reads the trigger type, notpaths,paths-ignoreorbranches. The fix must also match the filters of each workflow against the changed files of the pull request, as GitHub matches them (glob with**, the first-match rules ofpathswith!), with a library such as wcmatch, not a home-grown matcher.3 remaining items
test(pr): make the in-segment globstar branch case depend on the guard (
docs(openspec): plan the workflow filters of pr ready (#5408)
fix(pr): judge the branch and path filters of pull request workflows (#…
docs(pr): state the workflow filter rule of pr ready (#5408)
docs(openspec): archive the workflow filters change of pr ready (#5408)
test(pr): make the in-segment globstar branch case depend on the guard (
chore(main): release 0.195.4 (#6808)
devops-cli-service commentedon Nov 22, 2026
Released in v0.195.4: https://github.com/dan-petty/devops-cli/releases/tag/v0.195.4
devops-cli-service commentedon Nov 22, 2026
Live since 2026-11-22 23:15 UTC