Skip to content

refactor(cli): isolate platform internals#106

Merged
Ali1213 merged 8 commits into
ucloud:masterfrom
Episkey-G:codex/p5-p7-platform-work
Jul 10, 2026
Merged

refactor(cli): isolate platform internals#106
Ali1213 merged 8 commits into
ucloud:masterfrom
Episkey-G:codex/p5-p7-platform-work

Conversation

@Episkey-G

Copy link
Copy Markdown
Collaborator

Summary

  • Move legacy platform runtime code from top-level base into cmd/internal/platform and remove top-level base, ux, and ansi packages.
  • Move ANSI helpers into pkg/ui and keep product-facing contracts in pkg/cli/pkg/ui.
  • Preserve products/ production code unchanged while tightening hack/check-product and runtime guard tests against legacy imports.
  • Fix api --repeats failure handling so failures include error detail and return a non-zero exit code.

Validation

  • go test ./...
  • go vet ./...
  • make build
  • go run ./hack/gen-products
  • go test ./hack/snapshot -count=1
  • go test ./hack/check-product -count=1
  • go run ./hack/check-product
  • git diff --exit-code -- products
  • test ! -d base && test ! -d ux && test ! -d ansi
  • rg 'github.com/ucloud/ucloud-cli/(base|ux|ansi)' --glob '!docs/**' --glob '!TODOS.md' returned no matches
  • rg 'github.com/ucloud/ucloud-cli/(base|ux|ansi|cmd/internal)' products --glob '!**/*_test.go' returned no matches

E2E already verified on this branch

  • UHost live lifecycle create/delete cleanup passed.
  • ULHost repeat create cleanup passed.
  • OAuth refresh + Bearer API project list passed.
  • OAuth auth login --no-browser localhost callback flow passed.
  • Negative api --repeats ULHost create with invalid params returned rc=1, printed API error detail, and follow-up DescribeULHostInstance returned TotalCount=0.

Notes

  • products/ code is intentionally unchanged.
  • The historical --profile=... / -p ... early-parse inconsistency is intentionally deferred and not part of this PR.
  • Local untracked docs/TODOS drafts were not committed.

@Ali1213 Ali1213 merged commit 80d5f66 into ucloud:master Jul 10, 2026
12 of 13 checks passed
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