You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add .github/ai-gate.yml for the AI review gate - #3340
Adds .github/ai-gate.yml. With this file in place, a pull request whose Cursor Bugbot review is clean is approved automatically, so it doesn't wait for a reviewer.
Forks still need a maintainer. A pull request from a fork, which is how outside contributions arrive, never gets an automated approval.
Some files always need a person. That's workflows, actions, CODEOWNERS, the Cursor configuration and this file, whatever the review says.
This file does nothing on its own. Auto-approval also has to be switched on for the repository centrally.
To turn it off, delete this file.
Note
Low Risk
Adds only GitHub automation config with no application or security logic changes.
Overview
Adds .github/ai-gate.yml so this repo opts into automated approval when Cursor Bugbot's PR review is clean (reviewers: [bugbot]). Without the file, the gate can still run but a human must approve.
Repo-level auto-approval still has to be enabled separately; removing this file turns off that opt-in for this repository.
Reviewed by Cursor Bugbot for commit 4519cb8. Bugbot is set up for automated code reviews on this repo. Configure here.
1. Without a policy: key, workflows, CODEOWNERS, .cursor/** and this file are auto-approved on a clean Bugbot review — .github/ai-gate.yml:6
Scenario: the description says some files "always need a person, whatever the review says". The gate does not do that for this config. Its tier-3 rule (tiers.py:42-48, escalation.py:167) runs only when a policy is present (cli.py:355, README). The gate's own test test_no_policy_and_clean_bugbot_is_green_back_compat asserts that a tier-3 path passes on a clean review. Once auto-approval is switched on, anyone with write access can get a change to .github/workflows/* approved with only a Bugbot review. release.yml and nightly.yml hold the GPG signing and Sonatype publishing secrets. The same applies to a change to .github/ai-gate.yml itself. That approval meets the single approval that the org ruleset on main requires (require_code_owner_review: false, so CODEOWNERS does not step in). Bugbot reads the PR's own text and code, so the author can try to steer the review that approves the PR. The other claim, that fork PRs never get an automated approval, has no counterpart in aigate/ (no fork check). It depends on the central auto-approval, which I could not read.
Fix: add policy: {}, which opts into the policy layer with no extra rules (see test_empty_policy_map_opts_in_with_no_rules). Tier-3 changes then need an approval of the head from a non-author human with write access, and bot approvals do not count.
# Configuration for the AI review gate on this repository.
#
# This file opts the repository into automated approval: when Cursor Bugbot's
# review of a pull request is clean, the gate approves it. Without this file the
# gate still runs, but a person approves.
reviewers: [bugbot]
+# Opt into the policy layer: tier-3 paths (.github/**, .cursor/**, CODEOWNERS,+# Dockerfile, build files) always need a non-author human approval.+policy: {}
2. An automated approval keeps counting after later pushes under the current main ruleset — .github/ai-gate.yml:3
Scenario: the org ruleset enforce-require-review on the default branch (public rules/branches/main) requires 1 approval with dismiss_stale_reviews_on_push: false and require_last_push_approval: false. It has no required-workflow rule, so the gate is not a merge check here. Bugbot reviews commit X cleanly, the gate approves X, and the author then pushes commit Y, for example a workflow step or a logging change. The approval of X still satisfies the ruleset, so Y merges without anyone having reviewed it. The exception is if the central auto-approval dismisses its own approval on every push, which is not in a public repo. The gate's README names both prerequisites: Require workflows to pass before merging and Require approval of the most recent reviewable push.
Fix: before this opt-in merges, turn on last-push approval (or stale-approval dismissal) in the default-branch ruleset, and require ClickHouse/ai-gate/.github/workflows/ai-gate-required.yml through a workflows rule.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
.github/ai-gate.yml. With this file in place, a pull request whose Cursor Bugbot review is clean is approved automatically, so it doesn't wait for a reviewer.Note
Low Risk
Adds only GitHub automation config with no application or security logic changes.
Overview
Adds
.github/ai-gate.ymlso this repo opts into automated approval when Cursor Bugbot's PR review is clean (reviewers: [bugbot]). Without the file, the gate can still run but a human must approve.Repo-level auto-approval still has to be enabled separately; removing this file turns off that opt-in for this repository.
Reviewed by Cursor Bugbot for commit 4519cb8. Bugbot is set up for automated code reviews on this repo. Configure here.