Skip to content

feat(ir): add typed helper for NuGetCommand@2#1047

Merged
jamesadevine merged 1 commit into
mainfrom
feat/ir-nuget-command-v2-b1fd707ef71995df
Jun 16, 2026
Merged

feat(ir): add typed helper for NuGetCommand@2#1047
jamesadevine merged 1 commit into
mainfrom
feat/ir-nuget-command-v2-b1fd707ef71995df

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a typed factory function nuget_command_step() for NuGetCommand@2 to the ado-aw typed task IR.

Motivation

NuGetCommand@2 is already used in engine.rs as 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-craft TaskStep::new(...) with raw string inputs, providing a clear API for callers and making the required/optional input boundary explicit.

// Example: install a package using custom command
nuget_command_step("custom")
    .with_input("arguments", "install My.Package -Version 1.0.0 -Source https://pkgs.dev.azure.com/...")

// Example: restore with an Azure Artifacts feed
nuget_command_step("restore")
    .with_input("solution", "src/MyApp.sln")
    .with_input("feedsToUse", "select")
    .with_input("vstsFeed", "myorg/myproject/myfeed")

// Example: push to internal feed
nuget_command_step("push")
    .with_input("nuGetFeedType", "internal")
    .with_input("publishVstsFeed", "myorg/myfeed")

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 inputs
  • Five new unit tests covering: restore, push with feed, custom with arguments, all supported commands, and optional restore inputs

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 · 1.1K AIC · ⌖ 19.9 AIC · ⊞ 36.1K ·

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>
@github-actions github-actions Bot mentioned this pull request Jun 16, 2026
@jamesadevine jamesadevine marked this pull request as ready for review June 16, 2026 06:11
@jamesadevine jamesadevine merged commit 513643e into main Jun 16, 2026
@jamesadevine jamesadevine deleted the feat/ir-nuget-command-v2-b1fd707ef71995df branch June 16, 2026 06:11
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