fix(pr): comments posted by pr +comment are invisible on the PR page #376
Loading…
Reference in New Issue
No description provided.
Delete Branch "Taoyouce/gitlink-cli:fix/pr-comment-endpoint"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
pr +comment(and the conversation note posted bypr +review) writes toPOST /api/v1/:owner/:repo/issues/:issue_id/journals, which attaches the journal to the underlying issue record. But the PR conversation is rendered fromGET /api/v1/:owner/:repo/pulls/:id/journals(Api::V1::Projects::Pulls::Journals::ListServicescopes to@pull_request.journals), so comments posted by the CLI never appear on the pull request page.Reproduction (production, gitlink.org.cn)
gitlink-cli pr +comment -i <pr> -b "hello"→ returns okGET /api/v1/:owner/:repo/pulls/<pr>/journals→{"total_count":0,"journals":[]}— the comment is missing from the PR conversationGET /api/v1/:owner/:repo/issues/<issue_id>/journals, which the PR page does not readFix
Post to
POST /api/v1/:owner/:repo/pulls/:id/journalswith payload keynote(the pulls journals contract) for bothpr +commentand the review conversation note. This also drops the extra PR-detail fetch that was only needed to resolve the issue id.Validation
pr +commentappears inGET /pulls/:id/journals(probe created, listed, then deleted).notepayload key;go test ./...,go vet,gofmtall clean.