Closed Nkmol closed 1 year ago
Bitbucket API Error
The underlying issue is that the API request is done through a PUT
request (as the only existing modification endpoint), where the following JSON body is created when using the above config:
{
"development": {
"use_mainbranch": true
},
"production": {
"use_mainbranch": true,
"enabled": true
},
...
}
This will result in the following underlying Bitbucket API error:
{
"type": "error",
"error": {
"message": "Bad request",
"fields": {
"development.name": "Trying to update development branch to track 'a' and main branch at the same time."
}
}
}
Solution
The API solution is to pass along a name: null
in order to reset the branch model type.
In-code
I have a WIP ready (very beginner in Go :)), but making sure that the name
property is null
when not set in the HCL definition will fix this.
Terraform Version
Terraform v1.3.5
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply