Skip to content

fix: wait for hosted runner public IP provisioning - #3627

Draft
krukowskid wants to merge 2 commits into
integrations:mainfrom
krukowskid:fix-hosted-runner-public-ip-readiness
Draft

fix: wait for hosted runner public IP provisioning#3627
krukowskid wants to merge 2 commits into
integrations:mainfrom
krukowskid:fix-hosted-runner-public-ip-readiness

Conversation

@krukowskid

@krukowskid krukowskid commented Sep 2, 2026

Copy link
Copy Markdown

Resolves #3626


Before the change?

github_actions_hosted_runner returned after a single read following create or update. GitHub provisions hosted runners asynchronously, so Terraform could finish while the runner was still provisioning and persist an empty public_ips value.

After the change?

Create and update wait until the runner is ready. When static public IPs are enabled, they also wait until GitHub returns the allocated IPs, so dependent outputs are populated by the completed operation.

The implementation was prepared with Copilot assistance. The focused unit and acceptance coverage was reviewed locally, but executable tests could not run because the machine's Application Control policy blocked the Go linker; GitHub Actions provides the executable validation.

Pull request checklist

  • Schema migrations have been created if needed (not needed; the state schema shape is unchanged)
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

Poll hosted runners after create and update until they are ready and static public IPs are available.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

👋 Hi, and thank you for this contribution!

This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can.

You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions.


🤖 This is an automated message.

@github-actions github-actions Bot added the Type: Bug Something isn't working as documented label Sep 2, 2026
@deiga
deiga requested a balanced review from Copilot September 3, 2026 03:42

Copilot AI 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.

🟡 Changes recommended

Update polling may accept stale pre-update state, and update-specific acceptance coverage is missing.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds readiness polling for hosted runner creation and updates, including static public IP provisioning.

Changes:

  • Adds configurable create/update polling timeouts.
  • Waits for runner readiness and public IP allocation.
  • Updates tests, examples, and documentation.
File summaries
File Description
templates/resources/actions_hosted_runner.md.tmpl Documents polling behavior and timeouts.
github/resource_github_actions_hosted_runner.go Implements readiness polling.
github/resource_github_actions_hosted_runner_test.go Adds provisioning-state coverage.
examples/resources/actions_hosted_runner/example_3.tf Demonstrates timeout configuration.
docs/resources/actions_hosted_runner.md Updates generated resource documentation.
Review details

Suppressed comments (2)

github/resource_github_actions_hosted_runner.go:498

  • The new update wait path is not exercised by the acceptance changes: the only static-IP scenario creates a runner with public_ip_enabled = true, while the update scenarios never enable static IPs or assert status/public_ips after an update. Add an acceptance step that updates public_ip_enabled from false to true and verifies both status = "Ready" and a populated public_ips.0.prefix; otherwise regressions specific to PATCH polling remain undetected.
	if err := waitForRunnerReady(ctx, client, orgName, runnerID, d.Get("public_ip_enabled").(bool), d.Timeout(schema.TimeoutUpdate)); err != nil {

github/resource_github_actions_hosted_runner_test.go:202

  • This new assertion covers static-IP provisioning only during creation. The PR also changes the update path to wait for IP allocation, but no acceptance step enables static IPs on an existing runner and verifies Ready plus a populated public_ips; the existing update tests change only name/count/size. Add an update acceptance case so the API-facing regression described by this PR is covered.
			resource.TestCheckResourceAttr(
				"github_actions_hosted_runner.test", "status",
				"Ready",
			),
			resource.TestCheckResourceAttrSet(
				"github_actions_hosted_runner.test", "public_ips.0.prefix",
			),
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread github/resource_github_actions_hosted_runner.go Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Something isn't working as documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: github_actions_hosted_runner does not wait for public IP provisioning

2 participants