Switch critical-review gate to a scheduled poller - #6201
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The poll leaves a merge window and incorrectly treats resolved review threads as active critical findings.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Replaces the ineffective event-driven critical-review gate with scheduled polling.
Changes:
- Adds a ten-minute poller that drafts flagged PRs.
- Supports override labels and manual execution.
- Removes the two-stage detect/enforce workflows.
File summaries
| File | Description |
|---|---|
.github/workflows/critical-gate-poll.yml |
Adds scheduled critical-review enforcement. |
.github/workflows/critical-gate-detect.yml |
Removes event-based detection. |
.github/workflows/critical-gate-enforce.yml |
Removes artifact-based enforcement. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
The poller can draft PRs based on historical findings or unrelated reviewers whose login contains “copilot”.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
The poll is not fail-closed and can evaluate reviews from an earlier head commit.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
.github/workflows/critical-gate-poll.yml:15
- [CRITICAL] A ten-minute poll only reacts after the PR has remained mergeable for up to a full interval (and scheduled jobs may be delayed), so this still permits the #6177/#5868 failure mode. Set a required pending check for each new head SHA from a trusted PR workflow and let this poller clear or fail that check; draft conversion can remain as the follow-up UX.
schedule:
- cron: "*/10 * * * *"
workflow_dispatch: {}
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Review-body findings and criticals older than 30 minutes can bypass enforcement.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Balanced
| nodes{ isResolved isOutdated | ||
| comments(first:1){ nodes{ author{login} body pullRequestReview{ submittedAt } } } } | ||
| } } } }`; |
| const at = c.pullRequestReview && c.pullRequestReview.submittedAt; | ||
| if (at && (now - new Date(at).getTime()) <= WINDOW_MS) return true; |
What does this implement/fix?
Replaces the critical-review gate's two event-driven workflows (
critical-gate-detect.yml+critical-gate-enforce.yml) with a single scheduled poller (critical-gate-poll.yml). The event design never fired: GitHub holds workflow runs triggered by the Copilot bot (submitting a review) for manual approval — they sit ataction_requiredand never run — so PRs with[CRITICAL]findings slipped through un-drafted (e.g. #6177, #5868). A scheduled run executes as a trusted actor with a write token, which also removes the fork read-only-token andworkflow_runartifact-trust workarounds. Every ~10 min it scans open non-draft PRs (basedev/stable) and converts to a draft any whose latest Copilot review still has an unresolved[CRITICAL]on the current head, with one explanatory comment. Theoverride-criticallabel bypasses it;workflow_dispatchallows a manual run.Related issue (if applicable):
Types of changes
bugfixnew-featureenhancementnew-providerbreaking-changerefactordocumentationmaintenancecidependenciesChecklist
pre-commit run --all-filespasses.pytestpasses, and tests have been added/updated undertests/where applicable.music-assistant/modelsis linked.music-assistant/frontendis linked.