Skip to content

feat(ir): add typed builder for UseNode@1#1148

Merged
jamesadevine merged 1 commit into
mainfrom
feat/ir-use-node-4496cb043d305bf7
Jun 22, 2026
Merged

feat(ir): add typed builder for UseNode@1#1148
jamesadevine merged 1 commit into
mainfrom
feat/ir-use-node-4496cb043d305bf7

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a typed builder struct for UseNode@1 to the ado-aw IR, and converts two stringly-typed TaskStep::new("UseNode@1", ...) call sites to use it.

Motivation

UseNode@1 appears in two production compiler paths with raw string input keys:

  1. src/compile/extensions/ado_script.rsinstall_and_download_steps_typed builds a UseNode@1 step to install Node.js 22.x before downloading the ado-script bundle.
  2. src/runtimes/node/extension.rsnode_install_task_step builds 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: new UseNode builder struct with typed setters for all inputs and a #[cfg(test)] mod tests with four unit tests
  • src/compile/ir/tasks/mod.rs: pub mod use_node; declaration (alphabetical)
  • src/compile/extensions/ado_script.rs: converted TaskStep::new("UseNode@1", ...)UseNode::new("22.x").into_step(); removed now-unused TaskStep import
  • src/runtimes/node/extension.rs: converted node_install_task_step to use UseNode::new(version).into_step()

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 · 968.4 AIC · ⌖ 52.5 AIC · ⊞ 38K ·

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 jamesadevine marked this pull request as ready for review June 22, 2026 10:30
@jamesadevine jamesadevine merged commit 90511fb into main Jun 22, 2026
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