Skip to content

feat(check_approval): add support for pre and post approval kinds - #1556

Open
Luiz Felipe Machado (luizfelmach) wants to merge 2 commits into
microsoft:mainfrom
luizfelmach:feat/support-pre-post-approval
Open

feat(check_approval): add support for pre and post approval kinds#1556
Luiz Felipe Machado (luizfelmach) wants to merge 2 commits into
microsoft:mainfrom
luizfelmach:feat/support-pre-post-approval

Conversation

@luizfelmach

Copy link
Copy Markdown

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

Adds support for selecting the approval check kind in azuredevops_check_approval.
Azure DevOps uses different settings.definitionRef.id values for standard approvals, pre-check approvals, and post-check approvals, but the provider previously only modeled a generic approval check. This change adds a new optional approval_kind attribute so users can explicitly manage these variants through Terraform.
Supported values:

  • approval
  • pre_check
  • post_check
    This change also updates the flatten/expand logic to map approval_kind to the correct settings.definitionRef.id, updates the resource documentation, and adds test coverage for the new behavior.

Does this introduce a breaking change?

  • Yes
  • No

Test Result

$ go test -tags=all ./azuredevops/internal/service/approvalsandchecks -run 'TestCheckApproval_|TestApprovalKindDefinitionRefMapping'
ok  	github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/service/approvalsandchecks	0.003s
$ go test ./azuredevops/internal/acceptancetests -run '^TestDoesNotExist$'
ok  	github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/acceptancetests	0.005s
Related Issue(s)
Fix #0000
Other information
Azure DevOps distinguishes approval kinds using these definitionRef.id values:
- approval: 26014962-64a0-49f4-885b-4b874119a5cc
- pre_check: 0f52a19b-c67e-468f-b8eb-0ae83b532c99
- post_check: 06441319-13fb-4756-b198-c2da116894a4

@williamoconnorme

Copy link
Copy Markdown

Closes #1586

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.

2 participants