feat(ir): add typed builder for npmAuthenticate@0#1157
Merged
Conversation
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>
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
npmAuthenticate@0to the ado-aw IR.Motivation
Previously, the Node.js runtime extension emitted the
npmAuthenticate@0step by hand-craftingTaskStep::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.npmrcpath 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: newNpmAuthenticatebuilder struct with 8#[cfg(test)]unit tests covering required input, default display name, optional inputs, and the full inputs-together scenariosrc/compile/ir/tasks/mod.rs:pub mod npm_authenticate;declaration (alphabetical, betweennpmandnuget_authenticate)src/runtimes/node/extension.rs:npm_authenticate_task_step()now callsNpmAuthenticate::new(".npmrc").with_display_name(...).into_step()instead of the rawTaskStep::newcallADO Task Reference
npmAuthenticate@0https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/npm-authenticate-v0workingFile— path to the.npmrcfile to authenticatecustomEndpoint(service connections for external registries),azureDevOpsServiceConnection/workloadIdentityServiceConnection(workload identity federation),feedUrl(Azure Artifacts feed URL; required whenazureDevOpsServiceConnectionis set)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.