Skip to content

refactor: adopt cocoon v0.4.5 (cliutil + narrowed store constructors) - #8

Merged
CMGS merged 1 commit into
masterfrom
refactor/cocoon-v0.4.5
Jul 2, 2026
Merged

refactor: adopt cocoon v0.4.5 (cliutil + narrowed store constructors)#8
CMGS merged 1 commit into
masterfrom
refactor/cocoon-v0.4.5

Conversation

@CMGS

@CMGS CMGS commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Upstream cocoon v0.4.5 closed both issues we filed, so the local workarounds go away (net −51 lines):

  • cocoon#72 → cmd/cliutil: the local cli/ package (a deliberate copy of cmd/core's output helpers, kept to avoid the firecracker + go-containerregistry deps) is deleted; all call sites import cliutil (OutputFormatted/OutputJSON/AddFormatFlag/FormatSize/IsURL). Bonus: home.Ctx was a verbatim copy of what is now cliutil.CommandContext — deleted too. Only formatTime stays local in cmd/vm (our records store RFC3339 strings; no upstream equivalent).
  • cocoon#73 → narrowed constructors: cloudimg.New(ctx, rootDir)home.OpenStore no longer builds a config.Config; the CLOUDHV.fd placeholder path uses the new images.FirmwarePath(rootDir).
  • Dep bumps ride along (grpc 1.79.3, go directive 1.26.4 — matching upstream's CVE cleanup).

Validation

  • gofumpt clean; build + golangci-lint (darwin & linux) 0 issues; go test -race green.
  • Functional smoke: vm list table + -o json + image list all render identically through cliutil.
  • grep confirms zero references to the deleted cocoon-macos/cli package remain.

🤖 Generated with Claude Code

Upstream resolved our two issues, so drop the local workarounds:
- cocoon#72: cmd/cliutil now holds the dependency-free CLI helpers — delete
  the cli package copy and import cliutil (OutputFormatted/OutputJSON/
  AddFormatFlag/FormatSize/IsURL); home.Ctx falls to cliutil.CommandContext.
  FormatTime stays local in cmd/vm (records store RFC3339 strings; no
  upstream equivalent).
- cocoon#73: cloudimg.New/NewConfig take a plain rootDir — home.OpenStore
  drops the cargo-culted config.Config; the CLOUDHV.fd placeholder path now
  comes from images.FirmwarePath.
@CMGS
CMGS force-pushed the refactor/cocoon-v0.4.5 branch from c341fce to 69cbd2d Compare July 2, 2026 07:37
@CMGS
CMGS merged commit b2fd74b into master Jul 2, 2026
3 checks passed
@CMGS
CMGS deleted the refactor/cocoon-v0.4.5 branch July 2, 2026 07:41
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