feat(reviews): filter PRs by required checks instead of all checks#1023
feat(reviews): filter PRs by required checks instead of all checks#1023
Conversation
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🔴 👀 Review RequirementsThis rule is failing.
🔴 🔎 ReviewsThis rule is failing.
🟢 ⛓️ Depends-On RequirementsWonderful, this rule succeeded.Requirement based on the presence of
🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
There was a problem hiding this comment.
Pull request overview
Adds a client-side required-checks filter to the reviews CLI so PRs are excluded only when a required check fails (instead of hiding PRs due to any failing/non-required check), replacing the previously removed status:success server-side behavior.
Changes:
- Extend the pending reviews GraphQL search query to include PR node IDs.
- Add a second GraphQL request that inspects required checks (
isRequired()) and filters out PRs with failing required checks. - Update and expand CLI tests to cover required vs non-required failing checks and to account for the additional GraphQL call.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
mergify_cli/reviews/api.py |
Adds required-checks GraphQL query + filtering logic based on required check failures. |
mergify_cli/tests/reviews/test_cli.py |
Updates mocks for the new two-GraphQL-call flow and adds new regression tests for required/non-required check behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The status:success filter excludes PRs where any check has a non-success state, including non-required checks like Mergify dequeue notifications. This causes valid PRs to disappear from the review list. Remove the server-side status filter entirely; required checks filtering will be added client-side via GraphQL in the next commit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Change-Id: Ief6ce540a050308cc8c893e8fdfecc77adff15bb Claude-Session-Id: d5572357-9198-403e-83f3-1c3d4cb73a99
Replace the removed status:success server-side filter with a client-side GraphQL query that checks only required status checks. This uses a second GraphQL call with isRequired() to distinguish required from non-required checks, so PRs are only hidden when a required check fails. Non-required check failures (e.g. Mergify dequeue notifications) no longer cause PRs to disappear from the review list. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Change-Id: Ie50d3888eb63c3f97907a997578a9a659dfe4ee2 Claude-Session-Id: d5572357-9198-403e-83f3-1c3d4cb73a99
c255b6e to
d182475
Compare
0c84678 to
00a7f99
Compare
🧪 CI InsightsHere's what we observed from your CI run for 00a7f99. 🟢 All jobs passed!But CI Insights is watching 👀 |
Replace the removed status:success server-side filter with a client-side
GraphQL query that checks only required status checks. This uses a
second GraphQL call with isRequired() to distinguish required from
non-required checks, so PRs are only hidden when a required check fails.
Non-required check failures (e.g. Mergify dequeue notifications) no
longer cause PRs to disappear from the review list.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Depends-On: #1022