Skip to content

refactor: simplify schemas, manifest builder, and registry error hand… - #31

Merged
karolyp merged 11 commits into
masterfrom
improvements-02-26
Feb 3, 2026
Merged

refactor: simplify schemas, manifest builder, and registry error hand…#31
karolyp merged 11 commits into
masterfrom
improvements-02-26

Conversation

@karolyp

@karolyp karolyp commented Feb 3, 2026

Copy link
Copy Markdown
Owner

…ling

  • ManifestSchema validates PascalCase Docker keys, outputs camelCase via v.transform; Manifest type uses InferOutput
  • DockerTarPusherOptionsSchema uses v.fallback for defaults, eliminating the redundant ApplicationConfigurationSchema; constructor now validates via v.parse
  • Replace stateful ManifestBuilder class with a pure buildManifest function; fix layer accumulation bug across multiple RepoTags
  • Use isAxiosError consistently in DockerRegistryService catch blocks

…ling

- ManifestSchema validates PascalCase Docker keys, outputs camelCase via
  v.transform; Manifest type uses InferOutput
- DockerTarPusherOptionsSchema uses v.fallback for defaults, eliminating
  the redundant ApplicationConfigurationSchema; constructor now validates
  via v.parse
- Replace stateful ManifestBuilder class with a pure buildManifest function;
  fix layer accumulation bug across multiple RepoTags
- Use isAxiosError consistently in DockerRegistryService catch blocks

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Feb 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 41041f9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
docker-tar-pusher Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Integration test hitting a real registry can exceed the default 5s limit.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 24.09% 240 / 996
🔵 Statements 24.09% 240 / 996
🔵 Functions 50% 16 / 32
🔵 Branches 54.54% 30 / 55
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/index.test.ts 100% 85.71% 100% 100%
src/types.ts 100% 100% 100% 100%
src/dtp/DockerRegistryService.ts 71.55% 61.53% 100% 71.55% 49-60, 103-110, 119-129
src/dtp/DockerTarPusher.ts 63.51% 44.44% 100% 63.51% 44, 50-56, 62-68, 77-83, 100-104
src/dtp/ManifestBuilder.ts 100% 100% 100% 100%
Generated in workflow #47 for commit 41041f9 by the Vitest Coverage Report Action

karolyp and others added 9 commits February 3, 2026 23:33
- Add compose.yaml with a registry service on port 5001, matching .env.test
- Remove hardcoded REGISTRY_URL from the Run tests step; .env.ci already
  provides the correct port (15000) matching the service port mapping

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Align compose.yaml and .env.test on port 15000 to match the CI service
port mapping. Remove .env.ci and the CI conditional in vitest.config.ts.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
v.fallback does not affect the output type — use v.pipe + v.transform
with ?? to apply defaults for chunkSize and sslVerify, matching the
pattern already used by ManifestSchema. Remove unused Manifest, Image,
and ProgressCallback type exports.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Parameterize the integration test with test.each over busybox, alpine,
and nginx. Each image gets its own tarball in beforeAll to avoid races.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
beforeAll pulls multiple images on a self-hosted Pi runner — bump its
timeout to 120s. Add afterAll to remove the tarballs from /tmp since
the runner persists between runs.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
nginx upload on the Pi runner exceeds 10s. 30s gives enough headroom
for larger images.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Eliminate the intermediate layersMetadata array and layerPromises
variable by inlining the upload map directly into Promise.all and
passing layerResults straight to buildManifest.

Also doubles testTimeout from 30s to 60s.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@karolyp
karolyp merged commit 2d16ae8 into master Feb 3, 2026
1 check passed
@karolyp
karolyp deleted the improvements-02-26 branch February 3, 2026 23:12
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