Skip to content

Conversation

MathieuSevegny
Copy link
Contributor

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

  • Payload now includes bypass_actors: [] instead of null.
  • Clearing bypass actors succeeds without a 422 error.

References

#3726

Copy link

google-cla bot commented Sep 23, 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.

@MathieuSevegny MathieuSevegny force-pushed the fix/update-ruleset-clear-bypass-actor-body branch from f5f0455 to 65c6f55 Compare September 23, 2025 17:03
Copy link

codecov bot commented Sep 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.11%. Comparing base (7e700a7) to head (65c6f55).
⚠️ Report is 2 commits behind head on master.

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.
📢 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.

@gmlewis
Copy link
Collaborator

gmlewis commented Sep 23, 2025

Fixes: #3726.

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, @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!

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Sep 23, 2025
Copy link
Contributor

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

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

LGTM

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Sep 23, 2025
@gmlewis gmlewis merged commit 1b53270 into google:master Sep 23, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants