Skip to content

Q2 2026 dependency upgrades: axios 1.x, knex 3, jest 30, nock 14#469

Merged
ckeshava merged 12 commits into
ripple:mainfrom
ckeshava:upgradeAxiosMaxmind
May 5, 2026
Merged

Q2 2026 dependency upgrades: axios 1.x, knex 3, jest 30, nock 14#469
ckeshava merged 12 commits into
ripple:mainfrom
ckeshava:upgradeAxiosMaxmind

Conversation

@ckeshava

@ckeshava ckeshava commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

High Level Overview of Change

Quarterly batch dependency upgrade for 2026-Q2 (PR #469). Upgrades direct and transitive dependencies, updates the test toolchain (jest/ts-jest/nock), stabilizes flaky CI tests, and supersedes 28 open Dependabot PRs. No public API or runtime behavior changes.

Context of Change

This branch (upgradeAxiosMaxmind) consolidates this quarter's dependency work into a single PR. It carries seven commits — five direct/transitive upgrades, one test-toolchain bump, and two test-stability fixes that fell out of the toolchain bump:

# Commit Summary
1 ffe6344 axios 0.30.x → 0.31.0 to address GHSA-fvcv-3m26-pcqx (DoS via lack of upload size limit). Security-driven minor bump.
2 b90f7c2 @maxmind/geoip2-node 4.2 → 6.3.4. Routine quarterly bump; major v5 dropped CommonJS-only entry, v6 tightened types — call site at src/crawler/locate.ts continues to typecheck cleanly.
3 d270dbd Direct: pg 8.16.3 → 8.20.0, ws ^8.13 → ^8.20. Transitive (lockfile-only): lodash 4.17.23 → 4.18.1, flatted 3.3.3 → 3.4.2, path-to-regexp 8.3.0 → 8.4.2, plus pg's internals (pg-connection-string, pg-pool, pg-protocol).
4 0be11e0 Direct: knex 2.5.1 → 3.2.9 (major), axios ^0.31 → ^1.15.2 (major). Transitive: picomatch. Resolves PRs #445, #451, #466. Major-version notes: knex@3 drops Node 16/18 (we run 25); QueryBuilder types tightened — src/shared/database/utils.ts and src/connection-manager/chains.ts continue to typecheck. axios@1 AxiosRequestConfig split is input-side only at our call site (src/shared/utils/index.ts:128).
5 5a9a89e Test toolchain: jest 26 → 30, ts-jest 26.5 → 29.4.9. Major bumps both. No test source changes required at this commit; the two flaky-test fixes that follow surfaced under the new runner.
6 de7512a Test stability: health.test.ts had forEach invoking async assertions — forEach does not await, so failures could be swallowed. Replaced with a sequential loop. crawler.test.ts was stacking nock interceptors instead of clearing between cases — switched to one-at-a-time nock(...).clean() flow. Files touched: test/api/health.test.ts (-13/+0 net 0), test/crawler/crawler.test.ts (+39/-28).
7 39af2d4 nock 13.5 → 14.0.13. Adds CI guardrail: any nock interceptor left unconsumed at the end of a test now fails the test (previously a silent pass). Test files updated to use nocks judiciously, which doubles as documentation of the crawler's actual HTTP behavior.

The lockfile carries one extra change in this PR on top of the seven commits above: an in-place scrub of a stale artifactory.ops.ripple.com resolved URL on the follow-redirects entry, replaced with the public registry.npmjs.org URL. Integrity hash unchanged (same tarball); no version movement.

The eslint-family PRs (@xrplf/eslint-config@3, eslint@10, @eslint/js@10, globals@17, eslint-plugin-* family) are deferred per the documented yearly preset cadence — @xrplf/eslint-config@^2 caps the eslint plugin versions, so those upgrades should be batched together with the next preset bump.

The TypeScript-blocked PRs (typescript@6, typescript-eslint@8.58, @types/node@25, @types/jest@30) are deferred until a coordinated TypeScript major-version migration. See .claude/skills/batch-deps.upgrade/code-changes.md for what was investigated and why each was rolled back.

Type of Change

Before / After

package.json:

  • axios: ^0.30.x → ^1.15.2
  • knex: 2.5.1 → 3.2.9
  • pg: 8.16.3 → 8.20.0
  • ws: ^8.13.0 → ^8.20.0
  • @maxmind/geoip2-node: ^4.2 → ^6.3.4
  • jest: ^26 → ^30.3.0
  • ts-jest: ^26.5 → ^29.4.9
  • nock: ^13.5 → 14.0.13

package-lock.json reflects the above plus the transitive bumps listed in commit d270dbd and the follow-redirects 1.15.11 → 1.16.0 / bn.js 5.2.2 → 5.2.3 / 4.12.2 → 4.12.3 lockfile-only updates from the final scrub. The artifactory resolved URL on follow-redirects is also replaced with the public registry URL.

Source: no changes.

Tests: test/api/health.test.ts and test/crawler/crawler.test.ts updated for nock v14's stricter unconsumed-interceptor enforcement and to remove a forEach/async footgun.

Test Plan

  • npm run build — passes
  • npm run lint:ci — passes
  • npm test — 45 of 45 tests pass under jest@30 / ts-jest@29 / nock@14 with the new unconsumed-interceptor guardrail
  • CI flake regression: ran crawler.test.ts and health.test.ts 20× locally — no flakes after de7512a

Superseded Dependabot PRs

PR Package From To Status MajorVersionUpgrade
#468 follow-redirects (transitive) 1.15.11 1.16.0 Upgraded No
#467 lodash (transitive) 4.17.23 4.18.1 No-op (already updated in d270dbd) No
#466 axios 0.30.3 1.15.0 Resolved (branch at ^1.15.2 via 0be11e0) Yes (v1)
#465 typescript-eslint 8.56.1 8.58.0 Skipped (CI failure: new no-unnecessary-type-assertion rule conflicts with knex any casting; produces 9 lint errors with no clean autofix) No
#464 eslint-plugin-array-func 4.0.0 5.1.1 Skipped (held — capped by @xrplf/eslint-config@^2 per yearly preset cadence) Yes (v5)
#463 @eslint-community/eslint-plugin-eslint-comments 4.6.0 4.7.1 Skipped (held — capped by eslint-config preset) No
#462 axios 0.30.3 1.14.0 Resolved (superseded by 0be11e0) Yes (v1)
#461 jest, @types/jest 26 / 26 30 / 30 Mixed: jest@^30.3.0 already on branch via 5a9a89e (Resolved); @types/jest@30 Skipped (incompatible with typescript@4.9 — pulls jest-mock@30's Disposable from esnext.disposable lib) Yes (jest v27, v28, v29, v30; @types/jest CHANGELOG)
#460 eslint 9.39.3 10.1.0 Skipped (peer dep conflict: @xrplf/eslint-config@^2 requires eslint@^9) Yes (v10)
#459 @eslint/js 9.39.3 10.0.1 Skipped (same peer-dep block as #460) Yes (v10)
#458 pg 8.16.3 8.20.0 Resolved (d270dbd) No
#457 @types/node 20.19.35 25.5.0 Skipped (requires TS ≥ 5.2 for Symbol.dispose; pinned typescript@4.9 is incompatible) Yes (v21, v22, v23, v24, v25)
#456 eslint-plugin-tsdoc 0.4.0 0.5.2 Skipped (held — capped by eslint-config preset) No
#455 ts-jest 26.5.6 29.4.9 Resolved (5a9a89e) Yes (v27, v28, v29)
#454 @xrplf/eslint-config 2.0.0 3.0.0 Skipped (yearly preset bump — held per documented quarterly cadence; will batch next preset bump with the eslint-family PRs) Yes (v3)
#453 eslint-plugin-jest 29.15.0 29.15.1 Skipped (held — capped by eslint-config preset) No
#452 eslint-plugin-jsdoc 52.0.4 62.9.0 Skipped (held — capped by eslint-config preset) Yes (v53–v62 releases)
#451 knex 2.5.1 3.2.8 Resolved (0be11e0 lands at 3.2.9) Yes (v3)
#450 ws 8.19.0 8.20.0 Resolved (d270dbd) No
#449 nock 13.5.1 14.0.11 Resolved (39af2d4 lands at 14.0.13) Yes (v14)
#448 globals 16.5.0 17.4.0 Skipped (held — capped by eslint-config preset) Yes (v17)
#447 typescript 4.9.5 6.0.2 Skipped (large-scale migration — TS 4 → 6 generated 588 no-unsafe-* lint errors and required tsconfig overhauls; defer until a coordinated TypeScript migration) Yes (v5, v6)
#446 path-to-regexp (transitive) 8.3.0 8.4.0 Resolved (already at 8.4.2 in d270dbd) No
#445 picomatch (transitive) 2.3.1 2.3.2 Resolved (0be11e0) No
#443 flatted (transitive) 3.3.3 3.4.2 Resolved (d270dbd) No
#436 bn.js (transitive) 5.2.2 / 4.12.2 5.2.3 / 4.12.3 Upgraded (final scrub commit) No
#405 @maxmind/geoip2-node 4.2.0 6.3.4 Resolved (b90f7c2) Yes (v5, v6)
#247 braces, jest, ts-jest (grouped) Resolved (superseded by #455 / #461 and the 5a9a89e jest+ts-jest commit) No

Closing instructions

After merging, close the following superseded PRs (Skipped ones remain open for future handling): #467, #466, #462, #461 (only the jest half — the @types/jest half is Skipped; close once the grouped PR can be split, otherwise leave open), #458, #455, #451, #450, #449, #446, #445, #443, #468, #436, #405, #247.

The following PRs were Skipped and should remain open so Dependabot keeps them rebased:

  - Transitive (lockfile only): lodash 4.17.23 → 4.18.1, flatted 3.3.3 → 3.4.2, path-to-regexp 8.3.0 → 8.4.2, plus pg's internals (pg-connection-string, pg-pool, pg-protocol)
…^0.31 -> ^1.15.2.

Lockfile-only update. Resolves PR ripple#445.

build(deps): bump knex 2.5.1 -> 3.2.9

PR ripple#451. Major version (2 -> 3).

Salient changes / call-site impact:
  - knex 3 drops Node 16/18 support (we run Node 25, fine)
  - Migration timestamp format changed (existing migrations unaffected;
    only new migrations differ)
  - Stricter TypeScript types for QueryBuilder
  - Knex.QueryBuilder and knex(config) APIs used by
    src/shared/database/utils.ts and src/connection-manager/chains.ts
    are unchanged on the surface; tsc --noEmit passes clean

No code changes required. Pinned (no caret) to match pg's pinning style.

build(deps): bump axios ^0.31.0 -> ^1.15.2

PR ripple#466. Major version (0.x -> 1.x).

Salient changes / call-site impact:
  - axios 1.x is largely backward compatible at the API surface; the
    public types AxiosRequestConfig, AxiosInstance, AxiosError and the
    methods axios.get/post/create/(config) used by this project remain
    unchanged
  - Internal AxiosRequestConfig is split into AxiosRequestConfig (input)
    vs InternalAxiosRequestConfig (post-merge). Our usage in
    src/shared/utils/index.ts (line 128) is input-side only and continues
    to typecheck cleanly
  - Default responseType remains 'json' but axios 1 throws on non-JSON
    bodies when responseType is unset; current callers pass JSON only

No code changes required.
health.test.ts: Do not use async methods inside forEach, forEach does not wait for the async method to complete
crawler.test.ts: Do not stack nock interceptors, instead use them one after the another coupled with nock.clean().

This commit is aimed at rectifying the flaky tests on the Github CI
fix: Enhance the guardrails around the usage of nocks. If nocks are unused toward the end of the test, report them as error. This commit also makes judicious use of nocks so that developers gain a better understanding of the crawl behavior
@ckeshava ckeshava changed the title Upgrade axios, maxmind dependencies Upgrade VHS dependencies Apr 27, 2026
@ckeshava ckeshava changed the title Upgrade VHS dependencies Q2 2026 dependency upgrades: axios 1.x, knex 3, jest 30, nock 14 Apr 27, 2026
Comment thread test/crawler/crawler.test.ts Outdated
Comment thread test/api/health.test.ts
Comment thread test/api/health.test.ts
ckeshava and others added 3 commits April 29, 2026 13:32
…ated with the set of prompts. These prompts were borrowed/modified from XRPLF/xrpl.js repository

routine package updates in package-lock file
…ps install and scrub artifactory URLs

`npm install --legacy-peer-deps` during the batch-deps upgrade pruned ~25 transitives that @xrplf/eslint-config@2 brings in (eslint-plugin-jsx-a11y, eslint-plugin-react, eslint-plugin-react-hooks, aria-query, axe-core, axobject-query, jsx-ast-utils, array.prototype.findlast, es-iterator-helpers, and friends). CI uses strict `npm ci` which detected the mismatch and refused with "Missing: <pkg>@<ver> from lock file" across all 25 entries plus version drifts on call-bind (1.0.8→1.0.9) and es-abstract (1.24.1→1.24.2). Reset the lockfile to HEAD and re-applied the targeted transitive bumps with `npm update follow-redirects bn.js --package-lock-only` (no legacy-peer-deps), which preserves the full transitive tree under strict resolution.

Also rewrote the `resolved` URLs from artifactory.ops.ripple.com to registry.npmjs.org across 27 entries. The artifactory mirror is a transparent proxy of the public registry, so integrity hashes are unchanged and `npm ci` still validates against the public tarballs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Parse each PR to extract package names and versions. Dependabot PRs come in two formats:
- **Single-package PRs**: title is `Bump <pkg> from <old> to <new>` — parse from title
- **Grouped PRs** (e.g. #3266, #3051, #3013): title is `bump <pkg1> and <pkg2>` with no versions — parse from PR body, which contains a structured list of package updates with version ranges

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.

nit: These PR numbers are for xrpl.js. One grouped PR for VHS is #461

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thanks, updated them here: 219074

Comment on lines +40 to +45
If any step fails, **attempt to fix the breaking change with code modifications before rolling back**. Common patterns:

- **BigNumber.js major bumps**: v10+ throws on invalid input instead of returning NaN. Wrap `new BigNumber(val)` calls in try-catch where the code previously checked for NaN.
- **ESM-only packages** (e.g., https-proxy-agent): Add transform entries and `transformIgnorePatterns` exclusions in `jest.config.base.js` so Jest can parse ESM imports.
- **Type compatibility** (e.g., @scure/base 2.0 changing Uint8Array generics): Widen variable type annotations (e.g., `let buf: Uint8Array = ...` instead of `let buf = ...`).
- **Hoisting breakage** (e.g., webpack-merge): If a transitive dep's major version is shadowed by a different transitive dep's older version, add the correct version as an explicit dependency.

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.

Are those common patterns applicable to VHS? If not, we can remove them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thanks, updated them here: 219074

@ckeshava ckeshava requested a review from kuan121 April 30, 2026 17:41
kuan121
kuan121 previously approved these changes Apr 30, 2026
Comment thread .claude/skills/batch-deps-upgrade/README.md
Match the hyphenated naming convention used by the SKILL `name` field
and xrpl.js's equivalent skill folder.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ckeshava ckeshava merged commit 186b2c0 into ripple:main May 5, 2026
3 checks passed
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.

3 participants