Skip to content

azuredevops_branch_policy_build_validation - Change display_name to optional - #1633

Open
v-kenntan wants to merge 1 commit into
microsoft:mainfrom
v-kenntan:v-kenntan/1625
Open

v-kenntan wants to merge 1 commit into
microsoft:mainfrom
v-kenntan:v-kenntan/1625

Conversation

@v-kenntan

Copy link
Copy Markdown
Collaborator

All Submissions:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code follows the code style of this project.
  • Have you checked to ensure there aren't other open PRs for the same update/change?

Description

Changed display_name in azuredevops_branch_policy_build_validation from required to optional to match the DevOps UI. This fixes import issues with this resource for those with an empty display_name as it was previously required and will return an error.

Does this introduce a breaking change?

  • Yes
  • No

Test Result

=== RUN   TestAccBranchPolicyBuildValidation_basic
=== PAUSE TestAccBranchPolicyBuildValidation_basic
=== RUN   TestAccBranchPolicyBuildValidation_withoutDisplayName
=== PAUSE TestAccBranchPolicyBuildValidation_withoutDisplayName
=== CONT  TestAccBranchPolicyBuildValidation_basic
=== CONT  TestAccBranchPolicyBuildValidation_withoutDisplayName
--- PASS: TestAccBranchPolicyBuildValidation_withoutDisplayName (23.60s)
--- PASS: TestAccBranchPolicyBuildValidation_basic (24.85s)
PASS
ok      github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/acceptancetests        24.863s

Related Issue(s)

Fix #1625

Other information

Comment on lines +64 to +67
displayNameAttr := ""
if displayName != "" {
displayNameAttr = fmt.Sprintf("display_name = %q", displayName)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just accept a value (including null) in this case.

"display_name": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringIsNotEmpty,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to remove the validation function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

azuredevops_branch_policy_build_validation: an imported build validation without a display name cannot be configured (display_name "" rejected)

2 participants