Skip to content

Improve recreate command flow - #30

Merged
andreccosta merged 6 commits into
mainfrom
fix/recreate-command-flow
Mar 14, 2026
Merged

Improve recreate command flow#30
andreccosta merged 6 commits into
mainfrom
fix/recreate-command-flow

Conversation

@andreccosta

Copy link
Copy Markdown
Owner

Summary

  • clean up CLI execution by returning friendly errors, normalizing container recreation inputs, and resolving platform data more safely
  • add unit tests covering metadata output, direct invocation, image pulling, and auto-remove container behavior
  • inject release version metadata at build time and refresh the README install and usage notes

Verification

  • go test ./...
  • make all

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the docker recreate CLI/plugin execution flow by returning friendly errors, normalizing container recreation inputs, and resolving image platform data more safely, while also adding unit tests and build-time version injection.

Changes:

  • Refactors CLI entrypoint into a testable run/runCommand flow with friendlier error handling and injectable Docker client.
  • Updates recreate behavior: platform resolution (descriptor-first, image-inspect fallback), optional image pulling, and safer networking/name handling.
  • Adds unit tests for metadata output, direct invocation behavior, image pull consumption/closure, and auto-remove container handling; updates README and Makefile for version injection.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
main.go Refactors CLI flow, adds build-injected version metadata, and improves recreate/platform/pull behavior with testable abstractions.
main_test.go Adds unit tests covering metadata, invocation paths, pull behavior, platform resolution, and auto-remove behavior.
README.md Fixes releases URL typo and clarifies usage for plugin vs direct binary invocation.
Makefile Injects release version via ldflags and updates dependency fetching to go mod download.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread Makefile Outdated
Comment thread main.go Outdated
Comment thread main.go
@andreccosta
andreccosta force-pushed the fix/recreate-command-flow branch from ad42bc9 to 46cab6b Compare March 14, 2026 16:51
@andreccosta
andreccosta merged commit c41d562 into main Mar 14, 2026
1 check passed
@andreccosta
andreccosta deleted the fix/recreate-command-flow branch March 14, 2026 16:52
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.

2 participants