|
1 | 1 | --- |
2 | 2 | description: Known gotchas and platform-specific issues. Read when debugging unexpected behavior. |
3 | 3 | tier: 2 |
4 | | -entry_count: 96 |
| 4 | +entry_count: 98 |
5 | 5 | last_updated: "2026-03-05" |
6 | 6 | --- |
7 | 7 |
|
@@ -1413,3 +1413,56 @@ gh api repos/OWNER/REPO -X PATCH -f allow_auto_merge=true |
1413 | 1413 | ``` |
1414 | 1414 |
|
1415 | 1415 | **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