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 — feat(platform): P3 Part 0 — C2 ux/platform exposure (structured output, progress facade, request-log handler) by Episkey-G · Pull Request #8 · Episkey-G/ucloud-cli

Conversation

@Episkey-G

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

Copy link
Copy Markdown
Owner

P3 Part 0 — 平台地基(C2 ux 平台暴露)

纯平台改动,产品命令零改动;为 batch-1 计算域产品迁移(尤其 uhost 并发轮询)补齐平台契约。

新增能力

  • pkg/cli/result.go — 结构化写出 OpResultRow / ProgressWriter / EmitResult(table no-op;json/yaml 出 stdout)
  • pkg/cli/progress.go — 并发进度 facade NewProgress/NewBlock/Refresh/Disable/Sspoll + ConcurrentAction(Block = ux.Block)
  • base/util.go — Poller.Sspoll 非 TTY 抑制(镜像 Spoll)
  • ux/document.go — 导出 NewDocument(writer) + Document + 非 TTY 自动抑制(全局 Doc 不动)
  • pkg/cli/forward.go + pkg/command/bind.go — BindGroup、RegionList/ZoneList/ProjectList getter、AllRegions() ([]string, error)(保留 fetch error)、Log*/LogFilePath forwarder
  • base/{client,log}.go — 平台请求日志 handler(logToFile 只写 cli.log、不传 DAS),替代产品逐命令手拼

验证

  • go build/vet ./... ✓;命令树/补全 golden 逐字不变 ✓;check-product exit 0 ✓;全仓 go test(跳 live TestUhost)0 失败 ✓
  • 真实 CLI 增删改查 master vs branch 逐字一致;真实 eip allocate→release 计费生命周期通过(成本 free、无残留)
  • import 边界干净(base 仅在 cli forward/serviceclient/context/progress;ux 仅 progress.go;pkg/command 纯净)
  • 唯二新增:① 每请求记本地 cli.log(不上报 DAS);② Sspoll 非 TTY 抑制(TTY 行为不变)

性质

平台 PR(改 pkg/cli、base、ux、pkg/command、cmd/root.go)——经 owner-gate 裁决。本 PR 作者为 admin(Episkey-G)。

🤖 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 5 commits June 30, 2026 15:34
@Episkey-G @claude
feat(ux): export NewDocument(writer) + non-TTY suppression
3c5fa0f
Writer-bound document with auto-disabled rendering on non-TTY, so platform code (pkg/cli) can hold a writer-scoped document without leaking spinner frames into machine output. Global Doc unchanged.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Episkey-G @claude
feat(pkg/cli): structured write output (ProgressWriter/EmitResult/OpR…
5ee86e8
…esultRow)

Platform write-result envelope: table mode unchanged (no-op), json/yaml emit structured {ResourceID,Action,Status} to stdout; progress narration routes to stdout(table)/stderr(json). Promoted from products/udb so products share one convention.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Episkey-G @claude
feat(pkg/cli,base): concurrent-progress facade + ConcurrentAction; TT…
1f999a1
…Y-aware Sspoll

ctx.NewProgress/NewBlock/Refresh/Disable/Sspoll + ctx.ConcurrentAction wrap ux/base behind the Context (Block=ux.Block alias). base.Poller.Sspoll now suppresses spinner on non-TTY, mirroring Spoll.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Episkey-G @claude
feat(pkg/cli,command): Context forwarders & getters (BindGroup, regio…
5005908
…n/zone/project, AllRegions, Log*)

command.BindGroup + ctx.BindGroup; ctx.RegionList/ZoneList/ProjectList getters for non-standard flags; ctx.AllRegions ([]string,error) injected via Deps (preserves the fetch error for --all-region); ctx.LogInfo/LogPrint/LogWarn/LogError/LogFilePath for non-request product diagnostics.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@Episkey-G @claude
feat(base): platform request-logging handler (cli.log-only, no DAS)
d7902b2
attachHandlers logs every API request uniformly at the SDK layer via logToFile (writes cli.log only, no telemetry upload), replacing per-command hand-rolled ToQueryMap logging. requestLogLine formats 'api: <Action>, request: <map>' with Password redacted.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

✅ 平台 PR 已放行(管理员自提或已获管理员批准),CI 通过后可合。判定:改动触及平台/受保护路径(base/client.go, base/log.go, base/logtofile_test.go, base/requestlog_test.go, base/sspoll_test.go, base/util.go, cmd/root.go, pkg/cli/allregions_test.go, pkg/cli/context.go, pkg/cli/context_getters_test.go, pkg/cli/context_log_test.go, pkg/cli/forward.go, pkg/cli/progress.go, pkg/cli/progress_test.go, pkg/cli/result.go, pkg/cli/result_test.go, pkg/command/bind.go, pkg/command/bindgroup_test.go, ux/document.go, ux/document_test.go)

All reactions

Sorry, something went wrong.

Uh oh!

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

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Jun 30, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d7902b2dab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread base/client.go
// (NO DAS upload) and skips completion (COMP_LINE) — see batch-1 plan Part 0
// Task 0.2 (decision A: keep request logs local, don't inflate telemetry).
sc.AddRequestHandler(func(c *sdk.Client, req request.Common) (request.Common, error) {
logToFile(requestLogLine(req))

@chatgpt-codex-connector chatgpt-codex-connector Bot Jun 30, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P1 Badge Redact sensitive request fields before logging

When users run requests that carry secrets outside the exact Password field, this new SDK-wide handler writes those secrets to cli.log; for example ucloud ulb-ssl-certificate add --private-key-file ... sets req.PrivateKey before CreateSSL, and requestLogLine serializes the whole query map while ToQueryMap only removes Password. Because this hook now runs for every service client request, private keys/SSL bundle contents and other password-like fields such as DiskPassword can be persisted in plaintext locally, so the request log path needs a broader denylist/redaction before enabling universal logging.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

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

All reactions
@Episkey-G
Episkey-G merged commit 5209add into master Jun 30, 2026
25 checks passed

Uh oh!

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

@Episkey-G
Episkey-G deleted the refactor/p3-part0-platform-ux-exposure branch June 30, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

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.