npm / cli

the package manager for JavaScript
https://docs.npmjs.com/cli/
Other
8.5k stars 3.19k forks source link

fix!: remove old audit fallback request #7911

Closed wraithgar closed 2 days ago

wraithgar commented 1 week ago

BREAKING CHANGE: npm will no longer fall back to the old audit endpoint if the bulk advisory request fails.

This legacy code has a long tail in npm. Getting rid of it was difficult because of how load-bearing some of those requests were in tests. This PR removes the old "mock server" that arborist tests spun up, and moved that logic into the existing mock registry that the cli uses. This will allow us to consolidate our logic in tests, and also outline more granularly which tests actually make registry requests.

A few tests that were testing just the fallback behavior were also removed.

Closes: https://github.com/npm/statusboard/issues/900

wraithgar commented 1 week ago

Test coverage failures are due to two things: Two functions which always get passed an object, and never get defaulted now, and uncovered lines in the packument cache because of missing headers in the mock registry.