Closed ianchesal closed 11 months ago
Thanks @ianchesal I got you to move this but now this does seem more related to #409 than I originally thought. That's okay though, we'll keep you updated here as well.
I think this comment also applies then: https://github.com/buildkite/terraform-provider-buildkite/issues/409#issuecomment-1742862386
Hi @ianchesal, we've released v1.0.2 with a fix for this. Can you give it a shot and let us know if it still doesn't work or raise a new issue if some other bug comes up
I'm still seeing invalid attribute value errors for attributes in the provider_setting
block when I run terraform refresh
during the upgrade.
For the example above it's:
╷
│ Error: Invalid Attribute Value
│
│ with buildkite_pipeline.pipeline["persona-identity"],
│ on main.tf line 1, in resource "buildkite_pipeline" "pipeline":
│ 1: resource "buildkite_pipeline" "pipeline" {
│
│ Attribute provider_settings.filter_enabled true, got: false
╵
╷
│ Error: Invalid Attribute Value
│
│ with buildkite_pipeline.pipeline["persona-identity"],
│ on main.tf line 1, in resource "buildkite_pipeline" "pipeline":
│ 1: resource "buildkite_pipeline" "pipeline" {
│
│ Attribute provider_settings.pull_request_branch_filter_enabled true, got: false
╵
Based on the docs, filter_enabled
seems like it should be fine to use here. We're BitBucket, not Github, so trigger_mode = "code"
shouldn't apply.
For pull_request_branch_filter_enabled
-- docs say it's only valid if build_pull_requests = true
but does that mean I can't include this if build_pull_requests = false
? Would seem odd to not be able to have it there even if it's redundant.
These problems should be reproducible with the example I provided in the first post on this thread.
Oops I see we have missed a piece of validation in the logic. I'll create a release a fix for that
For pull_request_branch_filter_enabled -- docs say it's only valid if build_pull_requests = true but does that mean I can't include this if build_pull_requests = false? Would seem odd to not be able to have it there even if it's redundant.
That's correct, unless build_pull_requests
is set and set to true, you cannot specify the filter enabled and by extension the filter condition
@ianchesal We've discussed as a team and opted to remove the validation on the provider_settings attribute. It was not working correctly and quite complex to get it correct. It's been released as 1.0.3 so you should be able to try that out now
@jradtilbrook thank you! I'll give 1.0.3 a go. I like the thought of doing pre-API call validation, but branching logic is ugly-hard in Terraform so I appreciate you helping me avoiding having to attempt that in my module.
@jradtilbrook 1.0.3 seems to be working for me! Thanks!
Describe the bug I'm using a modular approach to defining my pipelines and I'm getting a high number of errors for instances of the module when I move my provider version from 0.27.0 to 1.0.0 and follow the upgrade steps.
On
plan
, for each instance of the module, I see:And:
In the plan output. I get both errors for every instance of the module.
To Reproduce
Here is my modular definition block:
And here are my
variables.tf
for one instance of the module:Expected behavior Following the upgrade guide, I was expecting a fairly straightforward upgrade to 1.0.0 from 0.27.0. I didn't think any of our structure here was really pushing limits.
Additional context Since we're not actually overriding the default value of
pull_request_branch_filter_enabled
in this instance of the module, I deleted it to see if I could get it to plan/apply. Terraform just complains about one of the other settings in theprovider_settings
block when I do that. Feels like it is not so much about the setting, and more that we're doing a lookup with a default value for the setting in our case.