Skip to content

fix(cli): keep image command tree supported#331

Merged
innomentats merged 1 commit into
mainfrom
fix/image-command-deprecation
Jul 17, 2026
Merged

fix(cli): keep image command tree supported#331
innomentats merged 1 commit into
mainfrom
fix/image-command-deprecation

Conversation

@fuchencong

Copy link
Copy Markdown
Contributor

Summary

  • keep agent-compose image and its ls, pull, build, rm, and inspect subcommands as supported CLI commands without deprecation warnings
  • make agent-compose image pull [image] match the top-level pull [image] shortcut, including the no-argument project image workflow
  • update CLI regression coverage, README, and the English and Chinese command-line manuals to document the image command tree and its top-level shortcuts

Testing

  • GOFLAGS=-buildvcs=false go test ./cmd/agent-compose -run 'TestCLIImageRootCommandShowsHelp|TestIntegrationCLIImagesAliasesAndJSON|TestIntegrationCLIImagePullAliasesAndJSON|TestIntegrationCLIPullProjectImages|TestIntegrationCLIProjectBuildImages|TestIntegrationCLIImageRemoveAliasesAndJSON|TestIntegrationCLIImageInspectJSON|TestE2ECLIHelpCommands' -count=1
  • GOFLAGS=-buildvcs=false task lint GO_BUILD_CACHE_DIR="$GOCACHE" GOLANGCI_LINT_CACHE_DIR="$GOLANGCI_LINT_CACHE"
  • GOFLAGS=-buildvcs=false task build GO_BUILD_CACHE_DIR="$GOCACHE"
  • task test GO_BUILD_CACHE_DIR="$GOCACHE"
    • Unit: 74.17%
    • Integration: 62.53%
    • E2E: 61.75%
    • Combined: 78.08%
  • task docs:build currently fails because the existing English agent-compose-yaml-manual.md does not reference the commit, description, and display_name schema fields; this PR does not modify that manual or those schema fields

Checklist

  • Documentation updated when behavior or configuration changed.
  • Tests added or updated for user-visible behavior.
  • No secrets, private endpoints, internal certificates, or local runtime state included.

@monkeyscan

monkeyscan Bot commented Jul 17, 2026

Copy link
Copy Markdown

PR Title: fix(cli): keep image command tree supported

Commit: 93d23bc

本次 PR 将 agent-compose image 子命令树从“已废弃”状态提升为正式支持的命令结构,同时保留顶层快捷命令(如 pullimagesbuildrmiinspect image)作为别名。

核心改动:

  1. cmd/agent-compose/main.go:移除了 imageimage lsimage pullimage buildimage rmimage inspect 上的废弃警告逻辑;将 image pull 的参数约束从 ExactArgs(1) 改为 RangeArgs(0, 1),并让其统一委托给 runComposePullCommand,从而支持无参数时拉取整个项目的镜像(与顶层 pull 行为对齐)。
  2. cmd/agent-compose/main_test.go:移除了废弃警告的断言;在 TestIntegrationCLIPullProjectImages 中新增了对 image pull(无参数)的测试覆盖,验证顶层命令与 image 子命令行为一致。
  3. cmd/agent-compose/cli_help_e2e_test.go:更新了 help 文本期望,要求 stderr 为空(不再允许废弃警告),并新增了 image pull --help 的覆盖。
  4. docs / README:将文档中的命令示例从顶层快捷命令更新为 image 子命令形式,并明确列出顶层快捷命令与 image 子命令的对应关系。

整体评估:变更逻辑清晰,测试覆盖充分,文档同步更新,没有发现引入正确性、安全性或兼容性风险的缺陷。

@innomentats innomentats left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@innomentats
innomentats merged commit 5364e27 into main Jul 17, 2026
16 checks passed
@innomentats
innomentats deleted the fix/image-command-deprecation branch July 17, 2026 09:47
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