Skip to content

Switch critical-review gate to a scheduled poller - #6201

Merged
chrisuthe merged 6 commits into
devfrom
critical-gate-poller
Sep 4, 2026
Merged

Switch critical-review gate to a scheduled poller#6201
chrisuthe merged 6 commits into
devfrom
critical-gate-poller

Conversation

@chrisuthe

Copy link
Copy Markdown
Member

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 at action_required and 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 and workflow_run artifact-trust workarounds. Every ~10 min it scans open non-draft PRs (base dev/stable) and converts to a draft any whose latest Copilot review still has an unresolved [CRITICAL] on the current head, with one explanatory comment. The override-critical label bypasses it; workflow_dispatch allows a manual run.

Related issue (if applicable):

  • n/a

Types of changes

  • Bugfix (non-breaking change which fixes an issue) — bugfix
  • New feature (non-breaking change which adds functionality) — new-feature
  • Enhancement to an existing feature — enhancement
  • New music/player/metadata/plugin provider — new-provider
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) — breaking-change
  • Refactor (no behaviour change) — refactor
  • Documentation only — documentation
  • Maintenance / chore — maintenance
  • CI / workflow change — ci
  • Dependencies bump — dependencies

Checklist

  • The code change is tested and works locally.
  • pre-commit run --all-files passes.
  • pytest passes, and tests have been added/updated under tests/ where applicable.
  • For changes to shared models, the companion PR in music-assistant/models is linked.
  • For changes affecting the UI, the companion PR in music-assistant/frontend is linked.
  • I have read and complied with the project's AI Policy for any AI-assisted contributions.
  • I have raised a PR against the documentation repository targeting the main or beta branch as appropriate.

Copilot AI balanced review requested due to automatic review settings September 4, 2026 15:05
@github-actions github-actions Bot added the ci label Sep 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.

Comment thread .github/workflows/critical-gate-poll.yml
Comment thread .github/workflows/critical-gate-poll.yml Outdated
Comment thread .github/workflows/critical-gate-poll.yml Outdated
Copilot AI review requested due to automatic review settings September 4, 2026 15:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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

Comment thread .github/workflows/critical-gate-poll.yml Outdated
Comment thread .github/workflows/critical-gate-poll.yml Outdated
Comment thread .github/workflows/critical-gate-poll.yml Outdated
Copilot AI review requested due to automatic review settings September 4, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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

Comment thread .github/workflows/critical-gate-poll.yml Outdated
Copilot AI review requested due to automatic review settings September 4, 2026 15:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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

Comment on lines +63 to +65
nodes{ isResolved isOutdated
comments(first:1){ nodes{ author{login} body pullRequestReview{ submittedAt } } } }
} } } }`;
Comment on lines +77 to +78
const at = c.pullRequestReview && c.pullRequestReview.submittedAt;
if (at && (now - new Date(at).getTime()) <= WINDOW_MS) return true;
@chrisuthe
chrisuthe merged commit 52d52ee into dev Sep 4, 2026
18 checks passed
@chrisuthe
chrisuthe deleted the critical-gate-poller branch September 4, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants