feat(ir): add typed builder for UseNode@1#1148
Merged
Merged
Conversation
Add `UseNode` builder struct to `src/compile/ir/tasks/use_node.rs`
with typed setters for all inputs (`version`, `checkLatest`,
`force32bit`, `retryCountOnDownloadFails`, `delayBetweenRetries`).
Convert two stringly-typed `TaskStep::new("UseNode@1", ...)` call sites:
- `src/compile/extensions/ado_script.rs`: production install step in
`install_and_download_steps_typed`
- `src/runtimes/node/extension.rs`: `node_install_task_step` factory
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jamesadevine
approved these changes
Jun 22, 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 builder struct for
UseNode@1to the ado-aw IR, and converts two stringly-typedTaskStep::new("UseNode@1", ...)call sites to use it.Motivation
UseNode@1appears in two production compiler paths with raw string input keys:src/compile/extensions/ado_script.rs—install_and_download_steps_typedbuilds aUseNode@1step to install Node.js 22.x before downloading the ado-script bundle.src/runtimes/node/extension.rs—node_install_task_stepbuilds the install step for the Node.js runtime.This PR introduces a typed builder struct (
new(version)+ typed optional setters +into_step()) so the version is positional, optional inputs are type-checked, and call sites no longer use stringly-typed input keys.Changes
src/compile/ir/tasks/use_node.rs: newUseNodebuilder struct with typed setters for all inputs and a#[cfg(test)] mod testswith four unit testssrc/compile/ir/tasks/mod.rs:pub mod use_node;declaration (alphabetical)src/compile/extensions/ado_script.rs: convertedTaskStep::new("UseNode@1", ...)→UseNode::new("22.x").into_step(); removed now-unusedTaskStepimportsrc/runtimes/node/extension.rs: convertednode_install_task_stepto useUseNode::new(version).into_step()ADO Task Reference
UseNode@1version(Node.js version spec, e.g."22.x","20.x")checkLatest(bool),force32bit(bool),retryCountOnDownloadFails(string),delayBetweenRetries(string)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.