Closed zhemaituk closed 8 months ago
Possibly related to removed pagelen param from: https://github.com/DrFaust92/bitbucket-go-client/commit/95bee263c230f5ae4f44846789e346521897cbaf#diff-2dfbd21797419725369cf212d25a1ab3fb87f927904559673880d359c0497f1dL1693
cc: @DrFaust92
The problem is that in https://github.com/DrFaust92/terraform-provider-bitbucket/blob/master/bitbucket/resource_deployment_variable.go#L108 the code would need to iterate over all pages by examining rvRes.Next
and incrementing the Page
attribute of the PipelinesApiGetDeploymentVariablesOpts
argument to GetDeploymentVariables()
to collect rvRes.Values
from all pages. That would be the least invasive solution I guess. The documentation on the next
field in the Bitbucket API response (https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-deployments-config-environments-environment-uuid-variables-get) suggest using the raw URL from it instead of consturcting your own next-page URLs, but that would necessitate making changes to bitbucket-client-go.
Iterating would be ideal. But even simply adding ?pagelen=100 would address most of the practical cases.
I’ll check and get to patch quickly
On Thu, 2 Nov 2023 at 16:59 Andrei Zhemaituk @.***> wrote:
Iterating would be ideal. But even simply adding ?pagelen=100 would address most of the practical cases.
— Reply to this email directly, view it on GitHub https://github.com/DrFaust92/terraform-provider-bitbucket/issues/164#issuecomment-1790900879, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIA2W7TTKYPIZLW3EG7BP23YCOYOHAVCNFSM6AAAAAAYF547FWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJQHEYDAOBXHE . You are receiving this because you were mentioned.Message ID: @.***>
added to 2.37.2, please check
Thanks @DrFaust92 , 2.37.2 works like a charm.
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
19 deployment variables are created just once.
Actual Behavior
Every time 9 variables appear in terraform plan, even though the variables already exist, creation fails as variable already exist.
Workaround
Downgrade to 2.32.0.
References