Skip to content

feat: Add image_gen to HostedRunner and UpdateHostedRunnerRequest - #4544

Open
breken-ai wants to merge 1 commit into
google:masterfrom
breken-ai:fix-4532-hosted-runner-image-gen
Open

feat: Add image_gen to HostedRunner and UpdateHostedRunnerRequest#4544
breken-ai wants to merge 1 commit into
google:masterfrom
breken-ai:fix-4532-hosted-runner-image-gen

Conversation

@breken-ai

Copy link
Copy Markdown

Fixes #4532

What

The GitHub-hosted runner API supports image_gen on create, update, and read (it was added for create in #3973), but go-github only models it on CreateHostedRunnerRequest. The field can be set at create time but never read back or patched: HostedRunner (the response type for GetHostedRunner, CreateHostedRunner, UpdateHostedRunner, DeleteHostedRunner, ListHostedRunners, and the EnterpriseService equivalents) and UpdateHostedRunnerRequest both lack it. As the issue notes, this breaks terraform-provider-github round-trips: an import records false, and an apply with true destroys and recreates the pool.

Verified against current master (2433615): github/actions_hosted_runners.go has ImageGen only on CreateHostedRunnerRequest (:103); HostedRunner (:30) and UpdateHostedRunnerRequest (:107) do not.

Change

  • HostedRunner: add ImageGen *bool \json:"image_gen,omitempty"``
  • UpdateHostedRunnerRequest: add ImageGen *bool \json:"image_gen,omitempty"``
  • script/generate.sh run per CONTRIBUTING - github-accessors.go and github-accessors_test.go regenerated (accessor + accessor test for both new fields; no hand-written surface beyond the two field lines)
  • New round-trip marshal tests in the repo's standard testJSONMarshal style: TestHostedRunner_Marshal and TestUpdateHostedRunnerRequest_Marshal, each covering the empty struct and a fully populated struct including image_gen

Testing

  • TestHostedRunner_Marshal, TestUpdateHostedRunnerRequest_Marshal: PASS
  • Existing hosted-runner tests re-run against the change (TestActionsService_ListHostedRunners, TestActionsService_GetHostedRunner, TestActionsService_UpdateHostedRunner, TestActionsService_ListHostedRunnersIter): PASS
  • gofmt -l github/: clean
  • Disclosure: the full github package 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.

Built by breken, your AI support engineer - breken.ai - this one's on us.

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
@google-cla

google-cla Bot commented Sep 11, 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.

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.54%. Comparing base (2433615) to head (9d5cfe1).

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.
📢 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 gmlewis added NeedsReview PR is awaiting a review before merging. waiting for signed CLA labels Sep 11, 2026
@gmlewis

gmlewis commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

@breken-ai - please solve the issue reported here: https://github.com/google/go-github/pull/4544/checks?check_run_id=103155993223
and then we can proceed with this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NeedsReview PR is awaiting a review before merging. waiting for signed CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

image_gen missing from HostedRunner and UpdateHostedRunnerRequest

2 participants