| docs: track AI reviewer identity and issue links | 7 months ago |
| !221 merge feature/issue-260-precommit-followup into main feat(precommit): structured reason, install failure categories, stdout-only version (#260) Created-by: zxf_0731 Commit-by: zxf_0731 Merged-by: aflyingto Description: ## 变更说明 落地 #260 跟踪的三条 gc precommit check 后续项(PR #220 评审时评估为非阻塞、暂缓到后续 PR)。三项均为提升 agent / 脚本可消费性与健壮性的增量改进,不改变既有命令行为与退出码。 ## 变更内容 1. **--json 增加结构化失败原因字段 reason** - pkg/precommit.Result 新增 Reason(json:"reason,omitempty"),取值为稳定常量:no_config / tool_missing / hook_missing / run_failed / not_in_repo。 - 在 Check 各退出点设置;not_in_repo 由命令层(不进入 Check)在 --json 时输出。环境完全就绪时 reason 省略。 2. **安装失败按错误类型细分** - EnsureTool 依据各 installer 输出将失败分类为 权限不足 / 网络失败 / 工具链缺失,在聚合错误后追加针对性修复指引;多次同类失败去重、顺序稳定。 3. **ToolVersion 版本探测改用 stdout-only** - CommandRunner 接口新增 RunStdout(基于 cmd.Output()),ToolVersion 改用它,避免 pre-commit --version 在 stderr 输出 warning 时污染版本解析;Run(合并输出)仍用于安装 / run 的完整诊断。 ## 关联 Issue - Closes #260 - Related #258 #220 ## 测试计划 - [x] gofmt / go vet 干净 - [x] go build ./... 通过 - [x] 全量单测串行 go test -p 1 ./... → 74 包全 ok、0 失败(并行 go test ./... 在本机会因编译器并发 OOM 误报,与本改动无关) - [x] 新增单测覆盖:reason 各分支、not_in_repo JSON、安装失败分类(权限/网络/去重)、stdout-only 版本解析忽略 stderr warning;全部基于 fake CommandRunner,不依赖真实 pre-commit ## 文档同步 - docs/COMMANDS.md:补充 reason 字段与安装失败分类指引。 - docs/superpowers/specs/2026-06-03-precommit-check-design.md:更新 JSON 示例、安装策略、runner 双方法说明及 #260 跟踪状态。 ## 风险 - CommandRunner 接口新增方法属内部包(pkg/precommit)契约,所有实现者已同步更新,无外部 API 影响。 - JSON 仅新增 omitempty 字段,向后兼容。 See merge request: gitcode-cli/cli!221 | 5 months ago |
| feat: cover issue 246 CLI gaps Co-authored-by: aflyingto<wupengfei10@huawei.com> | 5 months ago |
| docs: track AI reviewer identity and issue links | 7 months ago |
| docs(auth): add proxy configuration guide - Add section explaining HTTP_PROXY/HTTPS_PROXY support - Document common configuration errors - Provide correct URL format examples Closes #166 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> | 6 months ago |
| !233 merge feature/issue-254 into main feat(pr): add --labels flag to pr create Created-by: langjitianya008 Commit-by: langjitianya008 Merged-by: aflyingto Description: ## 变更内容 为 gc pr create 添加 --labels (-l) 参数,支持创建 PR 时直接指定标签,无需再单独执行 gc pr edit --labels。 ### 具体改动 - **api/queries_pr.go**: CreatePROptions 添加 Labels []string 字段;buildPRCreateFormValues 添加 labels[] 表单编码(与 pr edit 和 issue create 一致) - **pkg/cmd/pr/create/create.go**: CreateOptions 添加 Labels []string 字段;注册 --labels flag;createRun 将 labels 传入 CreatePROptions - **pkg/cmd/pr/create/create_test.go**: 添加 3 个测试:labels 传入 API、无 labels、flag 解析 - **docs/COMMANDS.md**: 添加 --labels 示例和说明 ## 验证 - [x] go build 通过 - [x] go vet 通过 - [x] gofmt 通过 - [x] go test ./pkg/cmd/pr/create/... 全部通过(22 个测试,覆盖率 83.3%) - [x] go test ./api/... 通过 - [x] gc pr create --help 输出正确 - [x] gc schema "pr create" 中 labels flag 描述准确 ## 安全审查 - 无硬编码 token/password/secret - 无认证/权限/网络调用变更 - 仅使用已有的 CreatePullRequest API,添加 labels 表单字段 ## 风险 - risk/low: 仅在 pr create 时添加可选的 labels 参数,不影响现有功能 Refs #254 Co-Authored-By: Claude <noreply@anthropic.com> See merge request: gitcode-cli/cli!233 | 5 months ago |
| chore: prepare release v0.5.9 | 5 months ago |
| docs: add gitcode cli example case library | 5 months ago |
| feat: cover issue 246 CLI gaps Co-authored-by: aflyingto<wupengfei10@huawei.com> | 5 months ago |