GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor(platform): pure-platform debt cleanup — internal/common sink, dead-code removal, PrintJSON→pkg/ui by Episkey-G · Pull Request #4 · Episkey-G/ucloud-cli

Conversation

@Episkey-G

@Episkey-G Episkey-G commented Jun 25, 2026

Copy link
Copy Markdown
Owner

概要

纯平台债清理(不依赖任何产品迁移),执行计划 docs/superpowers/plans/2026-06-25-pure-platform-debt.md。把 base 里产品会用到的 stdlib-only 纯工具下沉到 internal/common、删 base 死代码、把纯渲染函数 PrintJSON 挪到 pkg/ui、删 pkg/cli 死字段 Context.biz。net −46 行,无行为变化。

改动(9 commits, base=8ff3ad0)

  • A1–A3: 新增并下沉 common.FormatDate / common.IsBase64Encoded,cmd 调用方切换,删 base 原件
  • A4–A5: 完成 FormatDateTime / GetFileList 去重(common 已有副本),切 cmd 调用方,删 base 原件(保留 base.GetHomePath)
  • A6: 删 base 死代码 WriteJSONFile/AppendToFile/LineInFile + 冗余 DateTimeLayout
  • B1: 新增 ui.PrintJSON,Context.PrintJSON 改委托 ui(保留 base.PrintJSON)
  • B2: 删死字段 Context.biz(全仓从未被读)
  • 收尾: 去掉 encoding.go 与 format.go 重复的 package doc 注释;(本地)删 out/ 旧产物

不变量(本地已验证)

  • go build ./... / go vet ./... 绿;go test 全绿(除已知 live-integration cmd.TestUhost,配额 RetCode 8357,非回归)
  • 命令树/补全 golden 不变:go test ./hack/snapshot/ 全 PASS,testdata/*.golden 未变
  • internal/common 保持 stdlib-only;pkg/ui 不 import base/ux;无新增 pkg/cli→ux 边
  • base.PrintJSON / GetHomePath / BizClient 等该留的都在,逐字行为一致

边界(本计划明确不做)

不动 .gitignore;不处理 ToQueryMap(会把 SDK 拖进 common,破坏 stdlib-only);不动 HandleError/Poller/serviceclient(留 C2 ux 重写)。pkg/ 属 protected path → scope-gate 预期标记「需 platform review」。

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Episkey-G and others added 9 commits June 25, 2026 01:00
@Episkey-G @claude
refactor(common): add FormatDate + IsBase64Encoded pure utils
70a01bc
Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Episkey-G @claude
refactor(common): sink FormatDate to internal/common; drop base.Forma…
05cdf18
…tDate

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Episkey-G @claude
refactor(common): sink IsBase64Encoded to internal/common; drop base …
752af88
…copy

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Episkey-G @claude
refactor(common): finish FormatDateTime dedup; drop base copy
c03e836
Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Episkey-G @claude
refactor(common): finish GetFileList dedup; drop base copy (keep base…
f089686
….GetHomePath)

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Episkey-G @claude
refactor(base): drop dead utils (WriteJSONFile/AppendToFile/LineInFil…
4e88392
…e) + redundant DateTimeLayout

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Episkey-G @claude
refactor(pkg/ui): add ui.PrintJSON; Context.PrintJSON delegates to ui…
b16abb2
… not base

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Episkey-G @claude
refactor(pkg/cli): drop dead Context.biz field (never read)
f027be6
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@Episkey-G @claude
refactor(common): demote duplicate package doc comment in encoding.go
7ce2ef5
format.go holds the canonical // Package common doc; encoding.go's first
line is now a plain file comment to avoid a duplicate package comment.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Episkey-G

Episkey-G commented Jun 25, 2026

Copy link
Copy Markdown
Owner Author

@codex

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Episkey-G and others added 2 commits June 25, 2026 13:25
@Episkey-G @claude
refactor(common): make encoding.go header a file comment, not a packa…
fc9031a
…ge doc

7ce2ef5 retyped encoding.go's leading comment to silence the duplicate
'// Package common' (staticcheck ST1000), but with no blank line before the
package clause Go still parsed it as a package doc — so 'go doc ./internal/common'
printed the encoding.go line ahead of the canonical doc in format.go.
Insert a blank line so the comment is a plain file comment; format.go is now
the sole package doc. go doc shows only the canonical text; build/vet, tests,
and command-tree/completion golden snapshots stay green. No behavior change.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Episkey-G @claude
refactor(base): dedup GetHomePath — route base callers to common.GetH…
80ec06d
…omePath

base.GetHomePath was a byte-identical duplicate of common.GetHomePath
(the latter added so internal/common's GetFileList stays self-contained &
stdlib-only). Point base's only callers — GetLogFileDir/GetLogFilePath in
log.go and GetConfigDir in util.go — at common.GetHomePath, delete the base
copy, and establish the correct base -> internal/common layering edge.
Drop the now-redundant base TestGetHomePath (internal/common/common_test.go
already covers it).

No behavior change: common.GetHomePath is verbatim-identical; common stays
zero-ucloud-dep so no import cycle. go build/vet, full test suite, and the
command-tree/completion golden snapshots are all green; binary smoke
(config list -> GetConfigDir -> common.GetHomePath) resolves ~/.ucloud OK.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Episkey-G
Episkey-G merged commit a609fc6 into master Jun 25, 2026
10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Episkey-G Episkey-G mentioned this pull request Jun 25, 2026
ci(release): also release on refactor/perf commits (keep patch-only) #5
Merged
@Episkey-G
Episkey-G deleted the feat/monorepo-restructure branch June 29, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Episkey-G
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.