Skip to content

feat(ir): add typed helper for CmdLine@2#1083

Merged
jamesadevine merged 1 commit into
mainfrom
feat/ir-cmd-line-v2-2d465764d0ae4456
Jun 18, 2026
Merged

feat(ir): add typed helper for CmdLine@2#1083
jamesadevine merged 1 commit into
mainfrom
feat/ir-cmd-line-v2-2d465764d0ae4456

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a typed factory function cmd_line_step() for CmdLine@2 to the ado-aw IR task helpers.

Motivation

Previously, any code that needed to emit a CmdLine@2 ADO task step had to hand-craft
TaskStep::new("CmdLine@2", ...) with raw string inputs. This PR introduces a well-typed
helper that names the required script input as a positional parameter and makes the
optional inputs (workingDirectory, failOnStderr) discoverable via .with_input(...).

CmdLine@2 is the cross-platform command-line script runner — Bash on Linux/macOS,
cmd.exe on Windows — and one of the most widely-used ADO built-in tasks.

Changes

  • src/compile/ir/tasks.rs: cmd_line_step(script) factory function with doc comment
  • src/compile/ir/tasks.rs: four unit tests covering the basic shape, working-directory override, fail-on-stderr flag, and multiline script bodies

ADO Task Reference

Usage example

use crate::compile::ir::tasks::cmd_line_step;

// Minimal — script only
let step = Step::Task(cmd_line_step("echo hello"));

// With optional inputs
let step = Step::Task(
    cmd_line_step("my-tool --verbose")
        .with_input("workingDirectory", "$(Build.SourcesDirectory)")
        .with_input("failOnStderr", "true"),
);

Validation

  • cargo build --all-targets
  • cargo test (4 new tests pass, 2037 total)
  • 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 · 578.1 AIC · ⌖ 26 AIC · ⊞ 36.6K ·

Adds `cmd_line_step()` to `src/compile/ir/tasks.rs` — a typed factory
for the `CmdLine@2` ADO task that runs an inline script on Linux/macOS
(Bash) or Windows (cmd.exe).

The helper takes the required `script` input as a positional parameter;
optional inputs (`workingDirectory`, `failOnStderr`) are applied via
`.with_input()` on the returned `TaskStep`.

Four unit tests cover the basic shape, working-directory override,
fail-on-stderr flag, and multiline script bodies.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesadevine jamesadevine marked this pull request as ready for review June 18, 2026 05:38
@jamesadevine jamesadevine merged commit 14ebe83 into main Jun 18, 2026
@jamesadevine jamesadevine deleted the feat/ir-cmd-line-v2-2d465764d0ae4456 branch June 18, 2026 05:39
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