Skip to content

feat(ir): add typed builder for AzureKeyVault@2#1132

Merged
jamesadevine merged 2 commits into
mainfrom
feat/ir-azure-key-vault-v2-92df0192ce705579
Jun 21, 2026
Merged

feat(ir): add typed builder for AzureKeyVault@2#1132
jamesadevine merged 2 commits into
mainfrom
feat/ir-azure-key-vault-v2-92df0192ce705579

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a typed builder struct for AzureKeyVault@2 to the ado-aw IR.

Motivation

Previously, any code that needed to emit an AzureKeyVault@2 step had to hand-craft TaskStep::new(...) with raw string input keys. This PR introduces a typed builder struct (new(<required>) + typed optional setters + into_step()) so required inputs are positional, optional inputs are type-checked, and call sites stop using stringly-typed keys.

AzureKeyVault@2 is one of the most commonly used enterprise ADO tasks — it downloads secrets from Azure Key Vault into pipeline variables so subsequent steps can reference them via $(secret-name). Having a typed builder makes it easy to emit this step from ado-aw compiler extensions and runtime code without error-prone string literals.

Changes

  • src/compile/ir/tasks/azure_key_vault.rs: new AzureKeyVault builder struct and its #[cfg(test)] mod tests
  • src/compile/ir/tasks/mod.rs: pub mod azure_key_vault; declaration (alphabetical order)

Builder API

use crate::compile::ir::tasks::azure_key_vault::AzureKeyVault;
use crate::compile::ir::step::Step;

// Minimal — downloads all secrets (ADO default "*")
Step::Task(AzureKeyVault::new("my-arm-connection", "my-key-vault").into_step())

// Filtered — only specific secrets
Step::Task(
    AzureKeyVault::new("my-arm-connection", "prod-vault")
        .secrets_filter("DEPLOY_TOKEN,DB_PASSWORD")
        .run_as_pre_job(true)
        .with_display_name("Download production secrets")
        .into_step()
)

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 · 754.1 AIC · ⌖ 29.3 AIC · ⊞ 38.4K ·

Introduces `AzureKeyVault` builder struct in
`src/compile/ir/tasks/azure_key_vault.rs` with:
- `new(connected_service_name, key_vault_name)` for the two required inputs
- `secrets_filter()` for comma-separated secret names (ADO default `*`)
- `run_as_pre_job()` to execute the task before the job starts
- `with_display_name()` display name override
- Five unit tests covering required inputs, optionals, wildcard filter,
  bool false, and display name override

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot mentioned this pull request Jun 21, 2026
@jamesadevine jamesadevine marked this pull request as ready for review June 21, 2026 07:35
@jamesadevine

Copy link
Copy Markdown
Collaborator

@copilot resolve merge conflicts.

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>

Copilot AI commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve merge conflicts.

Addressed in f02a040.

@jamesadevine jamesadevine merged commit f72849a into main Jun 21, 2026
@jamesadevine jamesadevine deleted the feat/ir-azure-key-vault-v2-92df0192ce705579 branch June 21, 2026 12:23
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