fix(pstack): accept PRs without checks - #316
Open
liush2yuxjtu wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 877e9c1. Configure here.
| return { | ||
| source: fast.kind === "checks" ? "gh-pr-checks" : "graphql-rollup", | ||
| checks: [], | ||
| }; |
There was a problem hiding this comment.
Empty checks can mark CI ready
High Severity · Logic Bug
resolveChecks now treats a currently empty fast path plus empty rollup as a settled check set. GitHub reports that same empty pair after a new HEAD is pushed, before check runs exist. readSnapshot then marks CI ci-clean, so drive mode can emit terminal READY and stop before workflows start.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 877e9c1. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Why
watch-pr --status-onlyretries forever when a mergeable pull request has no configured checks.gh pr checksreports that no checks exist, and the GraphQL rollup is empty, butresolveCheckstreats every empty result as a query failure.Scope
CheckRead.checksandCiBase.allrepresent a valid empty check set.ghreturns its exact no-checks message, and the GraphQL rollup is also empty.Tradeoffs
The no-checks detection depends on the current
ghstderr message. Ifghchanges that text, the watcher fails closed and reports a query blocker instead of treating an error as clean CI.Blast Radius
The change affects PRs with zero checks. PRs with passing, pending, failed, or hidden GitHub rollups keep the existing paths. No plugin prompt or workflow text changes.
Verification
Before the fix, three focused tests failed with
ChecksUnavailable.After the fix:
bun test watch-prpassed 42 tests.bun run typecheckpassed.watch-pr --status-onlyrun againstliush2yuxjtu/pi-debug-mode#2returned a status table instead ofRETRYbefore a later GitHub API TLS timeout made the external check unavailable.git diff --checkpassed.Note
Medium Risk
Changes check-resolution semantics for zero-check PRs and relies on matching
gh’s no-checks stderr; wrong matching could misclassify errors as clean CI or vice versa.Overview
Fixes
watch-prtreating “no CI checks on this PR” asChecksUnavailable, which caused endlessRETRYon mergeable PRs with zero configured checks.resolveChecksnow returns an empty check list when the GraphQL rollup is empty and the fast path confirms no checks—either valid emptygh pr checksJSON or exit code 1 with GitHub’sno checks reported on the … branchstderr. Unrelated exit-1 errors (e.g. integration access) still fail closed.CheckRead.checksandCiBase.allare typed asreadonly Check[]instead ofNonEmpty, so an empty set is valid. Policy snapshots can classify those PRs asci-cleaninstead of erroring.Tests cover dual-confirmed empty results, unrelated fast-path failures, and
ci-cleanclassification.Reviewed by Cursor Bugbot for commit 877e9c1. Bugbot is set up for automated code reviews on this repo. Configure here.