feat(ir): add typed helper for CmdLine@2#1083
Merged
Merged
Conversation
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>
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 factory function
cmd_line_step()forCmdLine@2to the ado-aw IR task helpers.Motivation
Previously, any code that needed to emit a
CmdLine@2ADO task step had to hand-craftTaskStep::new("CmdLine@2", ...)with raw string inputs. This PR introduces a well-typedhelper that names the required
scriptinput as a positional parameter and makes theoptional inputs (
workingDirectory,failOnStderr) discoverable via.with_input(...).CmdLine@2is the cross-platform command-line script runner — Bash on Linux/macOS,cmd.exeon 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 commentsrc/compile/ir/tasks.rs: four unit tests covering the basic shape, working-directory override, fail-on-stderr flag, and multiline script bodiesADO Task Reference
CmdLine@2script(the inline script text)workingDirectory(working directory),failOnStderr(bool string, default"false")Usage example
Validation
cargo build --all-targetscargo test(4 new tests pass, 2037 total)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.