Skip to content

[FEAT] Add ruleset rule for pull request required reviewers#3073

Merged
stevehipwell merged 6 commits intointegrations:mainfrom
F-Secure-web:add-ruleset-rule-pr-required_reviewers
Feb 4, 2026
Merged

[FEAT] Add ruleset rule for pull request required reviewers#3073
stevehipwell merged 6 commits intointegrations:mainfrom
F-Secure-web:add-ruleset-rule-pr-required_reviewers

Conversation

@deiga
Copy link
Copy Markdown
Collaborator

@deiga deiga commented Jan 11, 2026

Resolves #3081


Before the change?

  • It was not possible to configure PR Required Reviewers through Rulesets

After the change?

  • It is now possible to configure PR Required Reviewers through Rulesets

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

@github-actions
Copy link
Copy Markdown

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@deiga deiga force-pushed the add-ruleset-rule-pr-required_reviewers branch from 152b69d to a4f0ad2 Compare January 12, 2026 20:58
@stevehipwell stevehipwell added this to the v6.11.0 Release milestone Jan 16, 2026
@stevehipwell stevehipwell added the Type: Feature New feature or request label Jan 16, 2026
@deiga deiga force-pushed the add-ruleset-rule-pr-required_reviewers branch from a4f0ad2 to 795b147 Compare January 22, 2026 21:41
@deiga deiga changed the title |FEAT] Add ruleset rule for pull request required reviewers [FEAT] Add ruleset rule for pull request required reviewers Jan 22, 2026
@deiga deiga force-pushed the add-ruleset-rule-pr-required_reviewers branch from 795b147 to 6f96e9b Compare February 3, 2026 16:12
@deiga deiga marked this pull request as ready for review February 3, 2026 16:12
@deiga deiga force-pushed the add-ruleset-rule-pr-required_reviewers branch from 6f96e9b to 2b084a7 Compare February 4, 2026 10:58
@deiga deiga requested a review from stevehipwell February 4, 2026 10:58
Copy link
Copy Markdown
Collaborator

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stevehipwell stevehipwell enabled auto-merge (squash) February 4, 2026 16:38
@stevehipwell
Copy link
Copy Markdown
Collaborator

@deiga could you please rebase this?

deiga added 6 commits February 4, 2026 21:16
Add support for the required_reviewers rule parameter in pull_request
rules for both organization and repository rulesets. This allows
requiring specific team reviewers to approve changes based on file
patterns.

Implementation includes:
- requiredReviewersSchema() shared schema definition
- expandRequiredReviewers() for Terraform->API conversion
- flattenRequiredReviewers() for API->Terraform conversion
- Integration into expandRules() and flattenRules()
- Schema integration in both org and repo ruleset resources
Add comprehensive unit tests for the expand/flatten helper functions:
- TestExpandRequiredReviewers: validates expansion logic
- TestExpandRequiredReviewersEmpty: handles edge cases
- TestFlattenRequiredReviewers: validates flattening logic
- TestFlattenRequiredReviewersEmpty: handles edge cases
- TestRoundTripRequiredReviewers: verifies data integrity

Add acceptance tests for both organization and repository rulesets:
- Single reviewer configuration with file patterns
- Multiple reviewers configuration
- Update operations (minimum_approvals change)
- Import state verification
Add documentation for the new required_reviewers nested block
in both organization_ruleset and repository_ruleset resources.

Documents the reviewer, file_patterns, and minimum_approvals
attributes with their types and requirements.
- Add missing allowed_merge_methods field to pull_request section
- Fix merge_queue fields from Required to Optional with defaults
- Fix actor_id to show Optional with note about DeployKey
- Add DeployKey to actor_type enum list
- Add protected field to conditions.repository_name
- Fix required_code_scanning_tool anchor link
- Remove duplicate do_not_enforce_on_create
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
auto-merge was automatically disabled February 4, 2026 19:17

Head branch was pushed to by a user without write access

@deiga deiga force-pushed the add-ruleset-rule-pr-required_reviewers branch from 2b084a7 to 374aae8 Compare February 4, 2026 19:17
@deiga
Copy link
Copy Markdown
Collaborator Author

deiga commented Feb 4, 2026

@stevehipwell Done

@stevehipwell stevehipwell merged commit 2182312 into integrations:main Feb 4, 2026
7 checks passed
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]: PR policy - require reviewer from specific team

3 participants