Skip to content

chore(deps): bump axios to ^1.12.0 and refresh fetch-adapter test stubs#371

Merged
luis-almeida merged 2 commits into
masterfrom
luis/bump_axios_1_16
May 13, 2026
Merged

chore(deps): bump axios to ^1.12.0 and refresh fetch-adapter test stubs#371
luis-almeida merged 2 commits into
masterfrom
luis/bump_axios_1_16

Conversation

@luis-almeida
Copy link
Copy Markdown
Contributor

@luis-almeida luis-almeida commented May 7, 2026

Description

Alternative to #370. Users installing zcli today already get axios 1.16.0 via the ^1.7.5 range, so CI should validate what users actually run rather than pinning to the old 1.8.4. 1.16.0 also patches CVE-2025-58754 (affects <1.12.0) and CVE-2025-27152 (<1.8.2).

Trade-off vs #370: fixes test stubs against the newer fetch adapter rather than keeping old stubs working against an older axios. Same effective unblock; healthier long-term posture.

References

Risks

Low. 1.16.0 is what yarn install on master already resolves to today. Test stub changes are internal-only.

Users installing zcli today already get axios 1.16.0 via the ^1.7.5
range, so CI should validate what users run. 1.16.0 also patches
CVE-2025-58754 (affects <1.12.0) and CVE-2025-27152 (<1.8.2).

Three stub updates for the new fetch adapter:
- auth.test.ts: sinon.match now uses a predicate that reads
  request.headers.get(...) instead of deep-equal on a Headers
  instance (which doesn't work across instances).
- import.test.ts / update.test.ts: upload stubs include
  headers: new Headers() so axios' maxContentLength check can
  call response.headers.get('content-length').

Also add --frozen-lockfile to CI so the install can't silently
drift off the lockfile.
@luis-almeida luis-almeida marked this pull request as ready for review May 7, 2026 15:05
Copilot AI review requested due to automatic review settings May 7, 2026 15:05
@luis-almeida luis-almeida requested review from a team as code owners May 7, 2026 15:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the monorepo’s axios dependency to 1.16.0 (matching what users already resolve today and addressing cited CVEs), and adjusts fetch-adapter-related tests/CI to be compatible and deterministic.

Changes:

  • Pin axios to 1.16.0 in workspace packages and refresh yarn.lock for the new transitive graph.
  • Update fetch stubs/matchers in tests to align with axios fetch-adapter request/response shapes.
  • Make CI installs deterministic by using yarn install --frozen-lockfile.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
yarn.lock Adds lock entries for axios 1.16.0 and updated transitive deps.
packages/zcli-themes/tests/functional/update.test.ts Adjusts S3 upload fetch stub to include headers.
packages/zcli-themes/tests/functional/import.test.ts Adjusts S3 upload fetch stub to include headers.
packages/zcli-themes/package.json Pins axios to 1.16.0.
packages/zcli-core/src/lib/auth.test.ts Makes fetch request matching less brittle under the newer fetch adapter behavior.
packages/zcli-core/package.json Pins axios to 1.16.0.
packages/zcli-connectors/package.json Pins axios to 1.16.0.
packages/zcli-apps/package.json Pins axios to 1.16.0.
.github/workflows/test.yml Uses --frozen-lockfile to prevent lock drift during CI installs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/zcli-themes/tests/functional/update.test.ts
Comment thread packages/zcli-themes/tests/functional/update.test.ts
Comment thread packages/zcli-themes/tests/functional/import.test.ts
Comment thread packages/zcli-themes/tests/functional/import.test.ts
mmassaki
mmassaki previously approved these changes May 8, 2026
Copy link
Copy Markdown
Contributor

@mmassaki mmassaki left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this issue :)

Comment thread packages/zcli-apps/package.json Outdated
@mmassaki mmassaki dismissed their stale review May 8, 2026 04:49

Sorry, I realized we shouldn't enforce the latest version of axios in package.json.

Comment thread yarn.lock Outdated
Per review: the exact 1.16.0 pin was overkill when the lockfile
already pins the installed version deterministically. ^1.12.0 is
narrow enough to exclude the CVE-affected <1.12.0 range and give
consumers of these packages flexibility when they dedupe with
their own axios.

Also collapse the lockfile so axios@^1.0.0 (transitive via
lerna>nx) resolves onto the same 1.16.0 as our packages instead
of a stale 1.8.4, clearing the remaining axios advisories.
@mmassaki
Copy link
Copy Markdown
Contributor

Thanks for addressing my comments.

@zendesk/vegemite @zendesk/vikings , could you please review this PR?

Copy link
Copy Markdown
Contributor

@BrunoBFerreira BrunoBFerreira left a comment

Choose a reason for hiding this comment

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

Approved. I noticed the Copilot review comments but I have noticed we have a similar approach in other tests as well.
Is it worth considering this an improvement for a future PR?
Thank you for the work 🙏

@luis-almeida luis-almeida changed the title chore(deps): bump axios to 1.16.0 and refresh fetch-adapter test stubs chore(deps): bump axios to ^1.12.0 and refresh fetch-adapter test stubs May 12, 2026
Copy link
Copy Markdown
Contributor

@saikambaiyyagari saikambaiyyagari left a comment

Choose a reason for hiding this comment

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

narrow 👍🏾 for Vegemite owned files

@luis-almeida luis-almeida merged commit f39dcac into master May 13, 2026
7 checks passed
@luis-almeida luis-almeida deleted the luis/bump_axios_1_16 branch May 13, 2026 07:32
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.

5 participants