-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat!: Add support for pagination options in rules API methods #3562
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: master
Are you sure you want to change the base?
feat!: Add support for pagination options in rules API methods #3562
Conversation
Updated `GetRulesForBranch`, `GetAllRulesets`, and `GetAllRepositoryRulesets` methods to accept optional pagination parameters (`ListOptions`). Enhanced test cases to validate the use of these parameters in API requests.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3562 +/- ##
==========================================
+ Coverage 91.23% 91.24% +0.01%
==========================================
Files 183 183
Lines 16053 16075 +22
==========================================
+ Hits 14646 14668 +22
Misses 1231 1231
Partials 176 176 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Please make sure to run the scripts mentioned in step 4 of CONTRIBUTING.md and push the changes (not force-push) to this PR. Thank you!
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.
Also, to fix the CodeCov issues, please add testBadOptions
to your new tests. You can see examples in other locations.
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.
Thank you, @ktruedat!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
@stevehipwell - might you have time for a code review? Thank you!
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.
Do we not want tests to cover the case where we set opts
to nil
? I'd have assumed that the existing tests would use nil
and new tests would have been added for the pagination pattern?
Testing with |
@gmlewis wouldn't testing without |
Yes, great idea. I like it. Thank you, @stevehipwell! |
@gmlewis of course! I actually wanted to do separate tests from the start but wasn't sure about it. Will add them in a few |
@gmlewis @stevehipwell I included separate tests with ListOptions for every modified operation. I didn't include the full mock response in the client response since we are not really interested in the response itself, but rather testing the existence of the query params. Let me know if that's okay, thanks! |
BREAKING CHANGE:
GetRulesForBranch
,GetAllRulesets
, andGetAllRepositoryRulesets
now acceptopts
.Updated
GetRulesForBranch
,GetAllRulesets
, andGetAllRepositoryRulesets
methods to accept optional pagination parameters (ListOptions
). Enhanced test cases to validate the use of these parameters in API requests.Fixes: #3560