| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix: address round-1 P1 — move dry-run before auth + use AuthClientFromFactory + -y shorthand - Move dry-run block before auth (mirrors label delete; --dry-run now works without a token since it makes zero API calls). - Use cmdutil.AuthenticatedClientFromFactory instead of manual two-step (consistency with sibling list/view/download commands). - Add -y shorthand for --yes (consistency with label delete). Round-1 P1+P2 from PR #389 review (approved). Refs #433 Co-Authored-By: opencode (glm-5.2) <noreply@anthropic.com> | 3 个月前 | |
fix(test): use t.TempDir instead of /dev/null for cross-platform tests Windows CI failed: /dev/null doesn't exist on Windows. Use t.TempDir() for the output path in TestDownloadRunBuildsV8Path and TestDownloadRunError. Refs #440 Co-Authored-By: opencode (glm-5.2) <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(actions): add gc actions artifact view for artifact detail Reopen-and-deliver #441 (was closed without a merged PR / no mainline code; same anomaly as #449/#450; reopened per AGENTS §9). Add read-only support for the GitCode Actions v8 endpoint GET /api/v8/repos/{owner}/{repo}/actions/artifacts/{artifact_id}. - api: new GetActionsArtifact query via RawREST (v8 path preserved). Reuses the Artifact type from #439; returns typed + raw body so --json preserves all API fields faithfully, mirroring GetActionsRun/GetActionsJob. - cmd: new gc actions artifact view <artifact-id> command (ExactArgs(1)), registered under the artifact parent. --json outputs raw verbatim; human view shows artifact metadata + size (human-readable B/KiB/MiB/GiB) + string-ms-timestamp time formatting (created/updated/expires). - tests: v8 path (with artifact_id), parse (size_bytes int64 + string times), raw fidelity, 404, command param validation + JSON + rendering (asserts "1.0 MiB" + "2026-") + error exit-code-through-%w. Coverage 79.7%. - docs: COMMANDS.md gains an actions artifact view section (noting HTTP 400→exit 2 for bad artifact_id format, distinct from 404→3); README entry. Real-data: infra-test/gctest1 + gctest2 + wangjing_127 all return HTTP 400 "参数类型错误" for bad artifact_id format (exit 2) — the API validates artifact_id format before checking existence. 404→3 path (valid-format artifact_id not found) covered by unit tests with mock 404. Closes #441 Co-Authored-By: opencode (glm-5.2) <noreply@anthropic.com> | 3 个月前 | |
feat(actions): add gc actions artifact delete for artifact deletion Add support for the GitCode Actions v8 endpoint DELETE /api/v8/repos/{owner}/{repo}/actions/artifacts/{artifact_id}. - api: new DeleteActionsArtifact via RawREST (DELETE, v8 path). Endpoint returns 204 No Content on success. - cmd: new gc actions artifact delete <artifact-id> command (ExactArgs(1)), registered under the artifact parent. Destructive: default confirmation gate (type artifact id to confirm in TTY); non-TTY requires --yes. --dry-run previews without deleting. --json outputs {artifact_id, owner, repo, action}. - tests: dry-run (no API call), dry-run JSON, --yes delete (DELETE method + path verified), --yes JSON, non-TTY without --yes refused, 404 error exit-code-through-%w, param validation. - docs: COMMANDS.md gains an actions artifact delete section; README entry. Risk: high (deletion). Real-data: infra-test dry-run + --yes bad artifact_id → HTTP 400 exit 2 (API format validation). Closes #433 Co-Authored-By: opencode (glm-5.2) <noreply@anthropic.com> | 3 个月前 |