You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dockerode's buildImage declares its first parameter as NodeJS.ReadableStream, which requires exactly those three absent members. So this assignment is unsound in the same way that #1861 had to paper over twice in container-pack.ts — except here it is uncast and uncommented, and it compiles.
Why it compiles
@types/tar-fs@2.0.4 models tar-fs 2.x, whose inner tar-stream resolves to DefinitelyTyped rather than to tar-stream's own bundled declarations. --traceResolution on the real tsconfig.build.json shows both type identities live in one program: tar-stream/index.d.ts@3.2.1 for direct imports, and @types/tar-stream/index.d.ts@3.1.4 via @types/tar-fs.
That split is held in place by nx, which the lockfile shows pinning tar-stream to exactly 2.2.0 and thereby occupying the root slot with an untyped 2.x copy.
Trigger
Any of:
tar-stream getting hoisted to the root
tar-fs shipping its own types (as tar-stream just did in 3.2.1)
@types/tar-fs being updated to model tar-fs 3.x
Symptom would be a build failure in a file nobody edited, reading TS2345 ... Type 'Pack' is missing the following properties from type 'ReadableStream': isPaused, unpipe, wrap.
Coverage gap
No spec covers this handler. apps/server-core-worker/test/unit/ has 7 spec files; the master-image ones cover the synchronizer, not the builder. By contrast the equivalent path in container-pack.tsis covered end-to-end by test/unit/docker/pack.spec.ts, which was confirmed to genuinely assert (mutating its expected file size makes it exit 1).
Suggested handling
Do not add a speculative cast — the file compiles and works, and an as unknown as against a green build is unreviewable. Options, roughly in order of value:
A spec covering master-image-builder's execute handler, mirroring docker/pack.spec.ts. That converts a future silent break into a test failure and closes the real gap.
A two-line comment at :129 recording that tar-fs returns a streamx Pack and that @types/tar-fs@2.0.4 models 2.x, so the assignment is unsound-but-working.
Found while auditing #1862. Nothing is broken today — this is a latent break with an identified trigger.
What
apps/server-core-worker/src/app/components/master-image-builder/handlers/execute/module.ts:129-131tar-fs@3.1.3returns a streamxPack, not anode:stream.Readable. Verified at runtime:dockerode'sbuildImagedeclares its first parameter asNodeJS.ReadableStream, which requires exactly those three absent members. So this assignment is unsound in the same way that #1861 had to paper over twice incontainer-pack.ts— except here it is uncast and uncommented, and it compiles.Why it compiles
@types/tar-fs@2.0.4models tar-fs 2.x, whose innertar-streamresolves to DefinitelyTyped rather than to tar-stream's own bundled declarations.--traceResolutionon the realtsconfig.build.jsonshows both type identities live in one program:tar-stream/index.d.ts@3.2.1for direct imports, and@types/tar-stream/index.d.ts@3.1.4via@types/tar-fs.That split is held in place by
nx, which the lockfile shows pinningtar-streamto exactly2.2.0and thereby occupying the root slot with an untyped 2.x copy.Trigger
Any of:
tar-streamgetting hoisted to the roottar-fsshipping its own types (astar-streamjust did in 3.2.1)@types/tar-fsbeing updated to model tar-fs 3.xSymptom would be a build failure in a file nobody edited, reading
TS2345 ... Type 'Pack' is missing the following properties from type 'ReadableStream': isPaused, unpipe, wrap.Coverage gap
No spec covers this handler.
apps/server-core-worker/test/unit/has 7 spec files; the master-image ones cover the synchronizer, not the builder. By contrast the equivalent path incontainer-pack.tsis covered end-to-end bytest/unit/docker/pack.spec.ts, which was confirmed to genuinely assert (mutating its expected file size makes it exit 1).Suggested handling
Do not add a speculative cast — the file compiles and works, and an
as unknown asagainst a green build is unreviewable. Options, roughly in order of value:master-image-builder's execute handler, mirroringdocker/pack.spec.ts. That converts a future silent break into a test failure and closes the real gap.tar-fsreturns a streamxPackand that@types/tar-fs@2.0.4models 2.x, so the assignment is unsound-but-working.@types/tar-fsortar-fsmoves — see fix(deps): bump the minorandpatch group with 8 updates #1862 for why hub is currently decliningtar-stream3.2.1 rather than adapting to it.