feat(ir): add typed helper for NuGetCommand@2#1047
Merged
Conversation
Adds nuget_command_step() factory function to src/compile/ir/tasks.rs. NuGetCommand@2 is already used in engine.rs as a raw YAML string; this typed helper is the first step toward replacing that hand-crafted YAML. - nuget_command_step(command) sets task = "NuGetCommand@2" and the display name to "NuGet <command>"; all per-command optional inputs (solution, feedsToUse, vstsFeed, packagesToPush, arguments, etc.) are applied via .with_input(…) on the returned TaskStep. - Five unit tests covering restore, push (with feed), custom (with arguments), all supported commands, and optional restore inputs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Open
jamesadevine
approved these changes
Jun 16, 2026
This was referenced Jun 15, 2026
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
nuget_command_step()forNuGetCommand@2to the ado-aw typed task IR.Motivation
NuGetCommand@2is already used inengine.rsas a hand-crafted raw YAML string to install the Copilot CLI from an Azure Artifacts NuGet feed. This PR introduces a well-typed helper that eliminates the need to hand-craftTaskStep::new(...)with raw string inputs, providing a clear API for callers and making the required/optional input boundary explicit.Changes
src/compile/ir/tasks.rs:nuget_command_step()factory function with full doc comment covering all four command modes (restore,push,pack,custom) and their optional inputsADO Task Reference
NuGetCommand@2command(restore|push|pack|custom)arguments(custom),solution(restore),vstsFeed(restore/push),packagesToPush(push),packagesToPack(pack)Validation
cargo build --all-targetscargo testcargo 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.