terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

[BUG]: github_organization_webhook resource creation fake-failure

Open gm-hyp-2 opened this issue 1 year ago • 2 comments
trafficstars

Expected Behavior

When creating this resource:

resource "github_organization_webhook" "generic_webhook" {
  configuration {
    url          = "<hidden>"
    content_type = "json"
    insecure_ssl = false
    secret = var.gh_api_token
  }
  active = var.active_regions_api["us-west-2"]
  events = ["push", "pull_request" ]
}

This should create a new webhook, as described in the documentation: https://registry.terraform.io/providers/integrations/github/latest/docs/resources/organization_webhook#configuration

Actual Behavior

TF throws an error:

╷
│ Error: configuration.0.insecure_ssl: '' expected type 'bool', got unconvertible type 'string', value: '0'
│ 
│   with github_organization_webhook.generic_webhook,
│   on webhooks.tf line 1, in resource "github_organization_webhook" "generic_webhook":
│    1: resource "github_organization_webhook" "generic_webhook" {
│ 
╵

The problem is that we web hook actually gets created: Screenshot 2024-02-12 at 11 03 20

So the next execution will delete and recreate the resource.

Additionally, the same resource type that was created with v5.x of the provider works just fine. The bug affects only the creation of a new webhook.

Terraform Version

Terraform 1.7.2 on linux_amd64 Affected versions: v6.0.0.0-rc2 (I have tested the creation of a new webhook only on this one)

Affected Resource(s)

github_organization_webhook

Terraform Configuration Files

No response

Steps to Reproduce

No response

Debug Output

No response

Panic Output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

gm-hyp-2 avatar Feb 12 '24 10:02 gm-hyp-2

One additional comment - if I remove the key insecure_ssl and let the provider use the default, it still produces the same behavior.

gm-hyp-2 avatar Feb 12 '24 12:02 gm-hyp-2

My guess is this is related to #2133 in which we're checking and returning an error that was previously ignored. This could be a good first issue for a new contributor to handle.

kfcampbell avatar Feb 12 '24 19:02 kfcampbell