| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix(security): 3 low-risk fixes — auth naming, HTTP clone warning, download TOCTOU - #365: rename EnvToken to DefaultToken for accurate behavior docs - #363: warn on http:// clone URLs - #364: temp-file + atomic rename for TOCTOU-safe downloads Closes #363, #364, #365 Co-Authored-By: Claude <noreply@anthropic.com> | 4 个月前 | |
test(cmdutil): raise pkg/cmdutil coverage from 73.6% to 94.0% Close the unit-test gaps flagged by the coverage audit: add factory_test.go (NewFactory/TestFactory incl. outside-git-repo, no-remote, detached-HEAD and debug-HTTP-client branches), format_test.go (format/time-format/template flag registration and enum annotations) and token_confirm_test.go (nil-IO, non-interactive, EOF, mismatch, exact/whitespace match and read-error paths), and extend auth_test.go (DefaultToken env priority chain and stored-token fallback, AuthenticatedClientFromFactory error wiring), errors_test.go (full FormatAPIID type matrix), flag_annotations_test.go (SetTopicAnnotation map init/overwrite), output_test.go (AddJSONFlag default/bind) and text_file_test.go (ReadTextFromFlag read-error path). Refs #313 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 27 天前 | |
fix(cmdutil): surface read errors with partial input in ConfirmOrAbort | 2 个月前 | |
fix(cmdutil): apply same error-surface fix to ConfirmTokenDisclosure (#361) | 2 个月前 | |
test(cmdutil): add missing ExitCode, WrapNotFound, CLIError test coverage (#352) Co-authored-by: aflyingto<wupengfei10@huawei.com> | 4 个月前 | |
test(cmdutil): raise pkg/cmdutil coverage from 73.6% to 94.0% Close the unit-test gaps flagged by the coverage audit: add factory_test.go (NewFactory/TestFactory incl. outside-git-repo, no-remote, detached-HEAD and debug-HTTP-client branches), format_test.go (format/time-format/template flag registration and enum annotations) and token_confirm_test.go (nil-IO, non-interactive, EOF, mismatch, exact/whitespace match and read-error paths), and extend auth_test.go (DefaultToken env priority chain and stored-token fallback, AuthenticatedClientFromFactory error wiring), errors_test.go (full FormatAPIID type matrix), flag_annotations_test.go (SetTopicAnnotation map init/overwrite), output_test.go (AddJSONFlag default/bind) and text_file_test.go (ReadTextFromFlag read-error path). Refs #313 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 27 天前 | |
security(api): sanitizeLogMessage redacts tokens in debug logger | 2 个月前 | |
fix(test): make factory branch test independent of CI detached-HEAD checkout TestNewFactoryBranchInsideGitRepo relied on the working checkout having a resolvable current branch. PR checkouts run from a detached HEAD, so the test failed on every CI platform (GitCode Test job, GitHub ubuntu/macos/windows) and blocks all PRs since it landed on main. Verified locally with git checkout --detach. The test now builds a temporary repository with one commit checked out on a fixed branch name, following the existing initDetachedGitRepo pattern in the same file. Unrelated to the env-token guidance work; included here to unblock this PR's CI, split as its own commit. Co-Authored-By: Claude Code <noreply@anthropic.com> | 16 天前 | |
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 个月前 | |
test(cmdutil): raise pkg/cmdutil coverage from 73.6% to 94.0% Close the unit-test gaps flagged by the coverage audit: add factory_test.go (NewFactory/TestFactory incl. outside-git-repo, no-remote, detached-HEAD and debug-HTTP-client branches), format_test.go (format/time-format/template flag registration and enum annotations) and token_confirm_test.go (nil-IO, non-interactive, EOF, mismatch, exact/whitespace match and read-error paths), and extend auth_test.go (DefaultToken env priority chain and stored-token fallback, AuthenticatedClientFromFactory error wiring), errors_test.go (full FormatAPIID type matrix), flag_annotations_test.go (SetTopicAnnotation map init/overwrite), output_test.go (AddJSONFlag default/bind) and text_file_test.go (ReadTextFromFlag read-error path). Refs #313 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 27 天前 | |
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 个月前 | |
test(cmdutil): raise pkg/cmdutil coverage from 73.6% to 94.0% Close the unit-test gaps flagged by the coverage audit: add factory_test.go (NewFactory/TestFactory incl. outside-git-repo, no-remote, detached-HEAD and debug-HTTP-client branches), format_test.go (format/time-format/template flag registration and enum annotations) and token_confirm_test.go (nil-IO, non-interactive, EOF, mismatch, exact/whitespace match and read-error paths), and extend auth_test.go (DefaultToken env priority chain and stored-token fallback, AuthenticatedClientFromFactory error wiring), errors_test.go (full FormatAPIID type matrix), flag_annotations_test.go (SetTopicAnnotation map init/overwrite), output_test.go (AddJSONFlag default/bind) and text_file_test.go (ReadTextFromFlag read-error path). Refs #313 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 27 天前 | |
fix(cmdutil): normalize nil slices to [] in WriteJSON --paginate --json emitted null instead of [] when a list command had no results: the paginate path accumulates into var all []T, which stays nil when every page is empty, and encoding/json marshals a nil slice as null. Normalize nil slices to empty slices at the shared WriteJSON layer so all list commands (pr list, actions run list, and any future paginate command) emit a stable, consumable []. Only the top-level value is normalized; a nil interface, a pointer to a nil slice, and nil slice fields nested in a struct are left untouched and still encode as null. Adds WriteJSON unit tests (including a pointer-to-slice scope-boundary case), paginate empty-result regression tests for both pr list and actions run list, and a [] empty-result contract line to docs/COMMANDS.md. Closes #456 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> | 3 个月前 | |
test(cmdutil): raise pkg/cmdutil coverage from 73.6% to 94.0% Close the unit-test gaps flagged by the coverage audit: add factory_test.go (NewFactory/TestFactory incl. outside-git-repo, no-remote, detached-HEAD and debug-HTTP-client branches), format_test.go (format/time-format/template flag registration and enum annotations) and token_confirm_test.go (nil-IO, non-interactive, EOF, mismatch, exact/whitespace match and read-error paths), and extend auth_test.go (DefaultToken env priority chain and stored-token fallback, AuthenticatedClientFromFactory error wiring), errors_test.go (full FormatAPIID type matrix), flag_annotations_test.go (SetTopicAnnotation map init/overwrite), output_test.go (AddJSONFlag default/bind) and text_file_test.go (ReadTextFromFlag read-error path). Refs #313 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 27 天前 | |
fix(issue-236): add URL fallback logic for pr close/reopen/ready JSON output - Add ResolvePRURL function in pkg/cmdutil/repo.go with fallback URL construction - Modify pr close/reopen/ready commands to use ResolvePRURL for JSON output URL field - Add unit tests for ResolvePRURL covering empty URL, whitespace URL, and edge cases Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> | 5 个月前 | |
fix(issue-236): add URL fallback logic for pr close/reopen/ready JSON output - Add ResolvePRURL function in pkg/cmdutil/repo.go with fallback URL construction - Modify pr close/reopen/ready commands to use ResolvePRURL for JSON output URL field - Add unit tests for ResolvePRURL covering empty URL, whitespace URL, and edge cases Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> | 5 个月前 | |
feat(cmdutil): scan body for current GitCode token before submit - Add cmdutil.ScanContentForSecrets: detects if the current GC_TOKEN/GITCODE_TOKEN env value appears in user-provided body/comment content before submission to the GitCode API. - Route ReadBody (--body/--body-file), ReadTextFile (--body-file/--comment-file/etc.), and ReadTextFromFlag (stdin) through ScanContentForSecrets. - Prevents AI agents (or humans) from accidentally pasting $GC_TOKEN into issue/PR/comment bodies. GitCode tokens have no fixed prefix, so the only reliable check is current env value matching. - Add .gitleaks.toml + wire gitleaks hooks to --config, excluding tmp/gh-cli reference source (contains example tokens). - Add tests: clean content, GC_TOKEN value, GITCODE_TOKEN value, no token set. | 3 个月前 | |
feat(cmdutil): scan body for current GitCode token before submit - Add cmdutil.ScanContentForSecrets: detects if the current GC_TOKEN/GITCODE_TOKEN env value appears in user-provided body/comment content before submission to the GitCode API. - Route ReadBody (--body/--body-file), ReadTextFile (--body-file/--comment-file/etc.), and ReadTextFromFlag (stdin) through ScanContentForSecrets. - Prevents AI agents (or humans) from accidentally pasting $GC_TOKEN into issue/PR/comment bodies. GitCode tokens have no fixed prefix, so the only reliable check is current env value matching. - Add .gitleaks.toml + wire gitleaks hooks to --config, excluding tmp/gh-cli reference source (contains example tokens). - Add tests: clean content, GC_TOKEN value, GITCODE_TOKEN value, no token set. | 3 个月前 | |
fix: sanitize SSH key terminal output | 2 个月前 | |
fix: sanitize SSH key terminal output | 2 个月前 | |
refactor(pr): share NormalizeLabels, dedup pr label --add, drop dead SetPRLabels (#498) #498 三项收口(#475 评审 P2 跟踪): 1. pr label --add trim/dedup:把 edit 包的 normalizeLabels 提升为 cmdutil.NormalizeLabels (split+trim+dedup+empty,幂等兼容 cobra 预切),pr label --add 与 pr edit 共用; --add 无有效标签名时返回 usage error。消除 pr label 的 strings.Split 裸切。 2. 删除 SetPRLabels 死代码:全树无调用方(pr edit 走 UpdatePROptions.Labels, pr label 用 AddLabelsToPR/RemoveLabelFromPR)。避免未经验证的导出函数误导。 3. docs/COMMANDS.md 自动推断名单补 pr label/edit/close/ready(均调 ResolveRepo)。 - pkg/cmdutil/text_file.go: 新增 NormalizeLabels + 9 用例测试 - pkg/cmd/pr/edit/edit.go: normalizeLabels→cmdutil.NormalizeLabels,删本地实现,去 strings import - pkg/cmd/pr/label/label.go: --add 用 cmdutil.NormalizeLabels + 空值拒绝 - api/queries_pr.go: 删 SetPRLabels - docs/COMMANDS.md: 自动推断名单补 pr label/edit/close/ready | 2 个月前 | |
test(cmdutil): raise pkg/cmdutil coverage from 73.6% to 94.0% Close the unit-test gaps flagged by the coverage audit: add factory_test.go (NewFactory/TestFactory incl. outside-git-repo, no-remote, detached-HEAD and debug-HTTP-client branches), format_test.go (format/time-format/template flag registration and enum annotations) and token_confirm_test.go (nil-IO, non-interactive, EOF, mismatch, exact/whitespace match and read-error paths), and extend auth_test.go (DefaultToken env priority chain and stored-token fallback, AuthenticatedClientFromFactory error wiring), errors_test.go (full FormatAPIID type matrix), flag_annotations_test.go (SetTopicAnnotation map init/overwrite), output_test.go (AddJSONFlag default/bind) and text_file_test.go (ReadTextFromFlag read-error path). Refs #313 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 27 天前 | |
fix(cmdutil): apply same error-surface fix to ConfirmTokenDisclosure (#361) | 2 个月前 | |
test(cmdutil): raise pkg/cmdutil coverage from 73.6% to 94.0% Close the unit-test gaps flagged by the coverage audit: add factory_test.go (NewFactory/TestFactory incl. outside-git-repo, no-remote, detached-HEAD and debug-HTTP-client branches), format_test.go (format/time-format/template flag registration and enum annotations) and token_confirm_test.go (nil-IO, non-interactive, EOF, mismatch, exact/whitespace match and read-error paths), and extend auth_test.go (DefaultToken env priority chain and stored-token fallback, AuthenticatedClientFromFactory error wiring), errors_test.go (full FormatAPIID type matrix), flag_annotations_test.go (SetTopicAnnotation map init/overwrite), output_test.go (AddJSONFlag default/bind) and text_file_test.go (ReadTextFromFlag read-error path). Refs #313 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 27 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 4 个月前 | ||
| 27 天前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 4 个月前 | ||
| 27 天前 | ||
| 2 个月前 | ||
| 16 天前 | ||
| 2 个月前 | ||
| 27 天前 | ||
| 2 个月前 | ||
| 27 天前 | ||
| 3 个月前 | ||
| 27 天前 | ||
| 5 个月前 | ||
| 5 个月前 | ||
| 3 个月前 | ||
| 3 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 27 天前 | ||
| 2 个月前 | ||
| 27 天前 |