Skip to content

Conversation

@JiayangZhou
Copy link

@JiayangZhou JiayangZhou commented Dec 4, 2025

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.

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

  • Schema migrations have been created if needed (example)
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

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)

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.
@github-actions github-actions bot added the Type: Feature New feature or request label Dec 4, 2025
Copy link
Contributor

@deiga deiga left a 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

@JiayangZhou
Copy link
Author

JiayangZhou commented Dec 4, 2025

Thank you @deiga i have created a PR on google/go-github vendor side and will update this PR once that change is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Add automatic_copilot_code_review_enabled support for repository rules

2 participants