feat: Add image_gen to HostedRunner and UpdateHostedRunnerRequest - #4544
feat: Add image_gen to HostedRunner and UpdateHostedRunnerRequest#4544breken-ai wants to merge 1 commit into
image_gen to HostedRunner and UpdateHostedRunnerRequest#4544Conversation
The GitHub-hosted runner API supports image_gen on create, update, and read, but go-github only modeled it on CreateHostedRunnerRequest. The field could be set on create but never read back or patched, which breaks terraform-provider-github round-trips. Add ImageGen to the HostedRunner response type and to UpdateHostedRunnerRequest, regenerate accessors, and cover both structs with round-trip marshal tests. Fixes google#4532
|
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4544 +/- ##
=======================================
Coverage 98.54% 98.54%
=======================================
Files 196 196
Lines 17938 17938
=======================================
Hits 17677 17677
Misses 261 261 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@breken-ai - please solve the issue reported here: https://github.com/google/go-github/pull/4544/checks?check_run_id=103155993223 |
Fixes #4532
What
The GitHub-hosted runner API supports
image_genon create, update, and read (it was added for create in #3973), but go-github only models it onCreateHostedRunnerRequest. The field can be set at create time but never read back or patched:HostedRunner(the response type forGetHostedRunner,CreateHostedRunner,UpdateHostedRunner,DeleteHostedRunner,ListHostedRunners, and theEnterpriseServiceequivalents) andUpdateHostedRunnerRequestboth lack it. As the issue notes, this breaks terraform-provider-github round-trips: an import recordsfalse, and an apply withtruedestroys and recreates the pool.Verified against current
master(2433615):github/actions_hosted_runners.gohasImageGenonly onCreateHostedRunnerRequest(:103);HostedRunner(:30) andUpdateHostedRunnerRequest(:107) do not.Change
HostedRunner: addImageGen *bool \json:"image_gen,omitempty"``UpdateHostedRunnerRequest: addImageGen *bool \json:"image_gen,omitempty"``script/generate.shrun per CONTRIBUTING -github-accessors.goandgithub-accessors_test.goregenerated (accessor + accessor test for both new fields; no hand-written surface beyond the two field lines)testJSONMarshalstyle:TestHostedRunner_MarshalandTestUpdateHostedRunnerRequest_Marshal, each covering the empty struct and a fully populated struct includingimage_genTesting
TestHostedRunner_Marshal,TestUpdateHostedRunnerRequest_Marshal: PASSTestActionsService_ListHostedRunners,TestActionsService_GetHostedRunner,TestActionsService_UpdateHostedRunner,TestActionsService_ListHostedRunnersIter): PASSgofmt -l github/: cleangithubpackage test binary OOMs at compile time in this memory-constrained sandbox (2 GB), so the complete suite was not run locally; the targeted tests above all pass and CI will cover the rest.