feat(ir): add typed builder for AzureResourceManagerTemplateDeployment@3 - #1232
Merged
jamesadevine merged 3 commits intoJul 1, 2026
Merged
Conversation
Add a command-dispatch typed builder struct for `AzureResourceManagerTemplateDeployment@3`, covering all four deployment scopes (Resource Group, Subscription, Management Group, Tenant) and the Resource Group delete action. - `ArmTemplateDeployment`: main builder wrapping `ArmDeploymentCommand` - `ArmDeploymentCommand`: enum with five variants, each carrying a scope-specific struct so invalid scope/input combos are unrepresentable - `ArmDeploymentMode`: typed enum for `Incremental` / `Complete` / `Validation` deployment modes - `ArmTemplateSource`: typed enum for `Linked artifact` vs `URL of the file` with a shared `with_parameters_file` setter - Per-scope structs (`ResourceGroupDeploy`, `ResourceGroupDelete`, `SubscriptionDeploy`, `ManagementGroupDeploy`, `TenantDeploy`) with typed optional setters for shared deploy options - 7 unit tests covering all variants, both template sources, and optional inputs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Open
…deployment-v3-2422891903cf792b
…p validation Integrates the AzureResourceManagerTemplateDeployment@3 typed builder with the front-matter task-step advisory validation added in #1096. The task dispatches on deploymentScope and (for Resource Group) on action, so it supplies a bespoke validate_inputs: scope/action-specific required inputs are checked and removed, then the remainder is validated against a deny_unknown_fields template-deploy schema (empty for DeleteRG), reporting inputs used for the wrong scope/action. ArmDeploymentMode derives Deserialize; defaults (scope=Resource Group, action=Create Or Update Resource Group) and input set match the AzureResourceManagerTemplateDeploymentV3 task.json. Registered in parse.rs VALIDATORS. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jamesadevine
marked this pull request as ready for review
July 1, 2026 14:09
jamesadevine
deleted the
feat/ir-arm-template-deployment-v3-2422891903cf792b
branch
July 1, 2026 14:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a typed builder struct for
AzureResourceManagerTemplateDeployment@3to the ado-aw IR.Motivation
Previously, any code that needed to emit this ADO task step had to hand-craft
TaskStep::new(...)with raw string input keys and no compile-time enforcement of which inputs are required for which deployment scope. This PR introduces a command-dispatch typed builder so required inputs are positional, scope/input combinations are type-checked, and call sites stop using stringly-typed keys.Changes
src/compile/ir/tasks/arm_template_deployment.rs: newArmTemplateDeploymentbuilder struct with the following types:ArmDeploymentCommand— five-variant enum (ResourceGroupDeploy,ResourceGroupDelete,SubscriptionDeploy,ManagementGroupDeploy,TenantDeploy); each variant carries its own scope-specific struct so invalid scope/input combos are unrepresentableArmDeploymentMode— typed enum forIncremental/Complete/ValidationArmTemplateSource— typed enum forLinked artifactvsURL of the filewith a sharedwith_parameters_filesetterdeployment_mode,override_parameters,deployment_name,deployment_outputs,add_spn_to_environment,use_without_json)src/compile/ir/tasks/mod.rs:pub mod arm_template_deployment;declaration (alphabetical order)ADO Task Reference
AzureResourceManagerTemplateDeployment@3https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/azure-resource-manager-template-deployment-v3deploymentScope,azureResourceManagerConnection,subscriptionId(not for MG/Tenant),resourceGroupName(RG only),location,templateLocation,csmFile/csmFileLinkdeploymentMode,overrideParameters,deploymentName,deploymentOutputs,addSpnToEnvironment,useWithoutJSONValidation
cargo build --all-targetscargo test(7 new tests, all passing)cargo clippy --all-targets --all-features --workspace -- -D warningsCreated by the ado-task-ir-contributor workflow.
Warning
Firewall blocked 2 domains
The following domains were blocked by the firewall during workflow execution:
spsprodeus21.vssps.visualstudio.comspsprodweu4.vssps.visualstudio.comSee Network Configuration for more information.