refactor!: Change GetRulesForBranch to ListRulesForBranch#4229
Conversation
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4229 +/- ##
==========================================
- Coverage 97.75% 97.45% -0.31%
==========================================
Files 189 189
Lines 19035 19115 +80
==========================================
+ Hits 18608 18628 +20
- Misses 231 270 +39
- Partials 196 217 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra - @munlicode |
|
Note that I'm not terribly concerned about the code coverage report in this PR since the JSON custom unmarshaler is tested separately. |
stevehipwell
left a comment
There was a problem hiding this comment.
This looks good, just a minor question.
| // Note that since [BranchRules] contains a large number of slices, this iterator | ||
| // returns type `any` and it is therefore the responsibility of the caller to perform a | ||
| // type switch to determine what item is being returned for each iteration. | ||
| func (s *RepositoriesService) ListRulesForBranchIter(ctx context.Context, owner, repo, branch string, opts *ListOptions) iter.Seq2[any, error] { |
There was a problem hiding this comment.
I can see why this iterator isn't being generated, but do you need to add some configuration to block the generator or will it see that this already exists?
I'd also like a go refactoring it once it's merged as I think we could make the API a bit more specific and remove any.
BREAKING CHANGE:
RepositoriesService.GetRulesForBranchis nowRepositoriesService.ListRulesForBranch.Relates to: #4117.