Skip to content

ARSN-645: Replace deprecated and unmaintained dependencies - #2710

Open
francoisferrand wants to merge 10 commits into
improvement/ARSN-642from
improvement/ARSN-645
Open

francoisferrand wants to merge 10 commits into
improvement/ARSN-642from
improvement/ARSN-645

Conversation

@francoisferrand

Copy link
Copy Markdown
Contributor

Stacked on #2709 (ARSN-642 / Node 24 CI+engines). Doesn't touch anything from that ticket's scope (CI matrix, engines field, url.parse() migration, node-fcntl/httpagent floors).

What changed

Deprecated/unmaintained direct deps replaced:

  • uuid ^10 → ^11
  • Removed @types/ioredis (deprecated stub, ioredis ships its own types)
  • Replaced archived backo with a shared lib/utils/Backoff.ts helper, exported from index.ts (Backbeat uses the same backoff logic and can consume this instead of vendoring its own copy)

Lockfile refresh:

  • yarn upgrade --ignore-engines to pick up available transitive version bumps within existing semver ranges (no package.json range changes in that commit) — dropped combined yarn audit findings from moderate 113/high 245/critical 13 down to a handful

Targeted direct-dep CVE fixes surfaced by the refresh:

  • ajv 6.12.3 → 6.15.0
  • base-x 3.0.8 → 3.0.11
  • @opentelemetry/* family bumped in lockstep (0.219.x/2.8.x → 0.220.x/2.9.x) to pull in a fixed propagator-jaeger
  • nyc ^17.1.0 → ^18.0.0 (drops a vulnerable transitive uuid via istanbul-lib-processinfo)

prom-client peer dependency:

  • Declared prom-client as a peerDependency (kept as a regular dependency too) since ZenkoMetrics needs to share the exact same registry singleton as the consuming app's own prom-client instance — relying on hoisting alone risks a silent duplicate registry if a transitive dep pins an incompatible range (e.g. node-rdkafka-prometheus in Backbeat).

Deliberately out of scope / left alone:

  • @prometheus-io/client migration — investigated, reverted; prom-client stays. Backbeat's node-rdkafka-prometheus hardcodes require('prom-client') internally with no injection point, so a unilateral Arsenal swap breaks the shared-registry requirement. Follow-up needed (tracked separately).
  • level/level-sublevel (archived) — still carries the last 3 remaining audit findings (2x bl, 1x semver), all transitive via level-sublevel > levelup. Large blast radius, needs its own migration investigation. Follow-up needed (tracked separately).

Validation

  • yarn build, yarn lint clean
  • Full unit suite: 4011/4021 passing (167/168 suites) — the one failure (tests/unit/network/http/server.spec.js, TLS cert alert) is pre-existing/environment-related, reproduces identically on the unmodified base branch too.
  • Final combined (prod+dev) yarn audit: 2 moderate + 1 high + 0 critical, all from the untouched level/level-sublevel chain.

Issue: ARSN-645

@francoisferrand
francoisferrand requested review from a team, DarkIsDude and delthas September 21, 2026 17:11
@francoisferrand
francoisferrand force-pushed the improvement/ARSN-645 branch 2 times, most recently from dc3b143 to 69b5617 Compare September 21, 2026 20:58
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 54.33071% with 58 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.80%. Comparing base (3006f5a) to head (bab8157).

Files with missing lines Patch % Lines
lib/storage/data/external/GCP/GcpApis/mpuHelper.js 20.31% 51 Missing ⚠️
lib/network/kmip/index.ts 85.10% 7 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           improvement/ARSN-642    #2710      +/-   ##
========================================================
+ Coverage                 74.75%   74.80%   +0.04%     
========================================================
  Files                       228      229       +1     
  Lines                     18673    18686      +13     
  Branches                   3873     3877       +4     
========================================================
+ Hits                      13959    13978      +19     
+ Misses                     4709     4703       -6     
  Partials                      5        5              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

francoisferrand and others added 10 commits September 22, 2026 00:15
npm flags all uuid <=10 releases as deprecated, recommending v11 for
CommonJS codebases (Arsenal compiles to CJS). Runtime v4() behavior is
unchanged; only needed an explicit return type on the local uuidv4
wrapper in kmip/index.ts to satisfy the updated overload typings.

Issue: ARSN-645
npm flags this as a deprecated stub since ioredis ships its own type
definitions; the extra devDependency is no longer needed.

Issue: ARSN-645
The backo GitHub repo has been archived since 2023 with no releases
since 2022, and there's no actively maintained drop-in successor with
the same callback-friendly duration()/reset() shape (AWS SDK v3's own
@smithy/util-retry is built around wrapping whole SDK client calls,
and exponential-backoff owns the retry loop itself; neither fits the
custom retry loop in mpuHelper.js without a larger rewrite).

Since the same backo@^1.1.0 API is used identically in Backbeat (also
an exponential retry timer around a callback-based retry loop), add it
as a shared lib/utils/Backoff export rather than a GCP-local file, so
other Arsenal consumers - and eventually Backbeat - can depend on
Arsenal's copy instead of the unmaintained package.

Issue: ARSN-645
Re-resolve the lockfile against existing package.json semver ranges
(no range changes). Picks up patch/minor bumps for tar, fast-xml-parser,
ws, lodash, jws, node-forge, ip-address, semver, minimatch, glob, ajv,
joi, brace-expansion, protobufjs, picomatch, engine.io and others,
clearing most of the known advisories affecting the existing ranges.

Issue: ARSN-645
Fixes a ReDoS in ajv's $data option (GHSA advisory, <6.14.0). Stays on
the 6.x line used by policyValidator.ts, no API changes needed.

Issue: ARSN-645
Fixes a homograph attack allowing Unicode lookalike characters to
bypass validation (GHSA advisory, <=3.0.10). Used by VersionID.ts,
no API changes needed.

Issue: ARSN-645
sdk-node <0.220.0 pins propagator-jaeger <2.9.0, which has a DoS via
unhandled exception on malformed headers (GHSA advisory). Bump the
whole OTel family in lockstep (sdk-node/exporter-trace-otlp-http to
0.220.x, resources/sdk-trace-base/context-async-hooks/core to 2.9.x)
since these packages are version-locked across the monorepo.

Issue: ARSN-645
Pulls in istanbul-lib-processinfo@3.0.1, which drops its uuid
dependency entirely (the old copy had the buffer bounds-check advisory,
<11.1.1). nyc 18 requires Node 20 or >=22, already satisfied by
Arsenal's engines field. Smoke-tested the coverage script directly to
confirm reports still generate correctly.

Issue: ARSN-645
ZenkoMetrics must share the exact same registry singleton as the
consuming app's own prom-client instance to produce a combined
/metrics output. Keeping prom-client only as a regular dependency
relies on yarn/npm hoisting to accidentally dedupe it with the host
app's copy; if a transitive dep (e.g. node-rdkafka-prometheus, pinned
to prom-client ^12) forces a nested install, Arsenal and the app end
up with two separate registries with no error, silently breaking
metrics.

Declaring it as a peerDependency (in addition to keeping it as a
regular dependency, so Arsenal still works standalone) makes yarn/npm
enforce and warn on version mismatches instead of silently duplicating
the module.

Issue: ARSN-645
Issue: ARSN-645

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant