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
feat: Add support for Copilot code review in repository and organization rulesets (#2965)
* feat: Add support for Copilot code review in repository rulesets
This change adds support for GitHub's Copilot code review feature in repository rulesets,
allowing automatic code review requests for pull requests.
Changes:
- Add copilot_code_review rule to repository ruleset schema
- Add CopilotCodeReviewRuleParameters and related types to go-github
- Implement expand/flatten logic for copilot_code_review rules
The copilot_code_review rule supports two configuration options:
- review_new_pushes: Automatically review each new push to the PR
- review_draft_pull_requests: Automatically review draft PRs
Both options default to false, matching GitHub UI behavior.
* test: Add unit test for copilot_code_review rule
* test: Add copilot_code_review to acceptance test
* docs: Add copilot_code_review to repository_ruleset documentation
* feat: Add copilot_code_review support to organization ruleset
This extends the copilot_code_review feature to github_organization_ruleset
resource, matching the functionality already available in github_repository_ruleset.
Changes:
- Add copilot_code_review schema to organization ruleset resource
- Update organization ruleset acceptance test with copilot_code_review
- Add documentation for copilot_code_review in organization_ruleset.html.markdown
Description: "Automatically request Copilot code review for new pull requests if the author has access to Copilot code review and their premium requests quota has not reached the limit.",
249
+
Elem: &schema.Resource{
250
+
Schema: map[string]*schema.Schema{
251
+
"review_on_push": {
252
+
Type: schema.TypeBool,
253
+
Optional: true,
254
+
Default: false,
255
+
Description: "Copilot automatically reviews each new push to the pull request. Defaults to `false`.",
256
+
},
257
+
"review_draft_pull_requests": {
258
+
Type: schema.TypeBool,
259
+
Optional: true,
260
+
Default: false,
261
+
Description: "Copilot automatically reviews draft pull requests before they are marked as ready for review. Defaults to `false`.",
Description: "Automatically request Copilot code review for new pull requests if the author has access to Copilot code review and their premium requests quota has not reached the limit.",
602
+
Elem: &schema.Resource{
603
+
Schema: map[string]*schema.Schema{
604
+
"review_on_push": {
605
+
Type: schema.TypeBool,
606
+
Optional: true,
607
+
Default: false,
608
+
Description: "Copilot automatically reviews each new push to the pull request. Defaults to `false`.",
609
+
},
610
+
"review_draft_pull_requests": {
611
+
Type: schema.TypeBool,
612
+
Optional: true,
613
+
Default: false,
614
+
Description: "Copilot automatically reviews draft pull requests before they are marked as ready for review. Defaults to `false`.",
Copy file name to clipboardExpand all lines: website/docs/r/organization_ruleset.html.markdown
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,6 +136,8 @@ The `rules` block supports the following:
136
136
137
137
*`pull_request` - (Optional) (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see [below for nested schema](#rules.pull_request))
138
138
139
+
*`copilot_code_review` - (Optional) (Block List, Max: 1) Automatically request Copilot code review for new pull requests if the author has access to Copilot code review and their premium requests quota has not reached the limit. (see [below for nested schema](#rulescopilot_code_review))
140
+
139
141
*`required_linear_history` - (Optional) (Boolean) Prevent merge commits from being pushed to matching branches.
140
142
141
143
*`required_signatures` - (Optional) (Boolean) Commits pushed to matching branches must have verified signatures.
@@ -210,6 +212,12 @@ The `rules` block supports the following:
210
212
211
213
*`required_review_thread_resolution` - (Optional) (Boolean) All conversations on code must be resolved before a pull request can be merged. Defaults to `false`.
212
214
215
+
#### rules.copilot_code_review ####
216
+
217
+
*`review_on_push` - (Optional) (Boolean) Copilot automatically reviews each new push to the pull request. Defaults to `false`.
218
+
219
+
*`review_draft_pull_requests` - (Optional) (Boolean) Copilot automatically reviews draft pull requests before they are marked as ready for review. Defaults to `false`.
220
+
213
221
#### rules.required_status_checks ####
214
222
215
223
*`required_check` - (Required) (Block Set, Min: 1) Status checks that are required. Several can be defined. (see [below for nested schema](#rules.required_status_checks.required_check))
Copy file name to clipboardExpand all lines: website/docs/r/repository_ruleset.html.markdown
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,6 +124,8 @@ The `rules` block supports the following:
124
124
125
125
*`pull_request` - (Optional) (Block List, Max: 1) Require all commits be made to a non-target branch and submitted via a pull request before they can be merged. (see [below for nested schema](#rulespull_request))
126
126
127
+
*`copilot_code_review` - (Optional) (Block List, Max: 1) Automatically request Copilot code review for new pull requests if the author has access to Copilot code review and their premium requests quota has not reached the limit. (see [below for nested schema](#rulescopilot_code_review))
128
+
127
129
*`required_deployments` - (Optional) (Block List, Max: 1) Choose which environments must be successfully deployed to before branches can be merged into a branch that matches this rule. (see [below for nested schema](#rulesrequired_deployments))
128
130
129
131
*`required_linear_history` - (Optional) (Boolean) Prevent merge commits from being pushed to matching branches.
@@ -215,6 +217,12 @@ The `rules` block supports the following:
215
217
216
218
*`required_review_thread_resolution` - (Optional) (Boolean) All conversations on code must be resolved before a pull request can be merged. Defaults to `false`.
217
219
220
+
#### rules.copilot_code_review ####
221
+
222
+
*`review_on_push` - (Optional) (Boolean) Copilot automatically reviews each new push to the pull request. Defaults to `false`.
223
+
224
+
*`review_draft_pull_requests` - (Optional) (Boolean) Copilot automatically reviews draft pull requests before they are marked as ready for review. Defaults to `false`.
225
+
218
226
#### rules.required_deployments ####
219
227
220
228
*`required_deployment_environments` - (Required) (List of String) The environments that must be successfully deployed to before branches can be merged.
0 commit comments