Commit Graph
9 Commits
Author SHA1 Message Date
Sebastian Lorenz 847791d217 fix(docker): address the independent review
- A connection that drops while a response is read is ConnectionFailed
  (ADR 0008 item 9), not InvalidResponse; an undecodable response says why
  (an undeclared status, an oversized NDJSON line) instead of "unexpected
  status 200".
- No error keeps an HttpClientError with its request, which holds
  X-Registry-Auth, the /auth password and secret query parameters; the
  credential test covers four ways a pull fails and looks for the header.
- DockerBuildContext puts ./Dockerfile first, rejects a Dockerfile outside
  the directory, and names the file a tar error is about.
- Docs: unread exec output keeps exitCode waiting; plugin privileges and
  install send credentials.
- The test stub is an Effect (no Effect.runSync); the changeset is one
  sentence; the codegen fails on a non-OK status when it fetches the spec.
2026-11-09 08:20:04 +00:00
Effect Bot ca3a4f8820 feat(docker): speak Docker Engine API 1.52 only
- generate the schemas from moby's api/docs/v1.52.yaml, and drop the pre-1.52 /system/df patch
- send every request at /v1.52 after one unversioned /version check that the Engine serves it;
  UnsupportedApiVersion reports the Engine's range and asks to upgrade an old Engine
- remove negotiation, the apiVersion setting, ApiVersions gates and OptionNotSupported
- accept DOCKER_API_VERSION only as 1.52
- remove post-1.52 surface: image attestations, the images identity query, keep-storage; events as x-ndjson
- DockerConfig hashes context names with effect/crypto's Digest, after main replaced effect/Crypto
- docs, codegen notes and the changeset state the fixed support policy
2026-11-09 06:50:04 +00:00
Tim Smart 9f61304547 test(docker): keep focused contract and integration coverage 2026-11-09 06:50:04 +00:00
Effect Bot a06baba608 test(docker): reduce the suites to the accepted behavior
- unit suites cut from 117 to 55 tests, merged per behavior
- Swarm and plugin services covered by fake-engine round trips over DockerApi
- live suites cut to 11 tests; the docker:dind suites and their helper are removed
- the pinned API 1.44 CI rerun becomes one live decode test in DockerSystem
- CI no longer pulls docker:29-dind or busybox
- drop the platform-node DockerApi test, which duplicated the fake-engine round trip
2026-11-09 06:38:08 +00:00
Sebastian Lorenz 16182f31cf fix(docker): check DockerApi against the API document as published
The manifest was read from the document after the codegen's patches,
so the spec bugs they fix never reached the conformance tests, and the
field check partly compared DockerApi with the codegen's own patches.
docker-codegen now writes it from the document as published, and the
tests list those bugs where the Engine differs: secret and config
create answer { "ID" }, and /system/df answers its pre-1.52 fields on
the older Engines the client decodes.
2026-11-08 20:21:54 +00:00
Sebastian Lorenz c0fc2eba98 feat(docker): check DockerApi's body fields against the pinned API document
docker-codegen now records the fields of each operation's request body
and success responses in the manifest, as paths (Parent.Child, List[],
Map.*) with the required ones marked, following $refs and merging allOf,
oneOf and anyOf. A second conformance test reads the same paths from
each endpoint's OpenAPI and compares them where both sides state fields,
reporting only the top of a differing subtree.

DockerApi's own models (AuthConfig, ExecStartConfig, ServiceSpec, ...)
are where drift would hide; two differences are intended and listed: an
unlock requires its key, and AuthConfig has the identitytoken the
document leaves out. A response's required fields are read as optional
on purpose: toCodecGoJson reads a missing key as Go's zero value.
2026-11-08 20:21:54 +00:00
Sebastian Lorenz f80b4114b7 feat(docker): check DockerApi's OpenAPI against the pinned API document
The conformance test now builds each endpoint's OpenAPI operation with
OpenApi.fromApi, alone, since DockerApi splits some operations into
endpoints on one route, and compares it with the manifest, which
docker-codegen now writes with required headers, whether a body is
taken and required, and the media types of the request body and of the
success responses. Required parameters are checked per endpoint, so a
split can't hide one. Only the bodies the document marks required are
checked, and media types only where it states some.

What it found is declared now: X-Registry-Auth is optional wherever the
document doesn't require it (image push), since the Engine is anonymous
without it; events are application/jsonl, the Engine's media type from
API 1.52 (application/json before, which the client reads the same);
image tag's repo is optional, with the no-op 200 the Engine answers
without one. The differences that stay are listed with their reasons,
verified live where the Engine differs from the document.
2026-11-08 20:21:53 +00:00
Sebastian Lorenz 6be31ce4e3 feat(docker): check DockerApi against the pinned API document
docker-codegen now also writes a manifest of the pinned API document's
operations: method, path, query and header parameters by wire name,
required query parameters, whether a body is taken, and the success and
error statuses. A test compares DockerApi with it and lists where they
differ on purpose, each because the Engine differs from the document
(verified live) or because HttpApi can't declare the operation: the
WebSocket attach, and the deprecated BuildKit session.

Gaps it found are declared now: HEAD /_ping as system.pingHead, the
build's BuildKit `outputs` (BuildOptions.outputs too), attach's stream
flags as optional, and save's `names` as optional (without them the
Engine answers an empty archive).
2026-11-08 20:21:53 +00:00
Sebastian Lorenz fdc7a6dedd feat(docker): generate the Docker Engine API Schemas
Add packages/tools/docker-codegen, which generates effect/docker/DockerSchema
from moby's pinned API document (1.56) with a standing list of computed patch
families: hoisted operation bodies, flattened allOf, empty-object maps, Go nil
(every nullable mark dropped, decoded by Schema.toCodecGoJson), and lenient
enums. Every definition is an exported Schema, followed by its decoded type
under the same name.

The formatter step fails instead of writing pnpm's error output over the
generated file.
2026-11-08 20:20:53 +00:00