| Files | Last commit | Last update |
|---|---|---|
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 | |
refactor: move config from internal/ to pkg/ to fix layering Move internal/config → pkg/config to resolve the layering violation where pkg/cmdutil (shared pkg/ layer) imported internal/config (private internal/ layer). The config package is used by 16 files across all command packages and is inherently a shared component. Change: update all import paths from internal/config to pkg/config. No logic changes — pure mechanical refactor. Fixes #351 Co-Authored-By: Claude <noreply@anthropic.com> | 4 months ago | |
feat(auth): disclose git-credential follow-up limitation in setup-git Refs #529 | 2 months ago | |
fix(auth): default isAuthError=false so network errors don't misclassify as auth (round 2) Second-round review (3/4 reviewers): isAuthError defaulted to true, so non-*APIError failures (network, context, parse) were misclassified as auth errors (exit 4 + 'token invalid' message). Changed default to false; only 401/403 sets it true. Added TestStatusRunNetworkErrorReturnsGenericErrorNotAuthError: verifies connection-refused → ExitError(1), not ExitAuth(4). Also fixed import grouping in status_test.go (testutil/iostreams separated from stdlib). Refs #425 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> | 3 months ago | |
fix(auth): require interactive token disclosure | 4 months ago | |
feat(auth): add gc auth setup-git credential helper Refs #529 | 2 months ago |