Skip to content

fix(ci): resolve tslint violations and test/build failures blocking CI - #734

Merged
juliobguedes merged 3 commits into
6.xfrom
julio/fix-tslint-errors
Oct 8, 2026
Merged

juliobguedes merged 3 commits into
6.xfrom
julio/fix-tslint-errors

Conversation

@juliobguedes

@juliobguedes juliobguedes commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fixes tslint-config-vtex violations that were breaking the CI lint gate on any branch touching the affected files, even when the diff itself was unrelated (e.g. docs(openspec): propose observability diagnostics for node-vtex-api@6.x #710, which only adds specs). Covers: unnecessary semicolons, class/interface member ordering, == vs ===, unsorted object-literal keys, let vs const, T[] vs Array<T>, missing trailing commas, and import ordering.
  • Fixes the CI test gate, which failed to even load two suites:
    • jest@25's resolver predates the package exports field, so it couldn't resolve @vtex/diagnostics-nodejs's OpenTelemetry chain (@opentelemetry/otlp-exporter-base/node-http) or axios's dual CJS/ESM package (main points at the ESM build). Restored the jest.config.js moduleNameMapper + jest/stubs/diagnosticsNodejs.js stub (previously added in the now-reverted Backport cluster-wide prom-client metrics aggregation (plus undefined-handler-label fix) to 6.x #675) mapping both to their CJS/legacy entry points.
    • Fixing that resolution surfaced two more pre-existing, real bugs that had never actually been type-checked/run:
      • src/service/telemetry/client.ts called NewTelemetryClient with only 3 of its 4 required positional args (missing serviceName).
      • src/service/logger/client.ts passed headers/path/protocol to Exporters.CreateLogsExporterConfig, none of which exist on the installed diagnostics-nodejs version's ExporterOptions type, nor are read by its runtime implementation (a gRPC, not HTTP, exporter) — removed the dead options.
      • TestServer.ts's Promise executor needed an explicit <void> type argument under strict typing.
      • The "forcing ECONNREFUSED" test pointed at localhost, which Node's autoSelectFamily (Happy Eyeballs) resolves to both loopback addresses; since both refuse, Node throws an AggregateError with an empty message instead of the plain error the test asserts on. Switched to the literal 127.0.0.1.
  • Bumps version to 6.52.3 and updates CHANGELOG.md per repo convention (two entries: 6.52.2 for the lint fixes, 6.52.3 for the CI/test fixes).

Test plan

  • yarn lint passes clean
  • yarn build passes clean (previously failed with 2 pre-existing type errors, now fixed)
  • yarn test — 89/89 tests passing, all 4 suites loading and passing (previously 2 suites failed to even load)

🤖 Generated with Claude Code

Fixes semicolon usage, class/interface member ordering, == vs ===,
unsorted object-literal keys, and import ordering across axios.d.ts,
MultilayeredCache.ts, the HttpClient cache/request middlewares, the
logger and telemetry clients, the Auth schema directive, and
buildFullPath.ts. These were pre-existing violations unrelated to any
single PR's diff but tripped the tslint CI gate on any branch that
touched the affected files (e.g. #710).

Bumps version to 6.52.2 and updates CHANGELOG.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@juliobguedes juliobguedes self-assigned this Sep 24, 2026
- Restore the jest.config.js moduleNameMapper + jest/stubs/diagnosticsNodejs.js
  stub (previously added in the now-reverted #675) so jest@25's pre-"exports"-field
  resolver can load @vtex/diagnostics-nodejs's OpenTelemetry chain and axios's
  dual CJS/ESM package. Without this, any suite touching src/service/logger or
  the setupAxios middleware failed to even load.
- Fix src/service/telemetry/client.ts: NewTelemetryClient was missing its
  required serviceName argument.
- Fix src/service/logger/client.ts: drop headers/path/protocol, which don't
  exist on the installed diagnostics-nodejs version's ExporterOptions and are
  silently ignored by its (gRPC, not HTTP) exporter implementation.
- Fix TestServer.ts: type the Promise executor explicitly for strict Promise<void>.
- Fix axiosTracing.test.ts: use the literal 127.0.0.1 instead of localhost in the
  "forcing ECONNREFUSED" suite, avoiding Node's autoSelectFamily AggregateError
  (empty message) for dual-stack loopback resolution.

Bumps version to 6.52.3 and updates CHANGELOG.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@juliobguedes juliobguedes changed the title fix(lint): resolve tslint-config-vtex violations blocking CI fix(ci): resolve tslint violations and test/build failures blocking CI Sep 24, 2026
…versions

The previous commit's fixes to src/service/telemetry/client.ts,
src/service/logger/client.ts and jest.config.js were verified against a
local node_modules that had drifted from yarn.lock (leftover from the
now-reverted #675, which used axios@1.8.x and a newer
@vtex/diagnostics-nodejs). A clean `yarn install --frozen-lockfile`
resolves axios@0.30.1 and @vtex/diagnostics-nodejs@0.1.0-beta.10 — the
versions CI actually installs — which have different signatures/shapes:

- axios@0.30.1 is plain CJS with no ESM entry, so the jest.config.js
  moduleNameMapper for axios was wrong and is removed.
- @vtex/diagnostics-nodejs@0.1.0-beta.10's ExporterOptions legitimately
  includes headers/path/protocol (its OTLPExporter is HTTP, not gRPC, and
  uses them to build the request URL); restored those in
  src/service/logger/client.ts.
- Its NewTelemetryClient signature is
  (clientName, serviceName, options?) — 2 required args, not 4; removed
  the extra serviceName argument in src/service/telemetry/client.ts,
  restoring its original, correct call.
- The @vtex/diagnostics-nodejs jest stub is still required (jest@25's
  resolver still can't load the package's OTLP/OpenTelemetry chain) and
  is kept as-is.

All fixes in this commit were verified with a clean, lockfile-frozen
`yarn install`, matching what CI resolves. yarn lint, yarn build and
yarn test (89/89) all pass clean.

Bumps version to 6.52.4 and corrects the CHANGELOG entry this supersedes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@juliobguedes

Copy link
Copy Markdown
Contributor Author

Pushed a follow-up commit correcting the previous one: those fixes had been verified against a local node_modules that had drifted from yarn.lock (leftover from the reverted #675, which pulled in axios@1.8.x and a newer @vtex/diagnostics-nodejs). A clean yarn install --frozen-lockfile resolves axios@0.30.1 and @vtex/diagnostics-nodejs@0.1.0-beta.10 — what CI actually installs — and those have different, incompatible shapes from what I'd fixed against:

  • axios@0.30.1 is plain CJS, no ESM entry — removed the now-wrong jest.config.js axios mapping.
  • @vtex/diagnostics-nodejs@0.1.0-beta.10's ExporterOptions legitimately supports headers/path/protocol (its OTLPExporter is HTTP-based here, not gRPC) — restored those in logger/client.ts.
  • NewTelemetryClient's real signature is (clientName, serviceName, options?) — removed the extra argument I'd added in telemetry/client.ts.

Re-verified yarn lint / yarn build / yarn test (89/89) against the clean, lockfile-frozen install this time.

@daniyelnnr daniyelnnr left a comment

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.

LGTM

@juliobguedes
juliobguedes merged commit 009e503 into 6.x Oct 8, 2026
6 checks passed
@juliobguedes
juliobguedes deleted the julio/fix-tslint-errors branch October 8, 2026 16: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.

2 participants