| Files | Last commit | Last update |
|---|---|---|
refactor(cmd): add BaseRepo auto-detection to 21 commands Closes #332 Each command's Options struct gains a BaseRepo func()(string,error) field, injected from f.BaseRepo, and run functions use cmdutil.ResolveRepo instead of direct ParseRepo, allowing repo auto-detection from cwd. Commands: commit comments (create/edit/list/list-by-sha/view), commit diff, commit patch, label create/delete, milestone create/delete, pr checkout/comments/create/merge/reply/test, release create/delete/upload, repo stats. | 3 months ago | |
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 months ago | |
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 months ago | |
refactor(cmd): add BaseRepo auto-detection to 21 commands Closes #332 Each command's Options struct gains a BaseRepo func()(string,error) field, injected from f.BaseRepo, and run functions use cmdutil.ResolveRepo instead of direct ParseRepo, allowing repo auto-detection from cwd. Commands: commit comments (create/edit/list/list-by-sha/view), commit diff, commit patch, label create/delete, milestone create/delete, pr checkout/comments/create/merge/reply/test, release create/delete/upload, repo stats. | 3 months ago | |
docs(pr): sync cross-repo PR head format to owner/repo:branch | 2 months ago | |
chore: fix end-of-file-fixer and gofmt issues exposed by LF normalization Apply end-of-file-fixer (newline at EOF) and gofmt formatting fixes to files that were previously masked by CRLF/LF line-ending noise. Closes #300 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> | 4 months ago | |
fix(pr): address Round 1 review — string body + query params + tests Address Round 1 independent review findings (PR #502): Blocker fixes: - C1: Change AssigneeRequest/ReviewerRequest/TesterRequest from []string to string (comma-separated) to match api-doc schema (type: string, not array) - C2: RemovePRAssignees now uses query parameter (?assignees=u1,u2) instead of request body (api-doc says DELETE assignees has no standard request body definition) - C3: Add omitempty to ReviewerRequest.Add and TesterRequest.Add to prevent remove path from sending add:false - T1: Add TestEditRunAddAssignee, TestEditRunAddReviewerAndTester, TestEditRunRemoveAssignee (verify POST/DELETE methods called) - T2: Add TestHasAssigneeChanges (4 scenarios) 13/13 tests pass. Refs gitcode-cli/cli#541 | 2 months ago | |
fix(pr,repo): address independent review findings for test quality - Mock handlers now use t.Fatalf for unexpected paths instead of silent 404 - Add auth error tests (no GC_TOKEN set) - Add parseRepo error tests (invalid repo format) - Add --json flag command-level test - Add whitespace branch name test - Add commit partial fields test (empty ShortID/Title/nil Author) - Add empty state fallback test for pr issues Refs #264 | 4 months ago | |
test(pr): cover pr label --add empty-after-normalize usage error (review P2) 评审 P2:pr label --add 规范化后无有效标签名→usage error 的集成路径无测试。 补 TestLabelRunAddEmptyAfterNormalizeDoesNotMutate( / ',' / ' , , ' 不触发远端写、exit2)。 | 2 months ago | |
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 months ago | |
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 months ago | |
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 months ago | |
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 months ago | |
refactor(cmd): add BaseRepo auto-detection to 21 commands Closes #332 Each command's Options struct gains a BaseRepo func()(string,error) field, injected from f.BaseRepo, and run functions use cmdutil.ResolveRepo instead of direct ParseRepo, allowing repo auto-detection from cwd. Commands: commit comments (create/edit/list/list-by-sha/view), commit diff, commit patch, label create/delete, milestone create/delete, pr checkout/comments/create/merge/reply/test, release create/delete/upload, repo stats. | 3 months ago | |
fix: add pr/review.go ErrSecretDetected check + 401 guidance test (review feedback) Review findings: - pr/review/review.go --comment-file paths still wrapped ErrSecretDetected as 'failed to read'; now checks errors.Is - Added TestAPIError/401_with_guidance case (mirrors 403 pattern) Refs #428 Refs #432 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 3 months ago | |
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 months ago | |
refactor(cmd): add BaseRepo auto-detection to 21 commands Closes #332 Each command's Options struct gains a BaseRepo func()(string,error) field, injected from f.BaseRepo, and run functions use cmdutil.ResolveRepo instead of direct ParseRepo, allowing repo auto-detection from cwd. Commands: commit comments (create/edit/list/list-by-sha/view), commit diff, commit patch, label create/delete, milestone create/delete, pr checkout/comments/create/merge/reply/test, release create/delete/upload, repo stats. | 3 months ago | |
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 months ago | |
feat(pr): add gc pr label command for PR label management Add 'gc pr label' command supporting --add, --remove, and --list flags for managing labels on pull requests. New API functions: AddLabelsToPR, RemoveLabelFromPR, SetPRLabels. Closes #194 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> | 4 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 3 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 2 months ago | ||
| 4 months ago | ||
| 2 months ago | ||
| 4 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 5 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 2 months ago | ||
| 4 months ago |