fix: wait for hosted runner public IP provisioning - #3627
Conversation
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>
|
👋 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. |
There was a problem hiding this comment.
🟡 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 assertstatus/public_ipsafter an update. Add an acceptance step that updatespublic_ip_enabledfrom false to true and verifies bothstatus = "Ready"and a populatedpublic_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
Readyplus a populatedpublic_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.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolves #3626
Before the change?
github_actions_hosted_runnerreturned 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 emptypublic_ipsvalue.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
Does this introduce a breaking change?
Please see our docs on breaking changes to help!