Allow an empty array of BypassActors in Ruleset struct in CreateRuleset endpoint
Fixes: #3137
added an extra Ruleset struct and CreateRuleset endpoint in repo_rules.go to allow the BypassActors field to be passed as nil or an empty array
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.92%. Comparing base (
2b8c7fa) to head (fa5bba3). Report is 78 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #3174 +/- ##
==========================================
- Coverage 97.72% 92.92% -4.80%
==========================================
Files 153 171 +18
Lines 13390 11582 -1808
==========================================
- Hits 13085 10763 -2322
- Misses 215 726 +511
- Partials 90 93 +3
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Do you mean something like having an anonymous struct identical to Ruleset in the new functions scope that would just copy over the values of Ruleset to? I understand your idea but i'm confused about the implementation.
Do you mean something like having an anonymous struct identical to Ruleset in the new functions scope that would just copy over the values of Ruleset to? I understand your idea but i'm confused about the implementation.
Yes, that is what I mean.
We have other examples of this in our repo.
Here is one of many: https://github.com/google/go-github/blob/master/github/repos.go#L546-L573
I found this by typing:
$ grep 'type [a-z]' github/*.go
made some changes. Let me know if its what you expected.
Ok. I commited your suggested changes. I didn't know rulesetNoOmitBypassActors made it non exported. Learned something new about the language. Thanks!
Please re-run step 4 in CONTRIBUTING.md to re-generate the auto-generated files... then the tests should all pass.
You can also test locally before you push by running go test ./...
This would be useful for me as I'm tracking a bug in the GitHub terraform provider that I think links to #3137.
@Matthew-Reidy are you planning on picking this up again?
I can fix the spelling mistake/nit but as for the other proposed change, whats the justification? The solution in place now on this PR seems to do the same things and has testing evidence behind it. Thanks.
Thank you, @tomfeigin and @Matthew-Reidy ! @tomfeigin - after this is merged, feel free to create a PR to improve the styling if you wish.
Merging.