Skip to content

feat(ir): add typed builder for AzurePowerShell@5#1127

Merged
jamesadevine merged 1 commit into
mainfrom
feat/ir-azure-powershell-v5-637557964f59f490
Jun 21, 2026
Merged

feat(ir): add typed builder for AzurePowerShell@5#1127
jamesadevine merged 1 commit into
mainfrom
feat/ir-azure-powershell-v5-637557964f59f490

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a typed builder struct for AzurePowerShell@5 to the ado-aw IR.

Motivation

Previously, any code that needed to emit an AzurePowerShell@5 step had to hand-craft TaskStep::new(...) with raw string input keys. This PR introduces a command-dispatch typed builder with file() and inline() entry points returning distinct typestate builders (AzurePowerShellFile / AzurePowerShellInline) so:

  • ScriptArguments is only available on the file builder — applying it to an inline target is a compile error rather than a silent drop.
  • The inline script body (Inline) is only accepted by the inline builder.
  • The AzurePowerShellVersion enum models the LatestVersion / OtherVersion + preferredAzurePowerShellVersion pair so callers express version intent in a single call.
  • All constrained inputs are type-checked; bool-string inputs are lowered through bool_input.

Changes

  • src/compile/ir/tasks/azure_powershell.rs: new AzurePowerShell entry-point struct + AzurePowerShellFile / AzurePowerShellInline typestate builders + ErrorActionPreference and AzurePowerShellVersion enums + #[cfg(test)] mod tests (5 tests)
  • src/compile/ir/tasks/mod.rs: pub mod azure_powershell; declaration (alphabetical order)

ADO Task Reference

Validation

  • cargo build --all-targets
  • cargo test
  • cargo clippy --all-targets --all-features --workspace -- -D warnings

Created 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.com
  • spsprodweu4.vssps.visualstudio.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "spsprodeus21.vssps.visualstudio.com"
    - "spsprodweu4.vssps.visualstudio.com"

See Network Configuration for more information.

Generated by ADO Task IR Contributor · 610.2 AIC · ⌖ 39.2 AIC · ⊞ 38.1K ·

Adds AzurePowerShell struct with file() and inline() entry points
returning distinct typestate builders (AzurePowerShellFile /
AzurePowerShellInline). ScriptArguments is only available on the file
builder; the inline script body is only accepted by the inline builder,
so mixing inputs with the wrong mode is unrepresentable.

Shared optionals (errorActionPreference, FailOnStandardError, pwsh,
workingDirectory, azurePowerShellVersion) are available on both builders
via the shared_setters! macro. The AzurePowerShellVersion enum models
the LatestVersion / OtherVersion + preferredAzurePowerShellVersion pair
so callers express intent in one call.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesadevine jamesadevine marked this pull request as ready for review June 21, 2026 07:35
@jamesadevine jamesadevine merged commit 7a51798 into main Jun 21, 2026
@jamesadevine jamesadevine deleted the feat/ir-azure-powershell-v5-637557964f59f490 branch June 21, 2026 07:35
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.

1 participant