feat(ir): add typed helper for Npm@1#1077
Draft
github-actions[bot] wants to merge 1 commit into
Draft
Conversation
Adds npm_step() factory function to src/compile/ir/tasks.rs for the Npm@1 ADO built-in task. Required input (command) is positional; optional inputs (workingDir, verbose, customCommand, customRegistry, customFeed, publishRegistry, publishFeed, etc.) are applied via .with_input(…) on the returned TaskStep. Six unit tests cover install, ci, publish, custom with workingDir, publish with Azure Artifacts feed, and install with a custom feed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Open
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 for
Npm@1to the ado-aw IR (src/compile/ir/tasks.rs).Motivation
Previously, any code that needed to emit an
Npm@1pipeline step had to hand-craftTaskStep::new("Npm@1", ...)with raw string inputs. This PR introduces a well-typednpm_step()helper that makes the required/optional input boundary explicit and self-documenting,consistent with the existing typed helpers for
UseNode@1,DotNetCoreCLI@2, etc.Changes
src/compile/ir/tasks.rs:npm_step(command)factory function + 6 unit testsADO Task Reference
Npm@1command("install"|"ci"|"publish"|"custom")workingDir,verbose,customCommand,customRegistry,customFeed,customEndpoint,publishRegistry,publishFeed,publishEndpoint,publishPackageMetadataFunction signature
Required input is positional; optional inputs are applied via
.with_input(...)on the returnedTaskStep:Validation
cargo build --all-targetscargo test(2038 unit + 127 integration tests pass)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.