Skip to content

chore: consolidate container server into forkzero/s3proxy-docker#156

Merged
gmoon merged 3 commits into
masterfrom
chore/consolidate-container-server
Jul 14, 2026
Merged

chore: consolidate container server into forkzero/s3proxy-docker#156
gmoon merged 3 commits into
masterfrom
chore/consolidate-container-server

Conversation

@gmoon

@gmoon gmoon commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Resolves the two-parallel-servers duplication. forkzero/s3proxy-docker/server.js becomes the single container server; this repo tests the library directly against src/ with tsx.

The problem

examples/fastify-docker.ts + examples/Dockerfile existed only to give the Docker-based CI a container to run. It had drifted from the published image's server:

examples/fastify-docker.ts (deleted) s3proxy-docker/server.js (canonical)
API older proxy.fetch() + manual writeHead/pipe/hijack fetchWeb() (one line)
/health returns OK, no S3 check real healthCheck()
Image tsx in-image, NODE_ENV=development digest-pinned, non-root, tini, runs node

The change (Option A — downstream owns the runtime)

  • Delete examples/fastify-docker.ts + examples/Dockerfile.
  • Rewire Make targets to local tsx: conformance-docker → conformance-local, test-validation-docker → validation-local, artillery-docker → artillery-local (kept). Dropped dockerize-for-test / package-for-docker / test-all-docker.
  • DRY: factored the "boot tsx server → wait → run → clean up" boilerplate into scripts/with-local-server.sh, used by all three targets.
  • conformance/validation default to fastify-basic.ts (XML error bodies match the image's contract; core conformance is target-agnostic since kit 0.2.1).
  • CI: Validation + Performance jobs run the -local targets — no Docker build, no Build step (tsx runs src). The published image is built + conformance-tested in forkzero/s3proxy-docker's own CI.
  • Docs (README matrix/structure, maintenance, performance) updated.

Why this is safe

The library's HTTP contract is asserted directly against src via conformance-local/validation-local; the packaged-artifact-under-node concern stays covered by the existing Package Verification job; the actual container image is validated downstream. Net −148 lines.

Verification (local)

conformance-local, validation-local (24/24), artillery-local all exit 0.

🤖 Generated with Claude Code

gmoon and others added 3 commits July 14, 2026 11:11
This repo carried a second container server (examples/fastify-docker.ts +
examples/Dockerfile) that existed only to give the Docker-based CI something
to run. It duplicated — and had drifted from — the published image's server:
it used the older proxy.fetch() with manual writeHead/pipe/hijack, a /health
that skipped the S3 check, and ran tsx inside the image with
NODE_ENV=development. The real, prod-hardened server (Hono + fetchWeb(),
digest-pinned image, non-root, tini) lives in forkzero/s3proxy-docker.

Make s3proxy-docker's server.js the single source of truth. This repo tests
the library directly by running an example server with tsx against src/ (no
build, no image) and asserting the HTTP contract:

- Delete examples/fastify-docker.ts and examples/Dockerfile.
- Replace the *-docker Make targets with local tsx equivalents:
  conformance-docker -> conformance-local, test-validation-docker ->
  validation-local, artillery-docker -> artillery-local (kept). Drop
  dockerize-for-test / package-for-docker / test-all-docker.
- Factor the "boot tsx server, wait, run, clean up" boilerplate into
  scripts/with-local-server.sh (used by all three local targets).
- conformance/validation default to fastify-basic.ts, whose XML error bodies
  match the published image's error contract; the core conformance scenario
  is target-agnostic (kit 0.2.1).
- CI: Validation + Performance jobs run the -local targets (no Docker build,
  no Build step needed — tsx runs src). The published image is built and
  conformance-tested in s3proxy-docker's own CI.
- Docs (README, maintenance, performance) updated; cleanup script no longer
  references the removed examples/*.tgz packing.

Verified locally: conformance-local, validation-local (24/24), and
artillery-local all exit 0. Net -148 lines.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
MD013 inherently fights markdown tables (the Test Coverage Matrix rows are
all 80-90 chars) and URLs. The repo had no markdownlint config, so Codacy
applied the default and flagged any *edited* table row. Disable the one rule
rather than contorting table cells.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gmoon
gmoon merged commit 857409a into master Jul 14, 2026
9 checks passed
gmoon added a commit that referenced this pull request Jul 14, 2026
The lattice was ~878h behind code (health WARN). Reconciled via the lattice
CLI (add/resolve/verify/edit/edge, then drift --acknowledge; lint + drift now
clean). New nodes:

- REQ-CORE-007 / IMP-CORE-005 — fetchWeb() Web-standard adapter (PR #144/#145);
  IMP supersedes IMP-EXAMPLE-001's hand-rolled Hono conversion.
- REQ-BUILD-003 / IMP-BUILD-002 — @forkzero/s3-website-test-kit extraction +
  adoption and the conformance CI gate (PRs #150-#152).
- REQ-EXAMPLE-003 / IMP-EXAMPLE-002 — container-server consolidation into
  forkzero/s3proxy-docker + local tsx CI targets (PR #156; #153/#155 context
  folded in); supersedes REQ-EXAMPLE-002.
- REQ-TEST-002 / IMP-TEST-002 — de-flake of the streaming-memory RSS bound
  under coverage instrumentation (PR #154).

Modified: REQ-EXAMPLE-002 -> wontfix + status superseded (its premise,
examples/fastify-docker.ts, was deleted); IMP-EXAMPLE-001 -> status superseded
(historical body preserved).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant