-
Notifications
You must be signed in to change notification settings - Fork 908
feat: Add support for Copilot code review in repository rulesets #2965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Add support for Copilot code review in repository rulesets #2965
Conversation
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.
deiga
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't manually edit the vendored library. That code needs to be updated by upgrading the library itself.
This is happening in the v7 release
|
Hello, very interested in this feature, now that the go-google one is merged, is it OK here ? |
|
Hey 👋 We'll still need to get the v7 upgrade of this provider done, so that go-github can be upgraded to the latest version. Then we can get this merged in! |
|
@SoaAlex the change I made in go module repo hasnt even been released yet, likely will be included in the v81 release in coming days, for github provider i see we are trying to push update to v77, i guess it will take some time for us to upgrade to v8. I will dust off this PR when we do that! Also @deiga one observation I have is in github API, one of the parameters of enabling copilot is but in UI, it is but for terraform provider, should we respect UI more, in stead of API, maybe we should keep using |
|
We hopefully won't be needing a v8 of the provider to upgrade to v80 of the SDK 😬 That's a fair question. I think we have the luxury of going whichever way we think is best and don't have to follow either naming necessarily. So: no answer, only questions 😂 |
This change adds support for GitHub's Copilot code review feature in repository rulesets, allowing automatic code review requests for pull requests.
Changes:
The copilot_code_review rule supports two configuration options:
Both options default to false, matching GitHub UI behavior.
Resolves #2694 and #2583
Before the change?
The github_repository_ruleset resource did not support GitHub's Copilot code review feature
Users could not configure automatic Copilot code review requests through Terraform
Rulesets created in the GitHub UI with Copilot code review enabled would cause drift or errors when managed by Terraform
After the change?
Added support for the copilot_code_review rule in repository rulesets
Users can now configure automatic Copilot code review for pull requests with two options:
review_new_pushes - Copilot automatically reviews each new push to the pull request (defaults to false)
review_draft_pull_requests - Copilot automatically reviews draft pull requests before they are marked as ready for review (defaults to false)
The implementation follows the existing pattern for other ruleset rules and is fully backwards compatible
Empty copilot_code_review {} block enables the feature with default settings (both options disabled), matching GitHub UI behavior
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
this feature is based on https://github.blog/changelog/2025-09-10-copilot-code-review-independent-repository-rule-for-automatic-reviews/ (an independent repository rule instead of pull request rule)