feat(issue): 新增 issue +comments 读评论流(journals 分页 + --all,对标 gh issue view --comments)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
6104ab53f9
commit
d328a1d97b
|
|
@ -22,6 +22,7 @@
|
|||
- `milestone +list --all`、`org +list --all`、`repo +list --all`
|
||||
- `search +repos --all`、`search +users --all`
|
||||
- `label +list --all`、`member +list --all`、`webhook +list --all`
|
||||
- `issue +comments --all`(新增子命令,见下)
|
||||
- 对应资源键:`issues`/`pulls`/`branches`/`releases`/`milestones`/
|
||||
`organizations`/`projects`/`users`/`issue_tags`/`collaborators`/`webhooks`
|
||||
(均生产实测确认)
|
||||
|
|
@ -33,6 +34,11 @@
|
|||
`/v1/:owner/:repo/collaborators`(支持分页且普通成员可读);
|
||||
- `webhook +list` 完全没有 `--page/--limit`(探针实测:建 3 个 webhook 后
|
||||
`page=2&limit=1` 返回第二条,确认端点分页),现已补齐。
|
||||
- 新增 `issue +comments` 子命令(对标 `gh issue view --comments`):
|
||||
此前 CLI 只能发评论(`issue +comment`)无法读评论流,Agent 无法获取
|
||||
issue 讨论上下文;现接 `/v1/:owner/:repo/issues/:number/journals`
|
||||
(资源键 `journals`,生产实测分页 + --all 合并通过),
|
||||
复用 --number/--id 语义。
|
||||
- 未加 `--all` 的 list 端点均经生产验证为非分页或未部署:
|
||||
`licenses`/`ignores` 返回全量数组;`pm/pipelines` 404 未部署;
|
||||
`pipeline +runs` 用 `total_data` 非标准包裹;dataset 端点未部署(平台 issue #144255)。
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
"cmd.issue.batch_list.short": "List issue batch maintenance candidates without changing remote data",
|
||||
"cmd.issue.close.short": "Close an issue",
|
||||
"cmd.issue.comment.short": "Add a comment to an issue",
|
||||
"cmd.issue.comments.short": "List comments on an issue",
|
||||
"cmd.issue.create.short": "Create a new issue",
|
||||
"cmd.issue.list.short": "List issues",
|
||||
"cmd.issue.short": "Issue operations",
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
"cmd.issue.batch_list.short": "列出议题批量维护候选项,不修改远端数据",
|
||||
"cmd.issue.close.short": "关闭议题",
|
||||
"cmd.issue.comment.short": "给议题添加评论",
|
||||
"cmd.issue.comments.short": "列出 Issue 的评论",
|
||||
"cmd.issue.create.short": "创建新议题",
|
||||
"cmd.issue.list.short": "列出议题",
|
||||
"cmd.issue.short": "议题操作",
|
||||
|
|
|
|||
|
|
@ -307,6 +307,40 @@ func Shortcuts(translators ...*i18n.Translator) []*common.Shortcut {
|
|||
return ctx.Output(env)
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "comments",
|
||||
Description: tr.T("cmd.issue.comments.short"),
|
||||
Flags: appendIssueNumberFlags(
|
||||
common.Flag{Name: "page", Short: "p", Usage: tr.T("flag.page"), Default: "1"},
|
||||
common.Flag{Name: "limit", Short: "l", Usage: tr.T("flag.limit"), Default: "20"},
|
||||
common.Flag{Name: "all", Usage: tr.T("flag.all"), Bool: true, Default: "false"},
|
||||
),
|
||||
Run: func(ctx *common.RuntimeContext) error {
|
||||
if err := ctx.ResolveOwnerRepo(); err != nil {
|
||||
return err
|
||||
}
|
||||
number, err := issueNumberArg(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
path := fmt.Sprintf("%s/issues/%s/journals", v1RepoPath(ctx), number)
|
||||
q := url.Values{}
|
||||
q.Set("page", ctx.Arg("page"))
|
||||
q.Set("limit", ctx.Arg("limit"))
|
||||
if ctx.Arg("all") == "true" {
|
||||
items, err := ctx.PaginateAllKey(path, q, "journals")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return ctx.Output(common.NewListEnvelope("journals", items))
|
||||
}
|
||||
env, err := ctx.CallAPIWithQuery("GET", path, q)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return ctx.Output(env)
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "assigners",
|
||||
Description: "List issue assigners",
|
||||
|
|
|
|||
Loading…
Reference in New Issue