Skip to content

Respect required CI checks#10

Open
lukelabonte wants to merge 5 commits into
SeanMcTex:mainfrom
lukelabonte:required-ci-status
Open

Respect required CI checks#10
lukelabonte wants to merge 5 commits into
SeanMcTex:mainfrom
lukelabonte:required-ci-status

Conversation

@lukelabonte
Copy link
Copy Markdown

@lukelabonte lukelabonte commented May 8, 2026

Summary

This updates MonitorLizard so the main PR status is based on the checks GitHub actually treats as required.

Before this, optional checks could make a PR look blocked even when GitHub would allow it to merge. That was noisy for repos that use approval-gated CircleCI workflows. Now required checks drive the main status, and approval-gated non-blocking checks show up on a separate line.

What changed

  • Fetch required check metadata from GitHub's GraphQL API.
  • Treat missing required contexts as pending, so a required check that hasn't reported yet doesn't look green.
  • Keep non-required checks out of the main merge-blocking status.
  • Show approval-gated non-blocking checks as a small secondary row, like Non-blocking: 1 waiting for approval.
  • Keep non-blocking failures out of the failing-check expansion, but still show other failed checks.
  • Added tests for required-check handling, missing required contexts, and the non-blocking summary.

Screenshots

example-1 example-2 CleanShot 2026-05-11 at 13 32 16

Verification

  • xcodebuild -project "MonitorLizard/MonitorLizard.xcodeproj" -scheme "MonitorLizard" -configuration Debug CODE_SIGNING_ALLOWED=NO build
  • git diff --check

I also tried a focused test run for the GitHub service tests. The test bundle still fails to compile because of existing Swift 6 actor-isolation errors in PRMonitorViewModelTests.swift, so those tests don't get far enough to run yet.

Show approval-gated non-blocking checks separately while keeping merge status based on required GitHub checks.
@SeanMcTex SeanMcTex self-requested a review May 11, 2026 15:10
Copy link
Copy Markdown
Owner

@SeanMcTex SeanMcTex left a comment

Choose a reason for hiding this comment

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

Thanks a bunch for the submission! Would definitely like to avoid CircleCI-specific code if at all possible, since not everyone uses it. I'd be glad for your thoughts.

Comment thread MonitorLizard/Services/GitHubService.swift
Comment thread MonitorLizard/Services/GitHubService.swift Outdated
Use statusCheckRollup.state when required metadata and individual checks are unavailable, including EXPECTED as pending. Expand required-CI and parameterized test coverage around the fallback paths.
Treat not-started required CI as needing attention and avoid counting waiting approval parent checks as active CI work.
@lukelabonte
Copy link
Copy Markdown
Author

I pushed another pass based on the review.

What changed:

  • Removed the CircleCI-specific matching.
  • Switched required CI detection to GitHub's own metadata (isRequired, with branch protection contexts as a fallback).
  • Kept the main PR status focused on merge-blocking CI.
  • Moved optional checks into the separate Non-blocking: summary.
  • Added Not started for required CI that hasn't kicked off yet.
  • Added fallback handling for rollup-only GitHub states, including EXPECTED as pending.
  • Reused the same GraphQL status parsing path for batch fetches, single PR status fetches, and Other PRs.
  • Fixed a couple of follow-up edge cases around .notStarted and waiting approval parent checks.

@lukelabonte lukelabonte requested a review from SeanMcTex May 11, 2026 20:05
@SeanMcTex SeanMcTex mentioned this pull request May 11, 2026
4 tasks
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.

2 participants