Skip to content

Fix npm networking issues - #5771

Merged
Daniel Castro (castrodd) merged 3 commits into
vnextfrom
dacastr/npm-network-issues
Oct 27, 2026
Merged

Daniel Castro (castrodd) merged 3 commits into
vnextfrom
dacastr/npm-network-issues

Conversation

@castrodd

Copy link
Copy Markdown
Member

Summary

Re-enables the npm packaging and publishing reverted in #5740 and #5742. The earlier attempt failed because npm ci fetched dependencies from the registry (EPERM on registry.npmjs.org/yauzl), which network isolation blocks.

Changes

  • New pack-npm.ps1 builds the tarballs without any registry access.
  • Package name and version are set in package.json and npm-shrinkwrap.json, and the locked dependency graph is kept unchanged. Dependencies aren't bundled, and the prepack hook uses only Node built-ins. Consumers install the locked dependencies normally.
  • Restores azure-functions-core-tools and azure-functions-cli in the CLI release pipeline. This re-enables the npm artifact, staging, and the publish stage. Manual release approval is unchanged.
  • Adds a local regression test, test/Installers/NpmPackaging.test.js. It checks for no registry requests, correct package identity and contents, and that failures fail the build. It is not run in the pipeline.
  • Adds an npm packaging section to docs/repo-structure.md.

Validation

  • The local test passed 4/4 on Windows (Node 25, npm 11) and on Linux (Node 22.23.4, npm 10.9.9).
  • It found and fixed a registry call from npm's update notifier on Linux.
  • The pipeline has not been run on this change yet.

@castrodd
Daniel Castro (castrodd) marked this pull request as ready for review October 26, 2026 23:05
@castrodd
Daniel Castro (castrodd) requested a review from a team as a code owner October 26, 2026 23:05
@satvu
sarah (satvu) requested a balanced review from Copilot October 26, 2026 23:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The npm installer's expected archive names and formats do not match the staged release assets.

1 open issue
What changed in this PR

Restores npm packaging and publication for both CLI package names, replacing dependency restoration with offline tarball creation to support network-isolated builds.

Changes:

  • Adds an offline packaging script that updates package identity while preserving locked dependencies.
  • Re-enables npm artifacts, staging, and publication without changing manual release approval.
  • Adds local regression tests for registry isolation, package contents, and failure handling.
File Description
test/​Installers/​NpmPackaging.test.js Adds offline packaging and failure-path tests.
eng/​scripts/​pack-npm.ps1 Creates both npm packages without registry access.
eng/​ci/​templates/​jobs/​build.yml Invokes the offline packaging script.
eng/​ci/​release/​official-release.cli.yml Restores npm artifact staging and publication.

Review effort: Balanced

Comment thread eng/ci/release/official-release.cli.yml Resolved

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. I did not find any blocking issues with the implementation.

Non-blocking: the new NpmPackaging.test.js regression suite is not currently part of the automated CI path. It would be good to wire this suite into CI so the release-packaging regression remains covered.

The implementation itself looks good to me.

@castrodd
Daniel Castro (castrodd) merged commit a49f2f1 into vnext Oct 27, 2026
10 checks passed
@castrodd
Daniel Castro (castrodd) deleted the dacastr/npm-network-issues branch October 27, 2026 20:29
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.

4 participants