-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
branch_policy_build_validation and filename_patterns list order issues #539
Comments
Interestingly, this issue was opened around the same time as v0.2.0 of this provider was released – the first release in about three months, and we first noticed this bug today. Coincidence? |
I've tested this with 0.1.8 , as well as different terraform versions .same results |
We are running 0.1.8. |
When will this be released ? |
will released in v0.2.1 |
Do you have a timeframe for that release ? Weeks , months ? |
@thesutex weeks, depends on the new features and bug fixes. |
Community Note
Terraform (and Azure DevOps Provider) Version
Terraform v1.1.6
on linux_amd64
Affected Resource(s)
azuredevops_branch_policy_build_validation
Terraform Configuration Files
input example (from terragrunt)
terraform:
Debug Output
Panic Output
Expected Behavior
This module takes a map of terraform modules and creates build validation resources in AzureDevops. It should do this and keep the order used in settings block - filename_patterns
Actual Behavior
In around 50% of the cases the order of the filepattern in is wrong, and since ADO considers the list sequentially left to right (as noted on resource) half of the rules has wrong filenamepattern. It seems to ignore order of list in code,
code
filename_patterns = ["/${lookup(each.value, "cloud_provider", var.cloud_provider)}/${each.key}/*","!/${lookup(each.value, "cloud_provider", var.cloud_provider)}/${each.key}/*.md"]
examples of azdevops gui:
in the state they all look the same with the exclude first
It seems to be related to the lookup function , if I set the filter to this:
filename_patterns = ["/${lookup(each.value, "cloud_provider", var.cloud_provider)}/${each.key}/*", "!/*.md"]
it corrects "most" of the policies
It shouldnt sort the list at all if I read the documentation correct.
Steps to Reproduce
This codebit is a part of a bigger module that creates pipelines, generates yaml, creates build definitions etc. Its been working like a charm untill i added the exeption for the "*.md" files in the buld validation step.
terra{grunt/form} apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: