Skip to content

Conversation

@deiga
Copy link
Contributor

@deiga deiga commented Jan 11, 2026

[!WARN]
This PR is stacked on top of #2958
That should be reviewed and merged first


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

deiga added 30 commits January 10, 2026 08:31
Signed-off-by: Timo Sand <[email protected]>
Signed-off-by: Timo Sand <[email protected]>
… to org rulesets will never be a thing

Signed-off-by: Timo Sand <[email protected]>
…re empty lists by default

Signed-off-by: Timo Sand <[email protected]>
Signed-off-by: Timo Sand <[email protected]>
Signed-off-by: Timo Sand <[email protected]>
Signed-off-by: Timo Sand <[email protected]>
Signed-off-by: Timo Sand <[email protected]>
This turns out to be failing as there is a bug in our implementation! Unit tests and fix coming up

Signed-off-by: Timo Sand <[email protected]>
As they differ from `branch` and `tag` rules

Signed-off-by: Timo Sand <[email protected]>
@github-actions
Copy link

👋 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 added 4 commits January 12, 2026 22:58
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
@deiga deiga force-pushed the add-ruleset-rule-pr-required_reviewers branch from 152b69d to a4f0ad2 Compare January 12, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant