Skip to content

Refactor into packages, modernize deps, and add tests - #6

Open
JohanLindvall wants to merge 1 commit into
masterfrom
refactor-modernize
Open

Refactor into packages, modernize deps, and add tests#6
JohanLindvall wants to merge 1 commit into
masterfrom
refactor-modernize

Conversation

@JohanLindvall

Copy link
Copy Markdown
Owner

Restructure the codebase and bring it up to date:

  • Split package main: business logic moves into an app package (no global state), the HTTP registry server into a registry package with a route table, and tag-file handling into a tagfile package. main.go is now just flag parsing and dispatch.
  • Split the 500-line diz.go into archive/copy/manifest/registrymanifest files with clearer names; fix a bug in Merge that dropped all but the last new repo tag when coalescing manifests.
  • Fix the Docker-Content-Digest response header (was double hex encoded).
  • Update deflatewriter.go to the latest klauspost/pgzip, kept as a raw DEFLATE fork with every divergence documented.
  • Drop io/ioutil; replace the local str package with stdlib slices.
  • Update dependencies to latest and migrate to the modern docker client API, which lets the go.mod replace directive be removed.
  • Add a Makefile and tests across diz, dockerref, hashzip, imagesource, app, tagfile, util and registry (coverage ~67%).

Restructure the codebase and bring it up to date:

- Split package main: business logic moves into an `app` package (no
  global state), the HTTP registry server into a `registry` package with
  a route table, and tag-file handling into a `tagfile` package. main.go
  is now just flag parsing and dispatch.
- Split the 500-line diz.go into archive/copy/manifest/registrymanifest
  files with clearer names; fix a bug in Merge that dropped all but the
  last new repo tag when coalescing manifests.
- Fix the Docker-Content-Digest response header (was double hex encoded).
- Update deflatewriter.go to the latest klauspost/pgzip, kept as a raw
  DEFLATE fork with every divergence documented.
- Drop io/ioutil; replace the local str package with stdlib slices.
- Update dependencies to latest and migrate to the modern docker client
  API, which lets the go.mod `replace` directive be removed.
- Add a Makefile and tests across diz, dockerref, hashzip, imagesource,
  app, tagfile, util and registry (coverage ~67%).

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