Closed
feat(discussions): 支持删除仓库讨论 #562
aflyingtoAdd on  Sep 1Closed at  Sep 8
aflyingtoCollaborators
Sep 1 Create

背景

GitCode 官方 API 2.0.0 在 2026-09-01 快照中新增此操作。当前 GitCode CLI 支持矩阵将其标记为 api-only,尚无专用命令。

官方 API

Path / Query 参数

字段 位置 必填 类型 说明
owner path 是 string 仓库所属空间地址(企业、组织或个人的地址path)
repo path 是 string 仓库路径(path)
number path 是 string 讨论的编号
access_token query 是 string 用户授权码

access_token 是官方 API 参数;CLI 实现必须复用现有认证层,不新增明文 token 参数,也不得在日志或 JSON 输出中回显 token。

Request Body 字段

无。

200 Response 字段

无。

嵌套字段使用点号表示,对象数组使用 [] 表示。字段定义按本次官方 OpenAPI 快照原样记录;疑似文案或类型异常不得在实现中自行猜测修正。

CLI 设计建议

gitcode discussions project delete <number> -R owner/repo --yes
  • 沿用现有 Discussions 命令树、仓库/组织解析和认证机制。
  • 正文类字段支持直接 flag、--body-file 与 stdin,并执行敏感内容扫描。
  • 成功结果支持 --json,JSON 字段直接映射 API 响应。
  • 删除操作必须默认确认;非交互模式必须显式传 --yes。
  • 参数错误、资源不存在、认证失败和资源冲突遵循统一退出码。

验收标准

风险

risk/medium:新增远端写操作,且会删除远端资源。

likedislike
AaflyingtoCollaborators
Sep 1 Added label: risk/mediumscope/apiscope/discussions, status/triage,type/feature
Llangjitianya008Collaborators
Sep 7 Associated pull request
wangsikewangsikeCollaborators
Sep 8 Close issue
Llangjitianya008Collaborators
Sep 21 Associated pull request