| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix(security): scan 12 additional inline --comment/--body/--description paths for secrets (#426) Follow-up to #424: same vulnerability class found in 12 more commands during review. Adds ScanContentForSecrets to inline flag paths that were passing content directly to API calls without scanning. Fixed paths: - issue close --comment - issue reopen --comment - pr close --comment - pr reopen --comment - pr reply --body - commit comments create --body - commit comments edit --body - milestone create --description - label create --description - repo create --description - repo sync --body - pr sync --body Each scan is placed at the start of the run function, before auth and any API call (fail-fast). System test (secret-scan.txtar) extended from 10 to 22 inline paths. Closes #426 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 3 个月前 | |
refactor: unify 5 duplicated getBody() to cmdutil.ReadBody delegation (#427) 5 commands had near-identical ~30-line getBody() copies that duplicated cmdutil.ReadBody logic (mutual exclusion, inline scan, file/stdin reading). The duplication was the root cause of #424 (inline --body bypassed scanning because local copies didn't sync ReadBody's ScanContentForSecrets addition). Replaced each with a 7-line delegate that: - Calls cmdutil.ReadBody (which scans inline + file + stdin) - Preserves TrimSpace for file/stdin paths (behavioral parity) - Returns ReadBody errors directly (same error messages) Files: - pkg/cmd/issue/comment/comment.go - pkg/cmd/issue/comment/edit/edit.go - pkg/cmd/issue/edit/edit.go - pkg/cmd/pr/comment/comment.go - pkg/cmd/pr/comment/edit/edit.go All existing tests pass without modification (ReadBody has the same error wrapping as the local copies had). Refs #427 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 3 个月前 | |
fix(cmdutil): SetFlagEnum returns error, no panic + spec rule (#415) #415: SetFlagEnum 在注解失败时 panic 让 CLI 崩溃,绕过 error 语义。spec 此前 无「禁止裸 panic」规则(issue 引用条文不存在),先补规则再修: - spec/foundations/coding-standards.md: 错误处理节加「禁止裸 panic」规则 (业务/运行期 error 返回;构造期非功能性元数据无法传播 error 时降级 stderr 告警+继续,不得崩溃;Must* 前缀显式 fail-fast;cobra 第三方不在范围) - pkg/cmdutil/flag_annotations.go: SetFlagEnum 改返 error(去 panic); 新增 SetFlagEnumOrWarn(构造期降级告警+继续,不崩溃) - pkg/cmdutil/format.go: AddFormatFlag/AddTimeFormatFlag 同包调用改 OrWarn - 18 处命令构造调用点 cmdutil.SetFlagEnum( → cmdutil.SetFlagEnumOrWarn( - pkg/cmdutil/flag_annotations_test.go: 新增 4 测试(注册 flag 注解成功; 未注册 flag 返 error 不 panic;OrWarn 不崩溃+stderr 告警;OrWarn 成功静默) 正确代码行为不变(注解照常设置);仅编程错误(注解未注册 flag)时从崩溃改为告警。 Closes #415 | 2 个月前 | |
fix(issue): harden assignee verification Refs #473 Co-Authored-By: OpenAI Codex <noreply@openai.com> | 3 个月前 | |
fix(cmdutil): SetFlagEnum returns error, no panic + spec rule (#415) #415: SetFlagEnum 在注解失败时 panic 让 CLI 崩溃,绕过 error 语义。spec 此前 无「禁止裸 panic」规则(issue 引用条文不存在),先补规则再修: - spec/foundations/coding-standards.md: 错误处理节加「禁止裸 panic」规则 (业务/运行期 error 返回;构造期非功能性元数据无法传播 error 时降级 stderr 告警+继续,不得崩溃;Must* 前缀显式 fail-fast;cobra 第三方不在范围) - pkg/cmdutil/flag_annotations.go: SetFlagEnum 改返 error(去 panic); 新增 SetFlagEnumOrWarn(构造期降级告警+继续,不崩溃) - pkg/cmdutil/format.go: AddFormatFlag/AddTimeFormatFlag 同包调用改 OrWarn - 18 处命令构造调用点 cmdutil.SetFlagEnum( → cmdutil.SetFlagEnumOrWarn( - pkg/cmdutil/flag_annotations_test.go: 新增 4 测试(注册 flag 注解成功; 未注册 flag 返 error 不 panic;OrWarn 不崩溃+stderr 告警;OrWarn 成功静默) 正确代码行为不变(注解照常设置);仅编程错误(注解未注册 flag)时从崩溃改为告警。 Closes #415 | 2 个月前 | |
fix(issue): preserve title in combined label update (review P1) + remove-absent test 评审 P1:combined 的 UpdateIssueOptions 漏 Title,与 AddIssueLabels/RemoveIssueLabel/ CloseIssue/ReopenIssue 四处保留 issue.Title 的惯例不一致,且 OpenAPI PATCH /issues/{n} 标 title required。补 Title: issue.Title。另增 remove 标签不在 current set 的边界测试。 | 2 个月前 | |
feat(cli): 统一 list 命令分页 flag(--limit + --per-page 全覆盖) issue #501:list 类命令分页 flag 命名分裂——issue/label/milestone/ repo list/repo log 仅 --limit;discussions(org+project) 仅 --per-page; pr list/actions 两者并存。agent 无法预知某命令用哪个 flag(§6.1)。 方案 A:所有 list 命令统一提供 --per-page(API page size)+ --limit (客户端结果上限,默认 30)。语义对齐 pr list 既有双 flag 模式 (resolvePerPage + trim + LimitSet/PerPageSet)。 改动: - issue/label/milestone/repo list/repo log(5 命令)补 --per-page + resolvePerPage/trim + PerPage<0 校验 - discussions list(org) + project list(2 命令)补 --limit + trim + Limit<=0 校验 - pr list / actions(已合规)不改 - docs/COMMANDS.md 更新 7 命令分页 flag 说明(修正 label list 旧误述) - 单测:issue list 补 resolvePerPage/trim/validation 表驱动测试; discussions org+project 修 fixture(Limit:30) + 补 limit 校验用例 §5.9.B:已查 gc-api-doc 确认 issues/labels/milestones 端点均支持 per_page(无功能缺口,仅 flag 命名分裂)。 Closes #501 | 2 个月前 | |
fix(issue-233): migrate commands to host-aware API client Migrate all commands from manual NewClientFromHTTP + EnvToken + SetToken pattern to cmdutil.AuthenticatedClient pattern which correctly handles GC_HOST configuration for enterprise/custom host scenarios. Affected command groups: - pr: create, review, comment, merge, checkout, comments, diff, reply, close, reopen, edit, ready, sync, test - issue: create, edit, view, close, reopen, list, comments, label, relations, prs, comment/edit - release: create, upload, delete, edit - milestone: create, delete, edit - label: create, delete - repo: create, view, fork, list, delete, stats, sync - commit: comments/*, diff, patch Before: Commands used api.NewClientFromHTTP with manually fetched token, ignoring GC_HOST configuration. Token and API host could mismatch for enterprise users. After: All commands use cmdutil.AuthenticatedClient which reads host-aware token configuration from config files and GC_HOST environment variable. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> | 5 个月前 | |
fix(cmdutil): SetFlagEnum returns error, no panic + spec rule (#415) #415: SetFlagEnum 在注解失败时 panic 让 CLI 崩溃,绕过 error 语义。spec 此前 无「禁止裸 panic」规则(issue 引用条文不存在),先补规则再修: - spec/foundations/coding-standards.md: 错误处理节加「禁止裸 panic」规则 (业务/运行期 error 返回;构造期非功能性元数据无法传播 error 时降级 stderr 告警+继续,不得崩溃;Must* 前缀显式 fail-fast;cobra 第三方不在范围) - pkg/cmdutil/flag_annotations.go: SetFlagEnum 改返 error(去 panic); 新增 SetFlagEnumOrWarn(构造期降级告警+继续,不崩溃) - pkg/cmdutil/format.go: AddFormatFlag/AddTimeFormatFlag 同包调用改 OrWarn - 18 处命令构造调用点 cmdutil.SetFlagEnum( → cmdutil.SetFlagEnumOrWarn( - pkg/cmdutil/flag_annotations_test.go: 新增 4 测试(注册 flag 注解成功; 未注册 flag 返 error 不 panic;OrWarn 不崩溃+stderr 告警;OrWarn 成功静默) 正确代码行为不变(注解照常设置);仅编程错误(注解未注册 flag)时从崩溃改为告警。 Closes #415 | 2 个月前 | |
fix(security): scan 12 additional inline --comment/--body/--description paths for secrets (#426) Follow-up to #424: same vulnerability class found in 12 more commands during review. Adds ScanContentForSecrets to inline flag paths that were passing content directly to API calls without scanning. Fixed paths: - issue close --comment - issue reopen --comment - pr close --comment - pr reopen --comment - pr reply --body - commit comments create --body - commit comments edit --body - milestone create --description - label create --description - repo create --description - repo sync --body - pr sync --body Each scan is placed at the start of the run function, before auth and any API call (fail-fast). System test (secret-scan.txtar) extended from 10 to 22 inline paths. Closes #426 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 3 个月前 | |
fix(cmdutil): SetFlagEnum returns error, no panic + spec rule (#415) #415: SetFlagEnum 在注解失败时 panic 让 CLI 崩溃,绕过 error 语义。spec 此前 无「禁止裸 panic」规则(issue 引用条文不存在),先补规则再修: - spec/foundations/coding-standards.md: 错误处理节加「禁止裸 panic」规则 (业务/运行期 error 返回;构造期非功能性元数据无法传播 error 时降级 stderr 告警+继续,不得崩溃;Must* 前缀显式 fail-fast;cobra 第三方不在范围) - pkg/cmdutil/flag_annotations.go: SetFlagEnum 改返 error(去 panic); 新增 SetFlagEnumOrWarn(构造期降级告警+继续,不崩溃) - pkg/cmdutil/format.go: AddFormatFlag/AddTimeFormatFlag 同包调用改 OrWarn - 18 处命令构造调用点 cmdutil.SetFlagEnum( → cmdutil.SetFlagEnumOrWarn( - pkg/cmdutil/flag_annotations_test.go: 新增 4 测试(注册 flag 注解成功; 未注册 flag 返 error 不 panic;OrWarn 不崩溃+stderr 告警;OrWarn 成功静默) 正确代码行为不变(注解照常设置);仅编程错误(注解未注册 flag)时从崩溃改为告警。 Closes #415 | 2 个月前 | |
feat(help): add command search and discovery features Add custom help command with search and topic discovery features: - --search flag for keyword-based command search - --topics flag to list all available topic categories - --topic flag to filter commands by topic Add Topic annotations to 8 command categories: - auth, issues, pull-requests, releases, milestones, repo, commits, labels Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> | 6 个月前 |