Repository navigation
copilot code review settings
Add declarative management of repository-level GitHub Copilot code review tuning under settings.copilotCodeReview, covering review effort, custom instructions, MCP use, and severity filtering through the repository Copilot settings API. Automatic review requests, reviews on new pushes, and draft reviews remain expressible through the existing copilot_code_review ruleset.
| Type | Issue |
|---|---|
| Feature | Issue #53 |
GitHub added REST and GraphQL APIs to manage Copilot code review settings. The repository REST endpoint exposes review effort, whether review uses repository custom instructions and MCP servers, and a severity filter. The repository settings endpoint tunes reviews but does not enable Copilot code review. Automatic review behavior is configured through rulesets, whose copilot_code_review rule accepts review_on_push and review_draft_pull_requests parameters. GitHub's release notes describe the endpoints and token requirements (changelog, API reference, rules API reference).
The REST API version already pinned by the client is 2026-03-10. A GET using the authenticated local GitHub CLI token returned 200 for this repository. The existing planner also recognizes a copilot_code_review ruleset. No live PATCH or live ruleset apply has been performed.
settings:
copilotCodeReview:
reviewEffort: balanced
customInstructionsEnabled: true
mcpEnabled: false
severityFilter: low-
Configuration. Add optional
settings.copilotCodeReviewfields:reviewEffort,customInstructionsEnabled,mcpEnabled, andseverityFilter. Omitted fields remain unmanaged, and optional boolean pointers preserve explicitfalse.reviewEffortaccepts a value exposed inavailable_review_effortsorinherit. The accepted severity values areno_filter,low, andlow_and_medium. KeepschemaVersionat1. -
API and convergence. Add typed GET and PATCH operations for
/repos/{owner}/{repo}/copilot/code-review/settings.plancompares declared fields against configured state. A failed read or an unavailable requested review effort blocks the plan. For an existing repository,applyre-reads the settings and sends one PATCH containing only declared fields that differ. It sends no PATCH for a no-op. For a newly created repository, plan the declared settings for application after creation, then apply them in the existing repository settings stage. GitHub validates the PATCH atomically. Return and report GitHub validation or permission errors. -
Review effort inheritance. GET returns
review_effort.configuredandeffective. A null configured value can mean inherited effort or a saved value that is no longer available. Treat null as observationally matchinginherit, and never turneffectiveinto a stored override during import.importomits an inherited or otherwise unrepresentable effort and reports a diagnostic.import --intoretains any existing declaration when the imported configured value is null. -
Import failures. Map readable values into
settings.copilotCodeReview. For non-rate-limit HTTP 403 or HTTP 404, omit the section in fresh import and report a diagnostic. Authentication errors, rate limits, and transport errors fail the import. A successful GET suppliesavailable_review_efforts; use it to validate any explicit effort before planning an update. GitHub remains the authority for whether severity filtering can be changed on a given repository. -
Credentials and README. A local
gh auth loginOAuth token or classic PAT needs thereposcope, and its user must be a repository administrator. GitHub App and fine-grained PAT tokens need repositoryAdministration: readfor GET andAdministration: writefor PATCH. GitHub Actions' built-inGITHUB_TOKENcannot receive the requiredAdministrationpermission through workflowpermissions; Use a GitHub App token or PAT in CI with the permissions appropriate to a read-only or apply job. Update bothREADME.mdandREADME_ja.mdwith these permission requirements and the local CLI and CI guidance. - Scope. This change manages repository-level review tuning and automatic-review rules declared through repository rulesets. Enterprise and organization policy, billing, maximum effort limits, and approval policy are not part of the repository setting implementation. The Copilot code review settings API does not enable the feature by itself.
- Add the configuration types, semantic validation, and JSON Schema. Add REST request and response types and client methods.
- Add plan comparison and apply to the repository settings stage. Extend importer mapping and declared-only YAML/JSON refresh behavior.
- Update English and Japanese design documentation, both READMEs, and relevant examples. Add API-client, planner, importer, and refresh tests.
Automated tests cover endpoint paths, methods, API version headers, PATCH bodies, configured and inherited review effort, dynamic available-effort validation, explicit false values, per-field differences, permission and service errors, plan convergence after apply, import diagnostics, and YAML/JSON --into updates. Validate configuration in both YAML and JSON and confirm the two READMEs state the token requirements for local gh and CI. After automated tests pass, use a test repository to run plan, apply, re-import, and a repeated plan; verify updated values with GET and confirm the second plan has no drift. Restore the original setting after verification. Live write verification is pending.