Repository navigation
fix(ci): resolve tslint violations and test/build failures blocking CI - #734
Merged
Merged
Conversation
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>
- 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>
…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>
Contributor
Author
|
Pushed a follow-up commit correcting the previous one: those fixes had been verified against a local
Re-verified |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tslint-config-vtexviolations 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,letvsconst,T[]vsArray<T>, missing trailing commas, and import ordering.jest@25's resolver predates the packageexportsfield, so it couldn't resolve@vtex/diagnostics-nodejs's OpenTelemetry chain (@opentelemetry/otlp-exporter-base/node-http) or axios's dual CJS/ESM package (mainpoints at the ESM build). Restored thejest.config.jsmoduleNameMapper+jest/stubs/diagnosticsNodejs.jsstub (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.src/service/telemetry/client.tscalledNewTelemetryClientwith only 3 of its 4 required positional args (missingserviceName).src/service/logger/client.tspassedheaders/path/protocoltoExporters.CreateLogsExporterConfig, none of which exist on the installeddiagnostics-nodejsversion'sExporterOptionstype, nor are read by its runtime implementation (a gRPC, not HTTP, exporter) — removed the dead options.TestServer.ts'sPromiseexecutor needed an explicit<void>type argument under strict typing.localhost, which Node'sautoSelectFamily(Happy Eyeballs) resolves to both loopback addresses; since both refuse, Node throws anAggregateErrorwith an empty message instead of the plain error the test asserts on. Switched to the literal127.0.0.1.6.52.3and updatesCHANGELOG.mdper repo convention (two entries:6.52.2for the lint fixes,6.52.3for the CI/test fixes).Test plan
yarn lintpasses cleanyarn buildpasses 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