Skip to content

Hold a watch's "checks passed" until every required check has reported - #962

Merged
Tryanks merged 1 commit into
mainfrom
watch-missing-required-checks
Oct 24, 2026
Merged

Tryanks merged 1 commit into
mainfrom
watch-missing-required-checks

Conversation

@Tryanks

@Tryanks Tryanks commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Summary

Since #941, the required checks Linux x64 / macOS arm64 / Windows x64 are jobs gated on needs, and GitHub creates them only once their dependencies finish. On #953's head, from 16:59 to 17:04 every required check reported so far had passed while macOS arm64 and Windows x64 did not exist yet. The watch judged "required checks all passed" from the checks it could see, so it woke the agent in the middle of the run (and again as each late check appeared).

 detail (GitHub, github.com)
   read PR + check rollup            # + baseRef.rules (rulesets), same query
+  if checks_pass(checks)            # core's gate, now shared with evaluate
+    GET /repos/{o}/{r}/branches/{base}   # branch protection: readers may see it over REST; GraphQL shows it to admins only
+    add each required context not yet reported as Pending, required
 evaluate                            # unchanged rule: gate never passes while one is pending

The required set is read only when the checks seen would pass, because it can only hold that verdict back. A 403 or 404 on the branch read leaves the protected checks unknown, which is the behaviour before this change. GitHub Enterprise Server has no isRequired, so it is left as it was.

Evidence

  • New checks_pass_only_once_every_check_main_requires_has_reported (runtime, via the real sweep and HTTP fixture): Web has passed while Linux x64 (branch protection) and macOS arm64 (ruleset) have not reported → no wake. Linux x64 arrives → still no wake. macOS arm64 arrives → one wake, All 3 required checks passed.
    • Before (new read disabled): fails at the first pass with Linux x64, which the branch protection requires, has not reported.
    • After: passes.
  • The other 21 watch tests pass unchanged, including the request-count ones: a read whose checks don't pass makes no extra request.
  • cargo fmt --check, cargo clippy --workspace --all-targets --locked -D warnings, cargo nextest run --workspace --locked: 1284 passed (macOS).
  • Live against github.com: the new detail document (with baseRef.rules) runs against Embed the preview browser on iOS; require macOS 27, iOS 27 and Windows 11 #953, and branches/{base} with a %2F-encoded dependabot/... branch resolves. As a non-admin, branches/{base} shows cli/cli's and microsoft/vscode's required contexts while GraphQL branchProtectionRule is null.

Merge Danger

Door: two-way

Blast Radius: PR watch

On github.com, each detail read whose checks would pass costs one more REST request. A required check that never reports on a PR (for example, a path-filtered workflow) now holds back the "passed" wake, which matches GitHub keeping the merge blocked.

GitHub creates a job that waits on others only once they finish. Since #941
CI's required platform checks are such jobs, so for minutes at a time the
head showed every required check reported so far as passed while macOS arm64
and Windows x64 did not exist yet, and the watch woke the agent mid-run.

When the checks read would pass, the GitHub detail read now adds the checks
the base branch requires but that have not reported, as pending: those of its
rulesets come with the GraphQL detail, those of its branch protection from
REST, which any reader may see (GraphQL shows them to admins alone). Core
owns the gate both use.
@Tryanks
Tryanks merged commit b8f329c into main Oct 24, 2026
13 checks passed
@Tryanks
Tryanks deleted the watch-missing-required-checks branch October 24, 2026 19:41
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