Open HansBraun opened 2 years ago
When I create a webhook with parameter 'active' equals false it is not deactivated. Example terraform configuration:
resource "bitbucketserver_repository_webhook" "main" { project = "SomeBitbucket_project" repository ="SomeRepo" name = "someName" webhook_url = "someURL" secret = "xxxxxxxxxx" events = ["pr:opened"] active = false }
Looking at the Debug log with debug level TRACE it looks like the aatribute active isn't in the payload.
_2022-10-12T14:55:11.807+0200 [DEBUG] module.project["tf-modules"].module.bitbucket_repository["waf"].module.webhook["tf-module"].bitbucketserver_repository_webhook.main: applying the planned Create change 2022-10-12T14:55:11.807+0200 [TRACE] GRPCProvider: ApplyResourceChange 2022-10-12T14:55:11.807+0200 [DEBUG] provider.terraform-provider-bitbucketserver_v1.7.1: 2022/10/12 14:55:11 [DEBUG] Sending request to POST https://git.proalpha.com/rest/api/1.0/projects/CCE_MOD/repos/waf/webhooks 2022-10-12T14:55:11.807+0200 [DEBUG] provider.terraform-provider-bitbucketserver_v1.7.1: 2022/10/12 14:55:11 [DEBUG] With payload {"name":"tf-module","createdDate":-62135596800,"updatedDate":-62135596800,"url":"https://pipeline.shared-dev.proalpha.dev/el-build-terraform-module-listener","events":["pr:opened","repo:refs_changed","pr:comment:added"],"configuration":{"secret":"xxxxxxxxxx"}} 2022-10-12T14:55:11.915+0200 [DEBUG] provider.terraform-provider-bitbucketserver_v1.7.1: 2022/10/12 14:55:11 [DEBUG] Resp: &{201 Created 201 HTTP/2.0 2 0 map[Content-Type:[application/json;charset=UTF-8] Date:[Wed, 12 Oct 2022 12:55:12 GMT] Location:[https://git.proalpha.com/rest/api/1.0/projects/CCE_MOD/repos/waf/webhooks/706] Server:[nginx] Set-Cookie:[AWSALB=xxxxxxxxxxxxxxxxxxxxxxx; Expires=Wed, 19 Oct 2022 12:55:12 GMT; Path=/ AWSALBCORS=7GEmNbUNqu6N9L6U45kwLSzHpTfVRB2qxf3BSfcLRkCJUioKMvUf7mYFKZOcvEiB6ECIjz8jrmgVDv2duPd31iHFyiWjAsFoX9KkMIRuWjoesM5M9+hEticWx5KM; Expires=Wed, 19 Oct 2022 12:55:12 GMT; Path=/; SameSite=None; Secure] Strict-Transport-Security:[max-age=31536000;] Vary:[accept-encoding] X-Arequestid:[U2YYP7x895x5191449x0] X-Auserid:[2414] X-Ausername:[pa-gitops-bot] X-Content-Type-Options:[nosniff]] 0xc000494150 -1 [] false true map[] 0xc000464d00 0xc000582000} Err: 2022-10-12T14:55:11.915+0200 [DEBUG] provider.terraform-provider-bitbucketserver_v1.7.1: 2022/10/12 14:55:11 [DEBUG] Sending request to GET https://someURL/rest/api/1.0/projects/SomeBitbucket_project/repos/SomeRepo/webhooks/706 2022-10-12T14:55:11.954+0200 [DEBUG] provider.terraform-provider-bitbucketserver_v1.7.1: 2022/10/12 14:55:11 [DEBUG] Resp: &{200 OK 200 HTTP/2.0 2 0 map[Content-Type:[application/json;charset=UTF-8] Date:[Wed, 12 Oct 2022 12:55:12 GMT] Server:[nginx] Set-Cookie:[AWSALB=7YmxwDxFzZoBDIftqMypJCnbhSkazlat7gQXzXuHU5kHSLiRBhdIUcVcLWDdqr+WKjiU9ZuRoXDsk4xFee4fcyau3j4bbSSQOPzAc/vH7kCGPtPKwx6yS1/xPygS; Expires=Wed, 19 Oct 2022 12:55:12 GMT; Path=/ AWSALBCORS=7YmxwDxFzZoBDIftqMypJCnbhSkazlat7gQXzXuHU5kHSLiRBhdIUcVcLWDdqr+WKjiU9ZuRoXDsk4xFee4fcyau3j4bbSSQOPzAc/vH7kCGPtPKwx6yS1/xPygS; Expires=Wed, 19 Oct 2022 12:55:12 GMT; Path=/; SameSite=None; Secure] Strict-Transport-Security:[max-age=31536000;] Vary:[accept-encoding] X-Arequestid:[U2YYP7x895x5191450x0] X-Auserid:[2414] X-Ausername:[pa-gitops-bot] X-Content-Type-Options:[nosniff]] 0xc0003372c0 -1 [] false true map[] 0xc000171700 0xc0004ac420} Err: 2022-10-12T14:55:11.955+0200 [WARN] Provider "provider[\"registry.terraform.io/gavinbunney/bitbucketserver\"]" produced an unexpected new value for module.project["tf-modules"].module.bitbucket_repository["waf"].module.webhook["tf-module"].bitbucketserver_repository_webhook.main, but we are tolerating it because it is using the legacy plugin SDK. The following problems may be the cause of any confusing errors from downstream operations:
I created a PR to fix this. https://github.com/gavinbunney/terraform-provider-bitbucketserver/pull/54
When I create a webhook with parameter 'active' equals false it is not deactivated. Example terraform configuration:
Looking at the Debug log with debug level TRACE it looks like the aatribute active isn't in the payload.
_2022-10-12T14:55:11.807+0200 [DEBUG] module.project["tf-modules"].module.bitbucket_repository["waf"].module.webhook["tf-module"].bitbucketserver_repository_webhook.main: applying the planned Create change 2022-10-12T14:55:11.807+0200 [TRACE] GRPCProvider: ApplyResourceChange 2022-10-12T14:55:11.807+0200 [DEBUG] provider.terraform-provider-bitbucketserver_v1.7.1: 2022/10/12 14:55:11 [DEBUG] Sending request to POST https://git.proalpha.com/rest/api/1.0/projects/CCE_MOD/repos/waf/webhooks 2022-10-12T14:55:11.807+0200 [DEBUG] provider.terraform-provider-bitbucketserver_v1.7.1: 2022/10/12 14:55:11 [DEBUG] With payload {"name":"tf-module","createdDate":-62135596800,"updatedDate":-62135596800,"url":"https://pipeline.shared-dev.proalpha.dev/el-build-terraform-module-listener","events":["pr:opened","repo:refs_changed","pr:comment:added"],"configuration":{"secret":"xxxxxxxxxx"}} 2022-10-12T14:55:11.915+0200 [DEBUG] provider.terraform-provider-bitbucketserver_v1.7.1: 2022/10/12 14:55:11 [DEBUG] Resp: &{201 Created 201 HTTP/2.0 2 0 map[Content-Type:[application/json;charset=UTF-8] Date:[Wed, 12 Oct 2022 12:55:12 GMT] Location:[https://git.proalpha.com/rest/api/1.0/projects/CCE_MOD/repos/waf/webhooks/706] Server:[nginx] Set-Cookie:[AWSALB=xxxxxxxxxxxxxxxxxxxxxxx; Expires=Wed, 19 Oct 2022 12:55:12 GMT; Path=/ AWSALBCORS=7GEmNbUNqu6N9L6U45kwLSzHpTfVRB2qxf3BSfcLRkCJUioKMvUf7mYFKZOcvEiB6ECIjz8jrmgVDv2duPd31iHFyiWjAsFoX9KkMIRuWjoesM5M9+hEticWx5KM; Expires=Wed, 19 Oct 2022 12:55:12 GMT; Path=/; SameSite=None; Secure] Strict-Transport-Security:[max-age=31536000;] Vary:[accept-encoding] X-Arequestid:[U2YYP7x895x5191449x0] X-Auserid:[2414] X-Ausername:[pa-gitops-bot] X-Content-Type-Options:[nosniff]] 0xc000494150 -1 [] false true map[] 0xc000464d00 0xc000582000} Err:
2022-10-12T14:55:11.915+0200 [DEBUG] provider.terraform-provider-bitbucketserver_v1.7.1: 2022/10/12 14:55:11 [DEBUG] Sending request to GET https://someURL/rest/api/1.0/projects/SomeBitbucket_project/repos/SomeRepo/webhooks/706
2022-10-12T14:55:11.954+0200 [DEBUG] provider.terraform-provider-bitbucketserver_v1.7.1: 2022/10/12 14:55:11 [DEBUG] Resp: &{200 OK 200 HTTP/2.0 2 0 map[Content-Type:[application/json;charset=UTF-8] Date:[Wed, 12 Oct 2022 12:55:12 GMT] Server:[nginx] Set-Cookie:[AWSALB=7YmxwDxFzZoBDIftqMypJCnbhSkazlat7gQXzXuHU5kHSLiRBhdIUcVcLWDdqr+WKjiU9ZuRoXDsk4xFee4fcyau3j4bbSSQOPzAc/vH7kCGPtPKwx6yS1/xPygS; Expires=Wed, 19 Oct 2022 12:55:12 GMT; Path=/ AWSALBCORS=7YmxwDxFzZoBDIftqMypJCnbhSkazlat7gQXzXuHU5kHSLiRBhdIUcVcLWDdqr+WKjiU9ZuRoXDsk4xFee4fcyau3j4bbSSQOPzAc/vH7kCGPtPKwx6yS1/xPygS; Expires=Wed, 19 Oct 2022 12:55:12 GMT; Path=/; SameSite=None; Secure] Strict-Transport-Security:[max-age=31536000;] Vary:[accept-encoding] X-Arequestid:[ U2YYP7x895x5191450x0] X-Auserid:[2414] X-Ausername:[pa-gitops-bot] X-Content-Type-Options:[nosniff]] 0xc0003372c0 -1 [] false true map[] 0xc000171700 0xc0004ac420} Err:
2022-10-12T14:55:11.955+0200 [WARN] Provider "provider[\"registry.terraform.io/gavinbunney/bitbucketserver\"]" produced an unexpected new value for module.project["tf-modules"].module.bitbucket_repository["waf"].module.webhook["tf-module"].bitbucketserver_repository_webhook.main, but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations: