Skip to content

feat(ir): add typed builder for npmAuthenticate@0#1157

Merged
jamesadevine merged 1 commit into
mainfrom
feat/ir-npm-authenticate-v0-03e71be659d9a0ed
Jun 23, 2026
Merged

feat(ir): add typed builder for npmAuthenticate@0#1157
jamesadevine merged 1 commit into
mainfrom
feat/ir-npm-authenticate-v0-03e71be659d9a0ed

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a typed builder struct for npmAuthenticate@0 to the ado-aw IR.

Motivation

Previously, the Node.js runtime extension emitted the npmAuthenticate@0 step by hand-crafting TaskStep::new("npmAuthenticate@0", ...).with_input("workingFile", ".npmrc") with raw string keys. This PR introduces a typed builder struct (new(working_file) + typed optional setters + into_step()) so the required .npmrc path is positional, optional inputs (customEndpoint, azureDevOpsServiceConnection, feedUrl) are typed and checked, and call sites stop using stringly-typed keys.

Changes

  • src/compile/ir/tasks/npm_authenticate.rs: new NpmAuthenticate builder struct with 8 #[cfg(test)] unit tests covering required input, default display name, optional inputs, and the full inputs-together scenario
  • src/compile/ir/tasks/mod.rs: pub mod npm_authenticate; declaration (alphabetical, between npm and nuget_authenticate)
  • src/runtimes/node/extension.rs: npm_authenticate_task_step() now calls NpmAuthenticate::new(".npmrc").with_display_name(...).into_step() instead of the raw TaskStep::new call

ADO Task Reference

  • Task: npmAuthenticate@0
  • Docs: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/npm-authenticate-v0
  • Required inputs: workingFile — path to the .npmrc file to authenticate
  • Optional inputs: customEndpoint (service connections for external registries), azureDevOpsServiceConnection / workloadIdentityServiceConnection (workload identity federation), feedUrl (Azure Artifacts feed URL; required when azureDevOpsServiceConnection is set)

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 · 758.8 AIC · ⌖ 30.5 AIC · ⊞ 38.1K ·

Add NpmAuthenticate builder struct to src/compile/ir/tasks/npm_authenticate.rs.
This gives the npm registry authentication task a typed interface with:
- required working_file input as a positional constructor argument
- optional custom_endpoint, azure_devops_service_connection, feed_url setters
- into_step() that only emits inputs that were set

Also update src/runtimes/node/extension.rs to use NpmAuthenticate instead of
the hand-crafted TaskStep::new("npmAuthenticate@0", ...).with_input(...) call.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesadevine jamesadevine marked this pull request as ready for review June 23, 2026 05:48
@jamesadevine jamesadevine merged commit b2da117 into main Jun 23, 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