-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: Repositories.UpdateRulesetClearBypassActor sets BypassActors to empty slice #3727
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
fix: Repositories.UpdateRulesetClearBypassActor sets BypassActors to empty slice #3727
Conversation
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. |
f5f0455
to
65c6f55
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3727 +/- ##
=======================================
Coverage 91.11% 91.11%
=======================================
Files 187 187
Lines 16684 16686 +2
=======================================
+ Hits 15202 15204 +2
Misses 1295 1295
Partials 187 187 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixes: #3726. |
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, @MathieuSevegny!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
@stevehipwell and/or @alexandear, 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.
LGTM
Summary
Ensure bypass_actors is serialized as an empty array rather than null when clearing bypass actors in repository rulesets.
Problem
As noted in #3726, the method Repositories.UpdateRulesetClearBypassActor constructs a rulesetClearBypassActors with BypassActors left at its zero value. In Go, the zero value for a slice (e.g., []*BypassActor) is nil, which serializes to null in JSON. The GitHub API requires bypass_actors to be an array, not null, and returns a 422 error
Result
References
#3726