Skip to content

fix: report no_ci instead of pending forever for PRs without CI - #17

Merged
devblac merged 2 commits into
mainfrom
feat/no-ci-state
Oct 25, 2026
Merged

devblac merged 2 commits into
mainfrom
feat/no-ci-state

Conversation

@devblac

@devblac devblac commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Stacked PR — base is #16's branch, so this diff shows only this change.

Description

A PR with no checks or statuses at all was reported as pending forever, so prw wait and the MCP wait_for_ci tool blocked until their timeout on repositories without CI, or on stacked PRs whose base branch runs none. Found while testing #16: 14 of 18 of my real open PRs were in this state.

The rule

Zero checks is also what every PR looks like right after a push, while CI registers. So a PR becomes no_ci only when it has no checks or statuses and its updated_at (bumped by every push) is at least 3 minutes old. A comment or label also bumps updated_at, which only delays the conclusion, never makes it early. An unknown/zero updated_at keeps pending.

Changes

  • github: PullRequest.UpdatedAt, StateNoCI, NoCIGracePeriod (3m), ApplyNoCI, used by run, wait and broadcast.
  • prw wait: new exit code 4 for no_ci — deliberately not 0, so prw wait && deploy doesn't deploy a PR no CI looked at.
  • prw run: no notification on a transition into no_ci (it's not a CI result; it would ping once per such PR); normal notification if CI appears later (e.g. after a retarget).
  • MCP: summary text, tool descriptions and instructions mention no_ci so agents stop waiting.
  • Webhooks/console: ⚪ and a grey Discord color for no_ci (only reachable via broadcast).

Testing

  • Unit: the grace-period table (boundaries, unknown time, running checks, terminal states), the real API's empty shape, watcher no-notify / later-notify, wait stopping on no_ci vs waiting through a fresh push, exit code 4 through the command.
  • Live: run --once over my 15 open PRs → 11 no_ci, 2 failure, 2 success, 0 notifications. prw wait on fix: safe concurrent config writes, isolated tests, auto-drop merged/closed PRs #9 (no CI) returns in 2s with exit 4 instead of waiting 30 minutes.

Checklist

  • Tests added or updated
  • go test -race ./... passes
  • go vet ./... passes
  • Documentation updated (README / CHANGELOG / TASKS)
  • Commit messages are clear

🤖 Generated with Claude Code

devblac and others added 2 commits October 17, 2026 19:01
Copying PR URLs into `prw watch` one by one was the main friction in
day-to-day use. `prw watch --mine` and `prw watch --review-requested`
subscribe to a GitHub search (author:@me / review-requested:@me, open,
non-archived) instead of a fixed list:

- Matches are added right away and tagged with their source;
  `prw run` (and `run --once`) re-runs the searches every 5 minutes,
  picking up subscriptions enabled while it is running.
- Review-request PRs are dropped when the request goes away; "mine"
  PRs are left for `prw run` to notify about and drop when merged or
  closed. Incomplete or failed searches never remove anything.
- PRs watched by hand are never touched; watching an auto-added PR by
  hand claims it. `prw unwatch --mine` disables the source and removes
  only the PRs it added.
- `prw list` shows auto-watch and an ADDED BY column (`source` in
  --json); `prw config show` shows auto_watch.

Also compare owner/repo case-insensitively, as GitHub does, so search
results can't duplicate PRs watched with different casing.

Verified live: 18 open PRs across 7 repos found and CI-checked, then
cleanly removed by `unwatch --mine`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A PR with no checks or statuses at all was reported as "pending"
indefinitely, so `prw wait` and the MCP wait_for_ci tool blocked until
their timeout on repositories without CI or on stacked PRs whose base
branch runs none (14 of 18 real PRs in testing).

Zero checks is also what every PR looks like right after a push, so a
PR is only reported as no_ci once it has had no checks or statuses
and hasn't been updated (PR updated_at, which every push bumps) for 3
minutes; a zero/unknown updated_at keeps it pending.

- github: PullRequest.UpdatedAt, StateNoCI, ApplyNoCI, applied by
  run, wait and broadcast.
- prw wait exits 4 for no_ci (not 0: `prw wait && deploy` must not
  deploy unverified PRs); MCP summaries and tool descriptions cover it.
- prw run doesn't notify on a transition into no_ci, and notifies
  normally if CI shows up later.

Verified live: 11 real PRs moved from pending to no_ci; `prw wait` on
one returns in 2s with exit 4 instead of waiting 30 minutes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devblac
devblac marked this pull request as ready for review October 18, 2026 05:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T05:17:34.612927Z 3880378 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3880378d90

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +229 to +230
if previousState != "" && previousState != currentState && currentState != github.StateNoCI &&
shouldNotify(w.config.NotificationFilter, currentState) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep no-CI state through metadata-only updates

When a watched PR is already no_ci, any comment, label change, or other metadata update refreshes updated_at; ApplyNoCI then temporarily returns pending with zero checks. With the default change filter, this condition emits a misleading no_ci → pending notification and stores pending, even though no CI has appeared; three minutes later it silently returns to no_ci. Preserve no_ci while the grace-period result still has zero checks, so a notification occurs only when an actual status or check run appears.

Useful? React with 👍 / 👎.

@devblac
devblac changed the base branch from feat/auto-watch to main October 25, 2026 00:16
@devblac
devblac merged commit b8a9a56 into main Oct 25, 2026
@devblac
devblac deleted the feat/no-ci-state branch October 25, 2026 00:16
devblac added a commit that referenced this pull request Oct 25, 2026
fix: address Codex review feedback (#6, #7, #13–#17)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant