fix(pr): refuse pr comment and pr attachment on issues

Gitea serves pull request comments and attachments through issue
endpoints, so tea pr comment create 1 posted on issue #1. pr comment and
pr attachment commands now check that the number is a pull request, and
comment IDs that the comment is on one, and point at the issue command
otherwise: "#1 in alice/project is an issue, not a pull request; use tea
issue comment create 1". Issues gain a kind field (issue or pull) in JSON.

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-12 00:14:30 +02:00
1 parent 883264512c
commit c1d51c386d
9 files changed
+150 -10

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@ func TestIssueListSendsTypePageSizeAndFilters(t *testing.T) {
items, more, err := service.List(context.Background(), ListOptions{State: "open", Limit: 1, Page: 3})
require.NoError(t, err)
require.False(t, more)
require.Equal(t, []Issue{{Author: "bob", ID: 1, Number: 2, Title: "Bug", Labels: []Label{}, Assignees: []string{}}}, items)
require.Equal(t, []Issue{{Author: "bob", ID: 1, Number: 2, Kind: KindIssue, Title: "Bug", Labels: []Label{}, Assignees: []string{}}}, items)
since := time.Date(2026, 10, 1, 8, 0, 0, 0, time.UTC)
_, _, err = service.List(context.Background(), ListOptions{
Kind: "all", Limit: 30, Page: 1, Search: "crash", Assignee: "carol", Labels: "bug,ui", Milestones: "v1",