terraform provider should never in place edit webhook
This is related to gitlab#384326 (comment 1686775884). An update was made to the webhook API such that an edit to a webhook stomped on the token. We use a gitlab project to manage gitlab with terraform. That project has access to the secret, so terraform can include the secret contents in the update, but the gitlab terraform provider doesn't know it needs to do that.
For example, when we change the webhook address, terraform generates this plan:
# module.project["mygroup/myproject"].gitlab_project_hook.webhooks["myhook"] will be updated in-place
~ resource "gitlab_project_hook" "webhooks" {
id = "1407:437"
~ url = "https://myhookhandler/api/v1" -> "https://myhookhandler/api/v2"
# (17 unchanged attributes hidden)
}
This resulted in terraform blanking out the token for all the updated webhooks, which in turn resulted in 401s getting sent back from our webhook server. And the only way to fix it was to manually go into each project and set the secret in the GUI.
Terraform should force recreate webhooks. Or webhooks should assume that if no token was passed in they shouldn't delete the one they have.