Skip to content

[MAINT] Fix actions_hosted_runner tests#3521

Open
deiga wants to merge 16 commits into
integrations:mainfrom
F-Secure-web:fix-actions-hosted-runner-test-resource-names
Open

[MAINT] Fix actions_hosted_runner tests#3521
deiga wants to merge 16 commits into
integrations:mainfrom
F-Secure-web:fix-actions-hosted-runner-test-resource-names

Conversation

@deiga

@deiga deiga commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Resolves #ISSUE_NUMBER


Before the change?

  • resource_github_actions_hosted_runner tests have naming collisions
  • resource_github_actions_hosted_runner uses legacy patterns

After the change?

  • resource_github_actions_hosted_runner tests use ConfigStateChecks and ConfigPlanChecks
  • Ensure resource_github_actions_hosted_runner tests don't use conflicting names
  • Refactors resource_github_actions_hosted_runner to use Context-aware CRUD functions
  • Refactors resource_github_actions_hosted_runner to not call Read after Update and Create
  • Refactors resource_github_actions_hosted_runner to use go-github API methods
  • Adds sweeper for Organization Runner Groups

Pull request checklist

  • Schema migrations have been created if needed (example)
  • 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

deiga added 14 commits July 3, 2026 12:59
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
…_error`

Signed-off-by: Timo Sand <timo.sand@f-secure.com>
…figStateChecks`

Signed-off-by: Timo Sand <timo.sand@f-secure.com>
…cks` and `ConfigPlanChecks`

Signed-off-by: Timo Sand <timo.sand@f-secure.com>
…lanChecks`

Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
…` API methods

Signed-off-by: Timo Sand <timo.sand@f-secure.com>
…are CRUD functions

Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
@github-actions

github-actions Bot commented Jul 5, 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 Jul 5, 2026
deiga added 2 commits July 5, 2026 21:35
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
@deiga deiga marked this pull request as ready for review July 5, 2026 18:36
@stevehipwell stevehipwell added this to the v6.14.0 milestone Jul 6, 2026

@stevehipwell stevehipwell 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.

Just a quick pre-review, the comments apply to all matching patterns not just the ones I commented on.

}

func expandImage(imageList []any) map[string]any {
func expandImage(imageList []any) github.HostedRunnerImage {

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.

It's probably worth moving the helper functions ot the bottom of the file to make the file layout clearer.

}

func resourceGithubActionsHostedRunnerCreate(d *schema.ResourceData, meta any) error {
func resourceGithubActionsHostedRunnerCreate(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics {

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.

Suggested change
func resourceGithubActionsHostedRunnerCreate(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics {
func resourceGithubActionsHostedRunnerCreate(ctx context.Context, d *schema.ResourceData, m any) diag.Diagnostics {


if v, ok := d.GetOk("public_ip_enabled"); ok {
payload["enable_static_ip"] = v.(bool)
if v, okExists := d.GetOkExists("public_ip_enabled"); okExists { //nolint:staticcheck // SA1019: d.GetOkExists is deprecated but necessary for bool fields

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.

This isn't required as the value is optional with a default so it's always set one way; d.Get would be fine here.

req.Image.Version = new(runnerImageVersion)
}

if v, ok := d.GetOk("image_gen"); ok {

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.

This can be swapped for d.Get as d.GotOk isn't useful for bool values.

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.

2 participants