Skip to content
This repository was archived by the owner on Apr 5, 2026. It is now read-only.

Commit 3a019d0

Browse files
HerbHallclaude
andcommitted
feat: add Copilot auto-review setup gotchas
Add KG#92: Copilot auto-review toggle is UI-only, not fully configurable via REST API. After creating a ruleset via API, the UI toggle may need manual confirmation. Add KG#93: Rulesets and branch protection review requirements conflict. Using both creates a double review gate. Use rulesets for review requirements (enables Copilot) and branch protection only for CI status checks. Includes protection architecture table documenting which system should manage each concern. Closes #193 Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0663a03 commit 3a019d0

1 file changed

Lines changed: 54 additions & 1 deletion

File tree

claude/rules/known-gotchas.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Known gotchas and platform-specific issues. Read when debugging unexpected behavior.
33
tier: 2
4-
entry_count: 96
4+
entry_count: 98
55
last_updated: "2026-03-05"
66
---
77

@@ -1413,3 +1413,56 @@ gh api repos/OWNER/REPO -X PATCH -f allow_auto_merge=true
14131413
```
14141414

14151415
**Prevention:** Include this step in the repo setup checklist. The release-gate template header now documents this prerequisite.
1416+
1417+
## 97. Copilot Auto-Review Is UI-Only (No REST API)
1418+
1419+
**Added:** 2026-03-05 | **Source:** Runbooks | **Status:** active
1420+
1421+
**Platform:** GitHub
1422+
**Issue:** The "Automatically request Copilot code review" toggle in GitHub rulesets is only available through the GitHub web UI. The REST API can create the `copilot_code_review` rule type with `review_on_push: true`, but the UI toggle may still need manual confirmation. There is no REST API endpoint to read or write this setting independently.
1423+
**Diagnosis:** After creating a ruleset via API with `copilot_code_review` rule, Copilot doesn't review PRs. The ruleset exists but the UI toggle appears unchecked.
1424+
**Fix:** After creating the ruleset via API, manually confirm the setting:
1425+
1426+
1. Go to repo Settings > Rules > Rulesets > "Copilot PR Review"
1427+
2. Click Edit on "Require a pull request before merging"
1428+
3. Under "Additional settings", verify "Require review from GitHub Copilot" is checked
1429+
4. Also enable "Review new pushes" for re-review on each push
1430+
5. Save changes
1431+
1432+
**URL pattern:** `https://github.com/OWNER/REPO/settings/rules/RULESET_ID`
1433+
**Workaround:** Create a test PR with a real file change to verify Copilot reviews it after setup.
1434+
1435+
## 98. Rulesets and Branch Protection Review Requirements Conflict
1436+
1437+
**Added:** 2026-03-05 | **Source:** Runbooks | **Status:** active
1438+
1439+
**Platform:** GitHub
1440+
**Issue:** GitHub rulesets and classic branch protection are separate systems that can both require PR reviews independently. If a ruleset requires 1 approving review (for Copilot auto-review) AND branch protection also requires 1 review, the effective requirement becomes 2 reviews -- one from each system. For solo maintainers, this blocks all PRs.
1441+
**Diagnosis:** PR has Copilot approval but still shows "Review required" and cannot be merged. `gh pr view --json reviews` shows 1 approval but merge is blocked.
1442+
**Fix:** Use rulesets for review requirements (enables Copilot auto-review) and branch protection only for CI status checks. Remove `required_pull_request_reviews` from branch protection:
1443+
1444+
```bash
1445+
# Remove review requirement from branch protection
1446+
# Keep only status checks
1447+
gh api repos/OWNER/REPO/branches/main/protection -X PUT \
1448+
--input - << 'JSON'
1449+
{
1450+
"required_status_checks": {
1451+
"strict": true,
1452+
"contexts": ["Build", "Lint", "Test"]
1453+
},
1454+
"enforce_admins": false,
1455+
"required_pull_request_reviews": null,
1456+
"restrictions": null
1457+
}
1458+
JSON
1459+
```
1460+
1461+
**Protection architecture:**
1462+
1463+
| Concern | System | Reason |
1464+
|---------|--------|--------|
1465+
| CI status checks | Branch protection | API-configurable, well-supported |
1466+
| PR review requirement | Ruleset | Enables Copilot auto-review |
1467+
| Copilot auto-review | Ruleset (UI toggle) | Only available in rulesets |
1468+
| Auto-merge | Repo setting | Required for release-gate workflow |

0 commit comments

Comments
 (0)