Repository navigation
chore: upgrades and quality gates for 2.16.0 - #14
Merged
Merged
Conversation
@google-cloud/storage 7 -> 8. Verified the eight methods the code calls still exist on the real client, since the suite mocks GCS and cannot catch an API change. Fixes #11: src/types.ts now augments FastifyInstance with FileStore, and index.ts imports it. Nothing referenced types.ts before, so even the existing FastifySchema augmentation never reached consumers. Verified by building wms against a packed candidate: 0 errors across all 23 projects, so the merge with wms's own declaration is safe. ts-jest type checking is on. Removing diagnostics:false surfaced four unsafe casts in the specs. Enabling it needs an explicit types:[jest,node], and warning 151002 is ignored because its suggested fix zeroes function coverage for index.ts. Coverage threshold pinned at 100 so a regression fails rather than being reported and ignored; bail removed so CI shows every failure. ESLint added — there was no linting at all. Type-aware rules on src, relaxed for the provider file and specs where SDK and mock types are any by nature. A MinIO integration test covers the real S3 wire protocol. Skipped unless MINIO_TEST_ENDPOINT is set, so the default suite needs no Docker. The mocked suite could not have caught the NoSuchKey/NotFound mismatch fixed in #9. CI runs lint and build alongside tests; Sonar now runs on pull requests instead of only after merge. Dependabot watches npm, not just actions. Deleted the event-bus plan docs describing a plugin removed in c001efc. skipLibCheck stays on: disabling it fails on thread-stream's .d.ts, not our code. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Everything remaining before 2.16.0 is cut. Stacked on #13; retarget to
mainonce that merges. No version bump here.Dependency
@google-cloud/storage7 → 8, the only upgrade still available (TypeScript 7 stays blocked —ts-jestpeers<7, and TS 7 ships nolib/typescript.jsat all, only a native binary behind a JSON-RPC bridge).The suite mocks GCS, so it cannot catch an API change. Verified against the real client that all eight methods the code calls still exist:
Storage.bucket,bucket.file,bucket.upload,file.exists,file.save,file.getMetadata,file.createReadStream,file.createWriteStream.Fixes #11 — and a wider version of it
src/types.tsnow augmentsFastifyInstancewithFileStore, so consumers get compile-time safety instead of declaring it themselves.While doing it: nothing imported
types.ts. TypeScript only applies a module augmentation if the declaring file is in the consumer's compilation, andindex.d.tsnever referenced it — so the pre-existingFastifySchemaaugmentation was dead too.index.tsnow imports it for the side effect.That makes the augmentation live for consumers, which is exactly the risk that kept #11 open. Verified rather than assumed: packed this branch, installed it into a wms worktree, and ran a full build.
Type checking in tests
diagnostics: falseis gone. It was suppressing TypeScript errors in specs, which is how #11 stayed invisible. Removing it surfaced four unsafeas jest.Mockcasts, nowas unknown as jest.Mock.Two things this needed:
types: ["jest", "node"]in the ts-jest tsconfig override — without it every spec fails withCannot find name 'describe'.isolatedModules: true) dropsindex.tsfunction coverage to 0%, which would defeat the threshold below.Coverage gate
coverageThresholdpinned at 100 for statements, branches, functions and lines. Coverage was computed and then ignored, so a regression would have merged green.bail: 1removed so CI reports every failure rather than the first.ESLint
There was none — Prettier only. Type-aware rules on
src, relaxed forfile-store.tsand the specs, where SDK error types and mocks areanyby nature. Each relaxation is commented.One finding worth keeping:
no-explicit-anypushed toward changingDataStream.onto a narrower element type, which breaks structural compatibility with node'sReadable. Reverted with a targeted suppression — theany[]matchesEventEmitterdeliberately.Real S3 integration test
file-store.minio.integration.spec.tsruns against actual MinIO: 6 tests covering missing-key handling, round-trip,HeadObjectmetadata, streaming, and the multipart upload path.Skipped unless
MINIO_TEST_ENDPOINTis set, so the default suite still needs no Docker. This closes a real gap — the mocked suite could not have caught theNoSuchKey/NotFoundmismatch fixed in #9.CI and hygiene
lintandbuildalongside testspull_request; it previously ran only on push tomain, so it could record problems but never block onenpm-run-all@4, Node 20 and an unusedtestcontainerssat untoucheddocs/superpowers/plans/*, describing the event-bus plugin removed inc001efcskipLibCheckstays on. Disabling it fails onthread-stream@4.2.0, whose.d.tsreferencesTransferListItem— a name itsworker_threadstypes do not export. Third-party, not ours. The comment claiming it was a@nats-io/jetstreamworkaround is corrected.Verification
Not included
CODEOWNERS. The org ruleset setsrequire_code_owner_review: true, so the requirement is currently vacuous — but adding the file activates it, and a wrong team name would block every PR. Existing teams aredev-leads,employees,kautilyan-ai,strings-corp,test-unity,verlauf; none is obviously the owner. Needs a decision, not a guess.