[SDK-731] Bump axios to 1.20.0 and adm-zip to ^0.6.1 - #31
devtools-agent[bot] wants to merge 2 commits into
Conversation
Resolves all 30 open Dependabot alerts on master: - axios 1.15.0 -> 1.20.0 clears 28 alerts (fixes land in 1.15.1-1.18.0). - adm-zip ^0.5.2 -> ^0.6.1 clears 2 high alerts (GHSA-xcpc-8h2w-3j85, GHSA-7q85-xj36-vmfc). A caret range on 0.x never crosses a minor, so the range itself had to change. Supersedes Dependabot PR #30. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI Agent Review (openai, openai-astra)Review: bump axios 1.15.0 → 1.20.0 and adm-zip ^0.5.2 → ^0.6.1The diff changes two lines, both in What uses these libraries (read in the checkout):
Why there are no inline findings: Neither version can be checked here. There's no lockfile and no Suggested checks before merging (not blockers):
Pre-existing issues outside this diff (not findings):
This diff doesn't show that tests passed. |
brianr
left a comment
There was a problem hiding this comment.
The review found some code quality issues - light test coverage, missing CI. Let's get those fixed as part of this PR.
…RL upload Addresses review feedback on the axios/adm-zip bump. CI: - The matrix key is `node` but setup-node read `matrix.node-version`, so every job ran on the runner's default Node (22). Use `matrix.node`, install the listed npm version, and move to checkout/setup-node v4. - Add a lint job; `npm run lint` was never run in CI. Tests: - The zipFiles test asserted a 22-byte (empty) zip because it passed no requester and the error was swallowed. Now the manifest string and every validated map are read back out of the archive and compared byte for byte. - Cover non-200 and throwing uploads, dry runs, unreadable and unvalidated files, and the `--next` handler path end to end. - Fix sourcemaps.test.js: the signed-URL case passed `--signed-url` (not a flag) instead of `--next`, and both `for (let i; ...)` loops never ran. Fix: SignedUrlUploader shared one module-level AdmZip, so entries carried over between uploads in the same process. Create the archive per zipFiles() call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Linear: SDK-731
What changed
Dependency bump (
package.json):axios:1.15.0→1.20.0(still an exact pin, like before)adm-zip:^0.5.2→^0.6.1Review follow-up (changes requested: light test coverage, missing CI):
.github/workflows/node.js.yml): the matrix key wasnodebut setup-node readmatrix.node-version, so every job ran on the runner's default Node. The "Node 18" job on the first commit actually ran v22.23.2. The workflow now usesmatrix.nodeand installs the listed npm version, following rollbar.js'sci.yml. It also moves toactions/checkout@v4/actions/setup-node@v4, adds a lint job (npm run lintwas never run in CI), setspermissions: contents: read, and letslatestfail without blocking.test/sourcemaps/signed-url-uploader.test.js: the old zip test asserted a 22-byte zip, which is an empty archive. It passed no requester, soaddFilethrew and the error was swallowed. The new tests read the archive back and compare the stringmanifest.jsonand every validated map to the source files, byte for byte. They also cover unvalidated and unreadable files, a missing manifest, non-200 and throwing uploads, and dry runs. Stubs are now restored.test/sourcemaps/command.test.js: new tests for the--nexthandler path end to end (signed-URL request → zip →axios.put), a failed signed-URL request, and a dry run. This path had no tests before.test/sourcemaps.test.js: the "via signed URL" case passed--signed-url, which isn't a flag. It now passes--next. Bothfor (let i; …)loops never ran; they're replaced with a real assertion.src/sourcemaps/signed-url-uploader.jsshared one module-levelAdmZip, so entries carried over between uploads in the same process. The archive is now created perzipFiles()call.Why
The bump closes all 30 open Dependabot alerts on
master:The CLI only creates zips (
addFile,addLocalFile,toBuffer). adm-zip 0.5.16 and 0.6.1 produce byte-identical archives for the same input, including the string manifest. This supersedes Dependabot PR #30 (axios 1.15.0 → 1.18.0).Validation
npm test+npm run linton Node 18.20.8 (npm 9.9.4 and 10.8.2), 20.19.2, 22.23.3, 24.21.0: 46 passing, 1 pending (the existing skip), lint clean. Before this PR: 36 passing.signed-url-uploader.js85% → 94% lines (62.5% → 87.5% branches);sourcemaps/command.js71% → 100%.adm-zip@0.5.16swapped in, so the tests don't depend on 0.6-only behaviour.AdmZipback makes 4 of the new tests fail.npm audit --omit=dev: 0 vulnerabilities.Follow-ups (not in this PR)
--next) uploads drop maps that aren't in the root of the target path.scanner.jssetsfile.mappedFile = path.join(this.targetPath, mapPath), not relative to the JS file's own directory (whichloadMapDatadoes use). For a CRA build (static/js/*.map) nothing butmanifest.jsongets zipped, and the CLI still prints "Zipped all the source map files successfully". The new tests use the angular9 fixture, whose maps sit at the root. Fixing it changes what gets uploaded, so it deserves its own PR.masteronly. The latest npm release is still 0.2.1 (Jan 2022,axios ^0.24.0), so users get the fix once a 0.2.2 is published.🤖 Generated with Claude Code