Sitelet https://github.com/google/go-github/pull/4541
Skip to content

fix: Allow removing runner group networks - #4541

Merged
gmlewis merged 5 commits into
google:masterfrom
austenstone:austenstone-runner-network-detachment
Oct 7, 2026
Merged

gmlewis merged 5 commits into
google:masterfrom
austenstone:austenstone-runner-network-detachment

Conversation

@austenstone

@austenstone austenstone commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Add RemoveNetworkConfiguration to organization and enterprise runner-group update requests, following UpdateTeamRequest.RemoveParentTeam. Setting it sends "network_configuration_id": null and takes precedence over a supplied ID. The value-receiver marshaler supports both values and pointers without mutation. Creates and responses are unchanged.

The Go 1.26.0 encoding/json repro shows that *string behaves identically with omitempty and omitzero: nil omits the field, new("network-id") sends a string, and new("") sends "". Neither tag produces JSON null. Empty-string behavior is preserved for compatibility, but empty-string detachment is unverified. Both PATCH schemas allow null: organization and enterprise.

Regression tests cover omission, assignment, empty-string compatibility, explicit null, flag precedence, preservation of other fields, value/pointer marshaling, request immutability, and both native PATCH bodies. The null cases fail without the marshalers. On Go 1.26.0, runner-group race tests, all-module script/test.sh race tests, script/fmt.sh, script/generate.sh, script/lint.sh, and OpenAPI metadata validation pass. No live API writes were made for this revision.

This revises the earlier omitzero implementation and still needs maintainer agreement on explicit-null removal. Needed by integrations/terraform-provider-github#3274, which remains gated on a merged and released SDK fix.

Copilot assisted with implementation, tests, and this description.

@google-cla

google-cla Bot commented Sep 10, 2026

Copy link
Copy Markdown

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.

Add explicit removal flags for organization and enterprise runner group updates, preserving existing omission and string behavior.
@austenstone
austenstone force-pushed the austenstone-runner-network-detachment branch from 9788c28 to c4d4c88 Compare September 10, 2026 22:05
@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Sep 10, 2026
@codecov

codecov Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.61%. Comparing base (b1a37cf) to head (50d7554).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4541   +/-   ##
=======================================
  Coverage   98.61%   98.61%           
=======================================
  Files         199      199           
  Lines       18675    18693   +18     
=======================================
+ Hits        18417    18435   +18     
  Misses        258      258           

☔ View full report in Codecov by Harness.
📢 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.

Comment thread github/actions_runner_groups.go
@gmlewis

gmlewis commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

@austenstone - just like in another recent PR, we now have a CLA problem because an agent signed a commit that was pushed to this PR.

The following contributors were found for this pull request:

✅ https://github.com/google/go-github/commit/b0fc528fc916672eb5d41e81defdbb91c1aa4416 Author: @austenstone <aus******ne​@github.com>
❌ https://github.com/google/go-github/commit/b0fc528fc916672eb5d41e81defdbb91c1aa4416 Co-Author: @Copilot <223556219+Copilot​@users.noreply.github.com>

So now, you can either clean up the commits locall and force-push the changes to this PR to get rid of the bot's commits or you can close this PR and open a brand new one. Your choice, but we cannot continue this PR with the current CLA state, unfortunately.

Keep explicit JSON null removal separate from empty-string compatibility. Document the primitive-pointer encoding contract and exercise the removal flag through organization and enterprise update requests.
@austenstone
austenstone force-pushed the austenstone-runner-network-detachment branch from b0fc528 to 6cf8993 Compare September 18, 2026 20:18

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, @austenstone.
One wording suggestion, otherwise, LGTM.

cc: @stevehipwell - @Not-Dhananjay-Mishra

Comment thread CONTRIBUTING.md Outdated

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, @austenstone!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @Not-Dhananjay-Mishra

@stevehipwell stevehipwell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The code changes look good but I don't think the contributing changes are quite right.

Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@austenstone - please fix the linter and test errors and push the changes to this PR and we can then continue.

Merge current master and adapt organization runner-group tests to its required string name field. Keep explicit null removal coverage and verify zero-value name serialization.
@austenstone

Copy link
Copy Markdown
Contributor Author

Fixed in 50d7554. Merged current master and updated the organization runner-group fixtures for the required string name, including the expected JSON bodies. Explicit null removal coverage is unchanged.

Full script/test.sh (with race detection), script/lint.sh, and integration-test compilation pass locally on Go 1.26.0. The new test and lint runs need maintainer approval before they can start. @gmlewis could you approve the runs and take another look?

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@stevehipwell - have all your comments been addressed now?

@stevehipwell stevehipwell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@gmlewis

gmlewis commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Thank you, @stevehipwell!
Merging.

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Oct 7, 2026
@gmlewis
gmlewis merged commit d61c874 into google:master Oct 7, 2026
14 of 15 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.

3 participants