This repository was archived by the owner on Apr 15, 2026. It is now read-only.
feat(labctl): implement images command suite - #30
Merged
jmgilman merged 4 commits intoDec 20, 2025
Conversation
Implement all CLI commands for the labctl images tool: - sync: Download, verify, decompress (xz/gzip/zstd), upload to S3, write metadata, and update local files with regex replacements - validate: Check manifest YAML syntax and verify URLs via HEAD requests - list: Display images from S3 bucket with metadata in tabular format - prune: Remove orphaned images not in manifest (with --dry-run) - upload: Upload local files to S3 with SHA256 checksum and metadata Also adds internal/updater package for regex-based file updates with Go template variable substitution. Closes HOM-20 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…rror validation - Update validate command to report all validation errors instead of short-circuiting on first error - Add ValidateAll() methods to ImageManifest and Image types that return []error instead of single error - Add LoadManifestRaw() and ParseManifestRaw() functions for loading manifests without validation (allowing error collection) - Add comprehensive unit tests for validate command with mock HTTP client - Add unit tests for sync command (verifyChecksum, decompress, dry-run) - Add unit tests for upload command (computeFileChecksum) - Add unit tests for list command (formatSize) - Add unit tests for prune command (error handling) All tests pass with `go vet` and `golangci-lint` clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive mocked tests for upload, list, prune, and sync commands: - Add store.Client interface for dependency injection - Create mockStoreClient test helper in testutil_test.go - Refactor commands to accept store.Client interface - Add runListWithClient, runPruneWithClient, runUploadWithClient helpers - Add tests covering: success paths, error handling, edge cases 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add HTTPClient interface and full sync path tests with mocked HTTP: - Add HTTPClient interface for dependency injection - Add syncImageWithHTTP and downloadToTempWithClient functions - Add httptest-based tests for download operations - Add full sync path tests: download → verify → decompress → upload → metadata - Test error paths: download failure, checksum mismatch, upload error All sync behaviors now have mocked coverage without network calls. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the
labctl imagesCLI commands for managing OS images in S3-compatible storage (iDrive e2) as part of the GitOps image pipeline.Commands Implemented
Key Features
images.lab.gilman.io/v1alpha1).meta.json) for image trackingfiles_changedfor PR automation)Testing
store.Clientinterface)HTTPClientinterface)Test plan
just allpasses (fmt, lint, vet, test)Closes HOM-20
🤖 Generated with Claude Code