Skip to content

Conversation

@smazmi
Copy link

@smazmi smazmi commented Nov 7, 2025

Summary

Adds support for GitHub's new ruleset feature that allows requiring specific team approvals on pull requests based on file patterns, as announced in the GitHub changelog on November 3, 2025.

Changes

This PR adds three new types to support the required_reviewers field in pull request ruleset parameters:

  • RulesetReviewerType: Type-safe string enum for reviewer types
  • RulesetRequiredReviewer: Contains minimum approvals, file patterns, and reviewer details
  • RulesetReviewer: Nested struct with reviewer ID and type

The implementation follows existing patterns in the codebase (similar to BypassActorType) and uses pointer types for proper optionality and JSON omitempty semantics.

Testing

  • Added comprehensive unit test case "pull_request_with_required_reviewers" that validates JSON marshaling/unmarshaling
  • All existing tests pass
  • Generated accessor methods with full test coverage

Additional Notes

The required_reviewers field is not yet documented in GitHub's OpenAPI schema but is confirmed working in production as of the November 3, 2025 announcement.

Resolves #3806


Checklist

  • Added tests for new functionality
  • Ran script/fmt.sh
  • Ran script/generate.sh
  • Ran script/test.sh
  • Ran script/lint.sh
  • Followed existing code patterns and conventions
  • Added proper Go doc comments
  • Verified against live GitHub API

…solves google#3806)

Signed-off-by: Sadique Azmi <sadiquemobaraka5@gmail.com>
@google-cla
Copy link

google-cla bot commented Nov 7, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gmlewis gmlewis changed the title feat: add required_reviewers support to PullRequestRuleParameters (#3806) feat: Add required_reviewers support to PullRequestRuleParameters (#3806) Nov 7, 2025
@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.27%. Comparing base (8760289) to head (6c2b2a4).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3811   +/-   ##
=======================================
  Coverage   92.27%   92.27%           
=======================================
  Files         192      192           
  Lines       13896    13896           
=======================================
  Hits        12823    12823           
  Misses        884      884           
  Partials      189      189           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @smazmi!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @alexandear - @zyfy29

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Nov 7, 2025
@smazmi
Copy link
Author

smazmi commented Nov 7, 2025

Thank you, @smazmi!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @alexandear - @zyfy29

Got it, thanks @gmlewis ! :)

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

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for required reviews in rulesets

2 participants