detached 2aff1f7

#2 feat(api): issue service, moderation, issues setting and issue:write scope

state
merged · 2aff1f7 · fast-forward
branch
feat/issue-form → main
opened
bnema ·
updated

Issue contract for ADR 0031 (native issues, owner Inbox, moderated public form).

What changes

  • IssueService: CreateIssue, ListIssues, GetIssue, AddIssueComment, CloseIssue and ReopenIssue, plus the owner-only moderation calls ListPendingIssues, ApproveIssue and RejectIssue (with an optional ban).
  • RepoSettings.issues / UpdateRepoRequest.issues (IssuesMode: off, owner, public). The field sits outside update_mask.
  • Scope SCOPE_ISSUE_WRITE = 11, numbered after main's SCOPE_MR_REVIEW = 10.
  • Events issue_opened|closed|reopened|commented (17–20) and issue_submitted (21). issue_submitted is delivered only on the "owner" topic and carries no content.
  • Docs: the service comment (access rules, errors, limits), the "owner" topic, the unverified author, README and docs/services.md.

Commits

Two commits, one per stage, so feat/issue-form holds both:

  • feat/issues: the issue service, the setting, the scope and the events.
  • feat/issue-form: moderation and issue_submitted.

Checks

  • buf lint passes.
  • buf breaking passes against main and against feat/issues.
  • buf generate leaves no diff.
  • go vet, go build and go test pass.

Merge order

  1. ermite MR !1 (feat/mr-notes), decided by the owner.
  2. This MR.
  3. A tag for ermite-api.
  4. The ermite MR for issues, which then drops its local replace and uses the tag.
CommitSubjectAuthorDateSignatureStatus
2aff1f7docs(api): moderation answers not found to non-owners before reading the requestbriceGPG Verified
9390908docs(api): document issue access, errors, the owner topic and the issues settingbriceGPG Verified
bfc173efeat(api): add pending issue moderation and the issue submitted eventbriceGPG Verified
3130756feat(api): add issue service, issues repo setting and issue:write scopebriceGPG Verified

Checks 4

13 files · +3034 -128
4/4
M README.md +1 -0
@@ -33,6 +33,7 @@ Status: early development.
3333 | `GitService` | refs, trees, blobs, commits and diffs |
3434 | `TokenService` | API tokens |
3535 | `MergeRequestService` | merge requests, comments, merge |
36+| `IssueService` | issues, comments, owner moderation of public submissions |
3637 | `SessionService` | web sign-in links (owner only) |
3738 | `EventService` | live event stream, resumable |
3839 | `ServerService` | version, features, signing key, OIDC key rotation |
@@ -33,6 +33,7 @@ Status: early development.
33 | `GitService` | refs, trees, blobs, commits and diffs |33 | `GitService` | refs, trees, blobs, commits and diffs |
34 | `TokenService` | API tokens |34 | `TokenService` | API tokens |
35 | `MergeRequestService` | merge requests, comments, merge |35 | `MergeRequestService` | merge requests, comments, merge |
36+| `IssueService` | issues, comments, owner moderation of public submissions |
36 | `SessionService` | web sign-in links (owner only) |37 | `SessionService` | web sign-in links (owner only) |
37 | `EventService` | live event stream, resumable |38 | `EventService` | live event stream, resumable |
38 | `ServerService` | version, features, signing key, OIDC key rotation |39 | `ServerService` | version, features, signing key, OIDC key rotation |
M docs/services.md +2 -1
@@ -6,8 +6,9 @@
66 | `GitService` | `ListRefs`, `GetTree`, `ListPaths`, `GetBlob` (streamed), `ListCommits`, `GetCommit` (structured diff), `ResolveRevision` |
77 | `TokenService` | `CreateToken` (secret shown once), `ListTokens`, `RevokeToken` |
88 | `MergeRequestService` | `CreateMergeRequest`, `ListMergeRequests`, `GetMergeRequest` (commits, diff, comments), `AddComment`, `EditComment`, `DeleteComment`, `ResolveComment`, `CloseMergeRequest`, `MergeMergeRequest`, `MarkRead` |
9+| `IssueService` | `CreateIssue`, `ListIssues`, `GetIssue` (comments), `AddIssueComment`, `CloseIssue`, `ReopenIssue`; owner only: `ListPendingIssues`, `ApproveIssue`, `RejectIssue`. Feature `issues`. Issues share numbers with merge requests |
910 | `SessionService` | `CreateLoginLink`, `SignOutEverywhere` (owner only) |
10-| `EventService` | `Watch` (streamed, resumable) |
11+| `EventService` | `Watch` (streamed, resumable). Topics `home`, `repo:<name>` and `owner` (owner rights only). Events 17–21: `issue_opened`, `issue_closed`, `issue_reopened`, `issue_commented`, and `issue_submitted` (only on `owner`, no content) |
1112 | `ServerService` | `GetVersion` (version and features), `GetSigningKey`, `RotateOIDCKey` (owner only) |
1213 | `TrustedKeyService` | `ListTrustedKeys`, `AddTrustedKey` and `RemoveTrustedKey` (owner only). `Commit.verification` carries the result of the check (feature `commit_signatures`) |
1314 | `RunService` | `ListRuns`, `GetRun`, `GetJob`, `GetJobLog` (streamed, follow), `ListAnnotations`, `GetStepSummaries`, `CancelRun`, `RerunRun`, `DispatchWorkflow`, `ListWorkflows`, `DisableWorkflow`, `EnableWorkflow`, `ListChecks`, `ListRunners`, `RemoveRunner` |
@@ -6,8 +6,9 @@
6 | `GitService` | `ListRefs`, `GetTree`, `ListPaths`, `GetBlob` (streamed), `ListCommits`, `GetCommit` (structured diff), `ResolveRevision` |6 | `GitService` | `ListRefs`, `GetTree`, `ListPaths`, `GetBlob` (streamed), `ListCommits`, `GetCommit` (structured diff), `ResolveRevision` |
7 | `TokenService` | `CreateToken` (secret shown once), `ListTokens`, `RevokeToken` |7 | `TokenService` | `CreateToken` (secret shown once), `ListTokens`, `RevokeToken` |
8 | `MergeRequestService` | `CreateMergeRequest`, `ListMergeRequests`, `GetMergeRequest` (commits, diff, comments), `AddComment`, `EditComment`, `DeleteComment`, `ResolveComment`, `CloseMergeRequest`, `MergeMergeRequest`, `MarkRead` |8 | `MergeRequestService` | `CreateMergeRequest`, `ListMergeRequests`, `GetMergeRequest` (commits, diff, comments), `AddComment`, `EditComment`, `DeleteComment`, `ResolveComment`, `CloseMergeRequest`, `MergeMergeRequest`, `MarkRead` |
9+| `IssueService` | `CreateIssue`, `ListIssues`, `GetIssue` (comments), `AddIssueComment`, `CloseIssue`, `ReopenIssue`; owner only: `ListPendingIssues`, `ApproveIssue`, `RejectIssue`. Feature `issues`. Issues share numbers with merge requests |
9 | `SessionService` | `CreateLoginLink`, `SignOutEverywhere` (owner only) |10 | `SessionService` | `CreateLoginLink`, `SignOutEverywhere` (owner only) |
10-| `EventService` | `Watch` (streamed, resumable) |11+| `EventService` | `Watch` (streamed, resumable). Topics `home`, `repo:<name>` and `owner` (owner rights only). Events 17–21: `issue_opened`, `issue_closed`, `issue_reopened`, `issue_commented`, and `issue_submitted` (only on `owner`, no content) |
11 | `ServerService` | `GetVersion` (version and features), `GetSigningKey`, `RotateOIDCKey` (owner only) |12 | `ServerService` | `GetVersion` (version and features), `GetSigningKey`, `RotateOIDCKey` (owner only) |
12 | `TrustedKeyService` | `ListTrustedKeys`, `AddTrustedKey` and `RemoveTrustedKey` (owner only). `Commit.verification` carries the result of the check (feature `commit_signatures`) |13 | `TrustedKeyService` | `ListTrustedKeys`, `AddTrustedKey` and `RemoveTrustedKey` (owner only). `Commit.verification` carries the result of the check (feature `commit_signatures`) |
13 | `RunService` | `ListRuns`, `GetRun`, `GetJob`, `GetJobLog` (streamed, follow), `ListAnnotations`, `GetStepSummaries`, `CancelRun`, `RerunRun`, `DispatchWorkflow`, `ListWorkflows`, `DisableWorkflow`, `EnableWorkflow`, `ListChecks`, `ListRunners`, `RemoveRunner` |14 | `RunService` | `ListRuns`, `GetRun`, `GetJob`, `GetJobLog` (streamed, follow), `ListAnnotations`, `GetStepSummaries`, `CancelRun`, `RerunRun`, `DispatchWorkflow`, `ListWorkflows`, `DisableWorkflow`, `EnableWorkflow`, `ListChecks`, `ListRunners`, `RemoveRunner` |
M gen/ermite/ermiteconnect/event.connect.go +12 -6
@@ -48,9 +48,12 @@ type EventServiceClient interface {
4848 // The events are repo_created, repo_updated, repo_deleted, pushed, gap and,
4949 // for merge requests, merge_request_opened, merge_request_merged,
5050 // merge_request_closed, comment_added, comment_edited, comment_deleted and
51- // comment_resolved (a thread resolved or reopened). Each one is delivered on the
52- // "repo:<name>" topic of its repository and on "home", subject to the
53- // visibility of the repository.
51+ // comment_resolved (a thread resolved or reopened); for issues, issue_opened,
52+ // issue_closed, issue_reopened and issue_commented, and issue_submitted. Each
53+ // one is delivered on the "repo:<name>" topic of its repository and on
54+ // "home", subject to the visibility of the repository, except
55+ // issue_submitted: it is delivered only on the "owner" topic, never on
56+ // "home" or "repo:<name>", and carries no content (see IssueSubmitted).
5457 //
5558 // Servers with the feature "ci.runs" also publish run_updated and
5659 // job_updated, only on the "repo:<name>" topic of their repository (never on
@@ -121,9 +124,12 @@ type EventServiceHandler interface {
121124 // The events are repo_created, repo_updated, repo_deleted, pushed, gap and,
122125 // for merge requests, merge_request_opened, merge_request_merged,
123126 // merge_request_closed, comment_added, comment_edited, comment_deleted and
124- // comment_resolved (a thread resolved or reopened). Each one is delivered on the
125- // "repo:<name>" topic of its repository and on "home", subject to the
126- // visibility of the repository.
127+ // comment_resolved (a thread resolved or reopened); for issues, issue_opened,
128+ // issue_closed, issue_reopened and issue_commented, and issue_submitted. Each
129+ // one is delivered on the "repo:<name>" topic of its repository and on
130+ // "home", subject to the visibility of the repository, except
131+ // issue_submitted: it is delivered only on the "owner" topic, never on
132+ // "home" or "repo:<name>", and carries no content (see IssueSubmitted).
127133 //
128134 // Servers with the feature "ci.runs" also publish run_updated and
129135 // job_updated, only on the "repo:<name>" topic of their repository (never on
@@ -48,9 +48,12 @@ type EventServiceClient interface {
48 // The events are repo_created, repo_updated, repo_deleted, pushed, gap and,48 // The events are repo_created, repo_updated, repo_deleted, pushed, gap and,
49 // for merge requests, merge_request_opened, merge_request_merged,49 // for merge requests, merge_request_opened, merge_request_merged,
50 // merge_request_closed, comment_added, comment_edited, comment_deleted and50 // merge_request_closed, comment_added, comment_edited, comment_deleted and
51- // comment_resolved (a thread resolved or reopened). Each one is delivered on the51+ // comment_resolved (a thread resolved or reopened); for issues, issue_opened,
52- // "repo:<name>" topic of its repository and on "home", subject to the52+ // issue_closed, issue_reopened and issue_commented, and issue_submitted. Each
53- // visibility of the repository.53+ // one is delivered on the "repo:<name>" topic of its repository and on
54+ // "home", subject to the visibility of the repository, except
55+ // issue_submitted: it is delivered only on the "owner" topic, never on
56+ // "home" or "repo:<name>", and carries no content (see IssueSubmitted).
54 //57 //
55 // Servers with the feature "ci.runs" also publish run_updated and58 // Servers with the feature "ci.runs" also publish run_updated and
56 // job_updated, only on the "repo:<name>" topic of their repository (never on59 // job_updated, only on the "repo:<name>" topic of their repository (never on
@@ -121,9 +124,12 @@ type EventServiceHandler interface {
121 // The events are repo_created, repo_updated, repo_deleted, pushed, gap and,124 // The events are repo_created, repo_updated, repo_deleted, pushed, gap and,
122 // for merge requests, merge_request_opened, merge_request_merged,125 // for merge requests, merge_request_opened, merge_request_merged,
123 // merge_request_closed, comment_added, comment_edited, comment_deleted and126 // merge_request_closed, comment_added, comment_edited, comment_deleted and
124- // comment_resolved (a thread resolved or reopened). Each one is delivered on the127+ // comment_resolved (a thread resolved or reopened); for issues, issue_opened,
125- // "repo:<name>" topic of its repository and on "home", subject to the128+ // issue_closed, issue_reopened and issue_commented, and issue_submitted. Each
126- // visibility of the repository.129+ // one is delivered on the "repo:<name>" topic of its repository and on
130+ // "home", subject to the visibility of the repository, except
131+ // issue_submitted: it is delivered only on the "owner" topic, never on
132+ // "home" or "repo:<name>", and carries no content (see IssueSubmitted).
127 //133 //
128 // Servers with the feature "ci.runs" also publish run_updated and134 // Servers with the feature "ci.runs" also publish run_updated and
129 // job_updated, only on the "repo:<name>" topic of their repository (never on135 // job_updated, only on the "repo:<name>" topic of their repository (never on
A gen/ermite/ermiteconnect/issue.connect.go +364 -0
@@ -0,0 +1,364 @@
1+// SPDX-License-Identifier: MIT
2+
3+// Code generated by protoc-gen-connect-go. DO NOT EDIT.
4+//
5+// Source: ermite/issue.proto
6+
7+package ermiteconnect
8+
9+import (
10+ ermite "bnema.dev/ermite-api/gen/ermite"
11+ connect "connectrpc.com/connect"
12+ context "context"
13+ errors "errors"
14+ http "net/http"
15+ strings "strings"
16+)
17+
18+// This is a compile-time assertion to ensure that this generated file and the connect package are
19+// compatible. If you get a compiler error that this constant is not defined, this code was
20+// generated with a version of connect newer than the one compiled into your binary. You can fix the
21+// problem by either regenerating this code with an older version of connect or updating the connect
22+// version compiled into your binary.
23+const _ = connect.IsAtLeastVersion1_13_0
24+
25+const (
26+ // IssueServiceName is the fully-qualified name of the IssueService service.
27+ IssueServiceName = "ermite.IssueService"
28+)
29+
30+// These constants are the fully-qualified names of the RPCs defined in this package. They're
31+// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
32+//
33+// Note that these are different from the fully-qualified method names used by
34+// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
35+// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
36+// period.
37+const (
38+ // IssueServiceCreateIssueProcedure is the fully-qualified name of the IssueService's CreateIssue
39+ // RPC.
40+ IssueServiceCreateIssueProcedure = "/ermite.IssueService/CreateIssue"
41+ // IssueServiceListIssuesProcedure is the fully-qualified name of the IssueService's ListIssues RPC.
42+ IssueServiceListIssuesProcedure = "/ermite.IssueService/ListIssues"
43+ // IssueServiceGetIssueProcedure is the fully-qualified name of the IssueService's GetIssue RPC.
44+ IssueServiceGetIssueProcedure = "/ermite.IssueService/GetIssue"
45+ // IssueServiceAddIssueCommentProcedure is the fully-qualified name of the IssueService's
46+ // AddIssueComment RPC.
47+ IssueServiceAddIssueCommentProcedure = "/ermite.IssueService/AddIssueComment"
48+ // IssueServiceCloseIssueProcedure is the fully-qualified name of the IssueService's CloseIssue RPC.
49+ IssueServiceCloseIssueProcedure = "/ermite.IssueService/CloseIssue"
50+ // IssueServiceReopenIssueProcedure is the fully-qualified name of the IssueService's ReopenIssue
51+ // RPC.
52+ IssueServiceReopenIssueProcedure = "/ermite.IssueService/ReopenIssue"
53+ // IssueServiceListPendingIssuesProcedure is the fully-qualified name of the IssueService's
54+ // ListPendingIssues RPC.
55+ IssueServiceListPendingIssuesProcedure = "/ermite.IssueService/ListPendingIssues"
56+ // IssueServiceApproveIssueProcedure is the fully-qualified name of the IssueService's ApproveIssue
57+ // RPC.
58+ IssueServiceApproveIssueProcedure = "/ermite.IssueService/ApproveIssue"
59+ // IssueServiceRejectIssueProcedure is the fully-qualified name of the IssueService's RejectIssue
60+ // RPC.
61+ IssueServiceRejectIssueProcedure = "/ermite.IssueService/RejectIssue"
62+)
63+
64+// IssueServiceClient is a client for the ermite.IssueService service.
65+type IssueServiceClient interface {
66+ // CreateIssue opens an issue. Needs the issue:write scope.
67+ CreateIssue(context.Context, *connect.Request[ermite.CreateIssueRequest]) (*connect.Response[ermite.CreateIssueResponse], error)
68+ // ListIssues lists issues, highest number first, optionally in one state.
69+ ListIssues(context.Context, *connect.Request[ermite.ListIssuesRequest]) (*connect.Response[ermite.ListIssuesResponse], error)
70+ // GetIssue returns an issue with its comments.
71+ GetIssue(context.Context, *connect.Request[ermite.GetIssueRequest]) (*connect.Response[ermite.GetIssueResponse], error)
72+ // AddIssueComment adds a comment. Needs the issue:write scope.
73+ AddIssueComment(context.Context, *connect.Request[ermite.AddIssueCommentRequest]) (*connect.Response[ermite.AddIssueCommentResponse], error)
74+ // CloseIssue closes an issue. Needs the issue:write scope.
75+ CloseIssue(context.Context, *connect.Request[ermite.CloseIssueRequest]) (*connect.Response[ermite.CloseIssueResponse], error)
76+ // ReopenIssue reopens an issue. Needs the issue:write scope.
77+ ReopenIssue(context.Context, *connect.Request[ermite.ReopenIssueRequest]) (*connect.Response[ermite.ReopenIssueResponse], error)
78+ // ListPendingIssues lists issues awaiting moderation, oldest first. Owner
79+ // rights only; anyone else gets NOT_FOUND.
80+ ListPendingIssues(context.Context, *connect.Request[ermite.ListPendingIssuesRequest]) (*connect.Response[ermite.ListPendingIssuesResponse], error)
81+ // ApproveIssue turns a pending issue into an open issue with a new number.
82+ // Owner rights only; anyone else gets NOT_FOUND.
83+ ApproveIssue(context.Context, *connect.Request[ermite.ApproveIssueRequest]) (*connect.Response[ermite.ApproveIssueResponse], error)
84+ // RejectIssue discards a pending issue, optionally banning its submitter.
85+ // Owner rights only; anyone else gets NOT_FOUND.
86+ RejectIssue(context.Context, *connect.Request[ermite.RejectIssueRequest]) (*connect.Response[ermite.RejectIssueResponse], error)
87+}
88+
89+// NewIssueServiceClient constructs a client for the ermite.IssueService service. By default, it
90+// uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends
91+// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or
92+// connect.WithGRPCWeb() options.
93+//
94+// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
95+// http://api.acme.com or https://acme.com/grpc).
96+func NewIssueServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) IssueServiceClient {
97+ baseURL = strings.TrimRight(baseURL, "/")
98+ issueServiceMethods := ermite.File_ermite_issue_proto.Services().ByName("IssueService").Methods()
99+ return &issueServiceClient{
100+ createIssue: connect.NewClient[ermite.CreateIssueRequest, ermite.CreateIssueResponse](
101+ httpClient,
102+ baseURL+IssueServiceCreateIssueProcedure,
103+ connect.WithSchema(issueServiceMethods.ByName("CreateIssue")),
104+ connect.WithClientOptions(opts...),
105+ ),
106+ listIssues: connect.NewClient[ermite.ListIssuesRequest, ermite.ListIssuesResponse](
107+ httpClient,
108+ baseURL+IssueServiceListIssuesProcedure,
109+ connect.WithSchema(issueServiceMethods.ByName("ListIssues")),
110+ connect.WithClientOptions(opts...),
111+ ),
112+ getIssue: connect.NewClient[ermite.GetIssueRequest, ermite.GetIssueResponse](
113+ httpClient,
114+ baseURL+IssueServiceGetIssueProcedure,
115+ connect.WithSchema(issueServiceMethods.ByName("GetIssue")),
116+ connect.WithClientOptions(opts...),
117+ ),
118+ addIssueComment: connect.NewClient[ermite.AddIssueCommentRequest, ermite.AddIssueCommentResponse](
119+ httpClient,
120+ baseURL+IssueServiceAddIssueCommentProcedure,
121+ connect.WithSchema(issueServiceMethods.ByName("AddIssueComment")),
122+ connect.WithClientOptions(opts...),
123+ ),
124+ closeIssue: connect.NewClient[ermite.CloseIssueRequest, ermite.CloseIssueResponse](
125+ httpClient,
126+ baseURL+IssueServiceCloseIssueProcedure,
127+ connect.WithSchema(issueServiceMethods.ByName("CloseIssue")),
128+ connect.WithClientOptions(opts...),
129+ ),
130+ reopenIssue: connect.NewClient[ermite.ReopenIssueRequest, ermite.ReopenIssueResponse](
131+ httpClient,
132+ baseURL+IssueServiceReopenIssueProcedure,
133+ connect.WithSchema(issueServiceMethods.ByName("ReopenIssue")),
134+ connect.WithClientOptions(opts...),
135+ ),
136+ listPendingIssues: connect.NewClient[ermite.ListPendingIssuesRequest, ermite.ListPendingIssuesResponse](
137+ httpClient,
138+ baseURL+IssueServiceListPendingIssuesProcedure,
139+ connect.WithSchema(issueServiceMethods.ByName("ListPendingIssues")),
140+ connect.WithClientOptions(opts...),
141+ ),
142+ approveIssue: connect.NewClient[ermite.ApproveIssueRequest, ermite.ApproveIssueResponse](
143+ httpClient,
144+ baseURL+IssueServiceApproveIssueProcedure,
145+ connect.WithSchema(issueServiceMethods.ByName("ApproveIssue")),
146+ connect.WithClientOptions(opts...),
147+ ),
148+ rejectIssue: connect.NewClient[ermite.RejectIssueRequest, ermite.RejectIssueResponse](
149+ httpClient,
150+ baseURL+IssueServiceRejectIssueProcedure,
151+ connect.WithSchema(issueServiceMethods.ByName("RejectIssue")),
152+ connect.WithClientOptions(opts...),
153+ ),
154+ }
155+}
156+
157+// issueServiceClient implements IssueServiceClient.
158+type issueServiceClient struct {
159+ createIssue *connect.Client[ermite.CreateIssueRequest, ermite.CreateIssueResponse]
160+ listIssues *connect.Client[ermite.ListIssuesRequest, ermite.ListIssuesResponse]
161+ getIssue *connect.Client[ermite.GetIssueRequest, ermite.GetIssueResponse]
162+ addIssueComment *connect.Client[ermite.AddIssueCommentRequest, ermite.AddIssueCommentResponse]
163+ closeIssue *connect.Client[ermite.CloseIssueRequest, ermite.CloseIssueResponse]
164+ reopenIssue *connect.Client[ermite.ReopenIssueRequest, ermite.ReopenIssueResponse]
165+ listPendingIssues *connect.Client[ermite.ListPendingIssuesRequest, ermite.ListPendingIssuesResponse]
166+ approveIssue *connect.Client[ermite.ApproveIssueRequest, ermite.ApproveIssueResponse]
167+ rejectIssue *connect.Client[ermite.RejectIssueRequest, ermite.RejectIssueResponse]
168+}
169+
170+// CreateIssue calls ermite.IssueService.CreateIssue.
171+func (c *issueServiceClient) CreateIssue(ctx context.Context, req *connect.Request[ermite.CreateIssueRequest]) (*connect.Response[ermite.CreateIssueResponse], error) {
172+ return c.createIssue.CallUnary(ctx, req)
173+}
174+
175+// ListIssues calls ermite.IssueService.ListIssues.
176+func (c *issueServiceClient) ListIssues(ctx context.Context, req *connect.Request[ermite.ListIssuesRequest]) (*connect.Response[ermite.ListIssuesResponse], error) {
177+ return c.listIssues.CallUnary(ctx, req)
178+}
179+
180+// GetIssue calls ermite.IssueService.GetIssue.
181+func (c *issueServiceClient) GetIssue(ctx context.Context, req *connect.Request[ermite.GetIssueRequest]) (*connect.Response[ermite.GetIssueResponse], error) {
182+ return c.getIssue.CallUnary(ctx, req)
183+}
184+
185+// AddIssueComment calls ermite.IssueService.AddIssueComment.
186+func (c *issueServiceClient) AddIssueComment(ctx context.Context, req *connect.Request[ermite.AddIssueCommentRequest]) (*connect.Response[ermite.AddIssueCommentResponse], error) {
187+ return c.addIssueComment.CallUnary(ctx, req)
188+}
189+
190+// CloseIssue calls ermite.IssueService.CloseIssue.
191+func (c *issueServiceClient) CloseIssue(ctx context.Context, req *connect.Request[ermite.CloseIssueRequest]) (*connect.Response[ermite.CloseIssueResponse], error) {
192+ return c.closeIssue.CallUnary(ctx, req)
193+}
194+
195+// ReopenIssue calls ermite.IssueService.ReopenIssue.
196+func (c *issueServiceClient) ReopenIssue(ctx context.Context, req *connect.Request[ermite.ReopenIssueRequest]) (*connect.Response[ermite.ReopenIssueResponse], error) {
197+ return c.reopenIssue.CallUnary(ctx, req)
198+}
199+
200+// ListPendingIssues calls ermite.IssueService.ListPendingIssues.
201+func (c *issueServiceClient) ListPendingIssues(ctx context.Context, req *connect.Request[ermite.ListPendingIssuesRequest]) (*connect.Response[ermite.ListPendingIssuesResponse], error) {
202+ return c.listPendingIssues.CallUnary(ctx, req)
203+}
204+
205+// ApproveIssue calls ermite.IssueService.ApproveIssue.
206+func (c *issueServiceClient) ApproveIssue(ctx context.Context, req *connect.Request[ermite.ApproveIssueRequest]) (*connect.Response[ermite.ApproveIssueResponse], error) {
207+ return c.approveIssue.CallUnary(ctx, req)
208+}
209+
210+// RejectIssue calls ermite.IssueService.RejectIssue.
211+func (c *issueServiceClient) RejectIssue(ctx context.Context, req *connect.Request[ermite.RejectIssueRequest]) (*connect.Response[ermite.RejectIssueResponse], error) {
212+ return c.rejectIssue.CallUnary(ctx, req)
213+}
214+
215+// IssueServiceHandler is an implementation of the ermite.IssueService service.
216+type IssueServiceHandler interface {
217+ // CreateIssue opens an issue. Needs the issue:write scope.
218+ CreateIssue(context.Context, *connect.Request[ermite.CreateIssueRequest]) (*connect.Response[ermite.CreateIssueResponse], error)
219+ // ListIssues lists issues, highest number first, optionally in one state.
220+ ListIssues(context.Context, *connect.Request[ermite.ListIssuesRequest]) (*connect.Response[ermite.ListIssuesResponse], error)
221+ // GetIssue returns an issue with its comments.
222+ GetIssue(context.Context, *connect.Request[ermite.GetIssueRequest]) (*connect.Response[ermite.GetIssueResponse], error)
223+ // AddIssueComment adds a comment. Needs the issue:write scope.
224+ AddIssueComment(context.Context, *connect.Request[ermite.AddIssueCommentRequest]) (*connect.Response[ermite.AddIssueCommentResponse], error)
225+ // CloseIssue closes an issue. Needs the issue:write scope.
226+ CloseIssue(context.Context, *connect.Request[ermite.CloseIssueRequest]) (*connect.Response[ermite.CloseIssueResponse], error)
227+ // ReopenIssue reopens an issue. Needs the issue:write scope.
228+ ReopenIssue(context.Context, *connect.Request[ermite.ReopenIssueRequest]) (*connect.Response[ermite.ReopenIssueResponse], error)
229+ // ListPendingIssues lists issues awaiting moderation, oldest first. Owner
230+ // rights only; anyone else gets NOT_FOUND.
231+ ListPendingIssues(context.Context, *connect.Request[ermite.ListPendingIssuesRequest]) (*connect.Response[ermite.ListPendingIssuesResponse], error)
232+ // ApproveIssue turns a pending issue into an open issue with a new number.
233+ // Owner rights only; anyone else gets NOT_FOUND.
234+ ApproveIssue(context.Context, *connect.Request[ermite.ApproveIssueRequest]) (*connect.Response[ermite.ApproveIssueResponse], error)
235+ // RejectIssue discards a pending issue, optionally banning its submitter.
236+ // Owner rights only; anyone else gets NOT_FOUND.
237+ RejectIssue(context.Context, *connect.Request[ermite.RejectIssueRequest]) (*connect.Response[ermite.RejectIssueResponse], error)
238+}
239+
240+// NewIssueServiceHandler builds an HTTP handler from the service implementation. It returns the
241+// path on which to mount the handler and the handler itself.
242+//
243+// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
244+// and JSON codecs. They also support gzip compression.
245+func NewIssueServiceHandler(svc IssueServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
246+ issueServiceMethods := ermite.File_ermite_issue_proto.Services().ByName("IssueService").Methods()
247+ issueServiceCreateIssueHandler := connect.NewUnaryHandler(
248+ IssueServiceCreateIssueProcedure,
249+ svc.CreateIssue,
250+ connect.WithSchema(issueServiceMethods.ByName("CreateIssue")),
251+ connect.WithHandlerOptions(opts...),
252+ )
253+ issueServiceListIssuesHandler := connect.NewUnaryHandler(
254+ IssueServiceListIssuesProcedure,
255+ svc.ListIssues,
256+ connect.WithSchema(issueServiceMethods.ByName("ListIssues")),
257+ connect.WithHandlerOptions(opts...),
258+ )
259+ issueServiceGetIssueHandler := connect.NewUnaryHandler(
260+ IssueServiceGetIssueProcedure,
261+ svc.GetIssue,
262+ connect.WithSchema(issueServiceMethods.ByName("GetIssue")),
263+ connect.WithHandlerOptions(opts...),
264+ )
265+ issueServiceAddIssueCommentHandler := connect.NewUnaryHandler(
266+ IssueServiceAddIssueCommentProcedure,
267+ svc.AddIssueComment,
268+ connect.WithSchema(issueServiceMethods.ByName("AddIssueComment")),
269+ connect.WithHandlerOptions(opts...),
270+ )
271+ issueServiceCloseIssueHandler := connect.NewUnaryHandler(
272+ IssueServiceCloseIssueProcedure,
273+ svc.CloseIssue,
274+ connect.WithSchema(issueServiceMethods.ByName("CloseIssue")),
275+ connect.WithHandlerOptions(opts...),
276+ )
277+ issueServiceReopenIssueHandler := connect.NewUnaryHandler(
278+ IssueServiceReopenIssueProcedure,
279+ svc.ReopenIssue,
280+ connect.WithSchema(issueServiceMethods.ByName("ReopenIssue")),
281+ connect.WithHandlerOptions(opts...),
282+ )
283+ issueServiceListPendingIssuesHandler := connect.NewUnaryHandler(
284+ IssueServiceListPendingIssuesProcedure,
285+ svc.ListPendingIssues,
286+ connect.WithSchema(issueServiceMethods.ByName("ListPendingIssues")),
287+ connect.WithHandlerOptions(opts...),
288+ )
289+ issueServiceApproveIssueHandler := connect.NewUnaryHandler(
290+ IssueServiceApproveIssueProcedure,
291+ svc.ApproveIssue,
292+ connect.WithSchema(issueServiceMethods.ByName("ApproveIssue")),
293+ connect.WithHandlerOptions(opts...),
294+ )
295+ issueServiceRejectIssueHandler := connect.NewUnaryHandler(
296+ IssueServiceRejectIssueProcedure,
297+ svc.RejectIssue,
298+ connect.WithSchema(issueServiceMethods.ByName("RejectIssue")),
299+ connect.WithHandlerOptions(opts...),
300+ )
301+ return "/ermite.IssueService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
302+ switch r.URL.Path {
303+ case IssueServiceCreateIssueProcedure:
304+ issueServiceCreateIssueHandler.ServeHTTP(w, r)
305+ case IssueServiceListIssuesProcedure:
306+ issueServiceListIssuesHandler.ServeHTTP(w, r)
307+ case IssueServiceGetIssueProcedure:
308+ issueServiceGetIssueHandler.ServeHTTP(w, r)
309+ case IssueServiceAddIssueCommentProcedure:
310+ issueServiceAddIssueCommentHandler.ServeHTTP(w, r)
311+ case IssueServiceCloseIssueProcedure:
312+ issueServiceCloseIssueHandler.ServeHTTP(w, r)
313+ case IssueServiceReopenIssueProcedure:
314+ issueServiceReopenIssueHandler.ServeHTTP(w, r)
315+ case IssueServiceListPendingIssuesProcedure:
316+ issueServiceListPendingIssuesHandler.ServeHTTP(w, r)
317+ case IssueServiceApproveIssueProcedure:
318+ issueServiceApproveIssueHandler.ServeHTTP(w, r)
319+ case IssueServiceRejectIssueProcedure:
320+ issueServiceRejectIssueHandler.ServeHTTP(w, r)
321+ default:
322+ http.NotFound(w, r)
323+ }
324+ })
325+}
326+
327+// UnimplementedIssueServiceHandler returns CodeUnimplemented from all methods.
328+type UnimplementedIssueServiceHandler struct{}
329+
330+func (UnimplementedIssueServiceHandler) CreateIssue(context.Context, *connect.Request[ermite.CreateIssueRequest]) (*connect.Response[ermite.CreateIssueResponse], error) {
331+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.CreateIssue is not implemented"))
332+}
333+
334+func (UnimplementedIssueServiceHandler) ListIssues(context.Context, *connect.Request[ermite.ListIssuesRequest]) (*connect.Response[ermite.ListIssuesResponse], error) {
335+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.ListIssues is not implemented"))
336+}
337+
338+func (UnimplementedIssueServiceHandler) GetIssue(context.Context, *connect.Request[ermite.GetIssueRequest]) (*connect.Response[ermite.GetIssueResponse], error) {
339+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.GetIssue is not implemented"))
340+}
341+
342+func (UnimplementedIssueServiceHandler) AddIssueComment(context.Context, *connect.Request[ermite.AddIssueCommentRequest]) (*connect.Response[ermite.AddIssueCommentResponse], error) {
343+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.AddIssueComment is not implemented"))
344+}
345+
346+func (UnimplementedIssueServiceHandler) CloseIssue(context.Context, *connect.Request[ermite.CloseIssueRequest]) (*connect.Response[ermite.CloseIssueResponse], error) {
347+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.CloseIssue is not implemented"))
348+}
349+
350+func (UnimplementedIssueServiceHandler) ReopenIssue(context.Context, *connect.Request[ermite.ReopenIssueRequest]) (*connect.Response[ermite.ReopenIssueResponse], error) {
351+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.ReopenIssue is not implemented"))
352+}
353+
354+func (UnimplementedIssueServiceHandler) ListPendingIssues(context.Context, *connect.Request[ermite.ListPendingIssuesRequest]) (*connect.Response[ermite.ListPendingIssuesResponse], error) {
355+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.ListPendingIssues is not implemented"))
356+}
357+
358+func (UnimplementedIssueServiceHandler) ApproveIssue(context.Context, *connect.Request[ermite.ApproveIssueRequest]) (*connect.Response[ermite.ApproveIssueResponse], error) {
359+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.ApproveIssue is not implemented"))
360+}
361+
362+func (UnimplementedIssueServiceHandler) RejectIssue(context.Context, *connect.Request[ermite.RejectIssueRequest]) (*connect.Response[ermite.RejectIssueResponse], error) {
363+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.RejectIssue is not implemented"))
364+}
@@ -0,0 +1,364 @@
1+// SPDX-License-Identifier: MIT
2+
3+// Code generated by protoc-gen-connect-go. DO NOT EDIT.
4+//
5+// Source: ermite/issue.proto
6+
7+package ermiteconnect
8+
9+import (
10+ ermite "bnema.dev/ermite-api/gen/ermite"
11+ connect "connectrpc.com/connect"
12+ context "context"
13+ errors "errors"
14+ http "net/http"
15+ strings "strings"
16+)
17+
18+// This is a compile-time assertion to ensure that this generated file and the connect package are
19+// compatible. If you get a compiler error that this constant is not defined, this code was
20+// generated with a version of connect newer than the one compiled into your binary. You can fix the
21+// problem by either regenerating this code with an older version of connect or updating the connect
22+// version compiled into your binary.
23+const _ = connect.IsAtLeastVersion1_13_0
24+
25+const (
26+ // IssueServiceName is the fully-qualified name of the IssueService service.
27+ IssueServiceName = "ermite.IssueService"
28+)
29+
30+// These constants are the fully-qualified names of the RPCs defined in this package. They're
31+// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
32+//
33+// Note that these are different from the fully-qualified method names used by
34+// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
35+// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
36+// period.
37+const (
38+ // IssueServiceCreateIssueProcedure is the fully-qualified name of the IssueService's CreateIssue
39+ // RPC.
40+ IssueServiceCreateIssueProcedure = "/ermite.IssueService/CreateIssue"
41+ // IssueServiceListIssuesProcedure is the fully-qualified name of the IssueService's ListIssues RPC.
42+ IssueServiceListIssuesProcedure = "/ermite.IssueService/ListIssues"
43+ // IssueServiceGetIssueProcedure is the fully-qualified name of the IssueService's GetIssue RPC.
44+ IssueServiceGetIssueProcedure = "/ermite.IssueService/GetIssue"
45+ // IssueServiceAddIssueCommentProcedure is the fully-qualified name of the IssueService's
46+ // AddIssueComment RPC.
47+ IssueServiceAddIssueCommentProcedure = "/ermite.IssueService/AddIssueComment"
48+ // IssueServiceCloseIssueProcedure is the fully-qualified name of the IssueService's CloseIssue RPC.
49+ IssueServiceCloseIssueProcedure = "/ermite.IssueService/CloseIssue"
50+ // IssueServiceReopenIssueProcedure is the fully-qualified name of the IssueService's ReopenIssue
51+ // RPC.
52+ IssueServiceReopenIssueProcedure = "/ermite.IssueService/ReopenIssue"
53+ // IssueServiceListPendingIssuesProcedure is the fully-qualified name of the IssueService's
54+ // ListPendingIssues RPC.
55+ IssueServiceListPendingIssuesProcedure = "/ermite.IssueService/ListPendingIssues"
56+ // IssueServiceApproveIssueProcedure is the fully-qualified name of the IssueService's ApproveIssue
57+ // RPC.
58+ IssueServiceApproveIssueProcedure = "/ermite.IssueService/ApproveIssue"
59+ // IssueServiceRejectIssueProcedure is the fully-qualified name of the IssueService's RejectIssue
60+ // RPC.
61+ IssueServiceRejectIssueProcedure = "/ermite.IssueService/RejectIssue"
62+)
63+
64+// IssueServiceClient is a client for the ermite.IssueService service.
65+type IssueServiceClient interface {
66+ // CreateIssue opens an issue. Needs the issue:write scope.
67+ CreateIssue(context.Context, *connect.Request[ermite.CreateIssueRequest]) (*connect.Response[ermite.CreateIssueResponse], error)
68+ // ListIssues lists issues, highest number first, optionally in one state.
69+ ListIssues(context.Context, *connect.Request[ermite.ListIssuesRequest]) (*connect.Response[ermite.ListIssuesResponse], error)
70+ // GetIssue returns an issue with its comments.
71+ GetIssue(context.Context, *connect.Request[ermite.GetIssueRequest]) (*connect.Response[ermite.GetIssueResponse], error)
72+ // AddIssueComment adds a comment. Needs the issue:write scope.
73+ AddIssueComment(context.Context, *connect.Request[ermite.AddIssueCommentRequest]) (*connect.Response[ermite.AddIssueCommentResponse], error)
74+ // CloseIssue closes an issue. Needs the issue:write scope.
75+ CloseIssue(context.Context, *connect.Request[ermite.CloseIssueRequest]) (*connect.Response[ermite.CloseIssueResponse], error)
76+ // ReopenIssue reopens an issue. Needs the issue:write scope.
77+ ReopenIssue(context.Context, *connect.Request[ermite.ReopenIssueRequest]) (*connect.Response[ermite.ReopenIssueResponse], error)
78+ // ListPendingIssues lists issues awaiting moderation, oldest first. Owner
79+ // rights only; anyone else gets NOT_FOUND.
80+ ListPendingIssues(context.Context, *connect.Request[ermite.ListPendingIssuesRequest]) (*connect.Response[ermite.ListPendingIssuesResponse], error)
81+ // ApproveIssue turns a pending issue into an open issue with a new number.
82+ // Owner rights only; anyone else gets NOT_FOUND.
83+ ApproveIssue(context.Context, *connect.Request[ermite.ApproveIssueRequest]) (*connect.Response[ermite.ApproveIssueResponse], error)
84+ // RejectIssue discards a pending issue, optionally banning its submitter.
85+ // Owner rights only; anyone else gets NOT_FOUND.
86+ RejectIssue(context.Context, *connect.Request[ermite.RejectIssueRequest]) (*connect.Response[ermite.RejectIssueResponse], error)
87+}
88+
89+// NewIssueServiceClient constructs a client for the ermite.IssueService service. By default, it
90+// uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends
91+// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or
92+// connect.WithGRPCWeb() options.
93+//
94+// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
95+// http://api.acme.com or https://acme.com/grpc).
96+func NewIssueServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) IssueServiceClient {
97+ baseURL = strings.TrimRight(baseURL, "/")
98+ issueServiceMethods := ermite.File_ermite_issue_proto.Services().ByName("IssueService").Methods()
99+ return &issueServiceClient{
100+ createIssue: connect.NewClient[ermite.CreateIssueRequest, ermite.CreateIssueResponse](
101+ httpClient,
102+ baseURL+IssueServiceCreateIssueProcedure,
103+ connect.WithSchema(issueServiceMethods.ByName("CreateIssue")),
104+ connect.WithClientOptions(opts...),
105+ ),
106+ listIssues: connect.NewClient[ermite.ListIssuesRequest, ermite.ListIssuesResponse](
107+ httpClient,
108+ baseURL+IssueServiceListIssuesProcedure,
109+ connect.WithSchema(issueServiceMethods.ByName("ListIssues")),
110+ connect.WithClientOptions(opts...),
111+ ),
112+ getIssue: connect.NewClient[ermite.GetIssueRequest, ermite.GetIssueResponse](
113+ httpClient,
114+ baseURL+IssueServiceGetIssueProcedure,
115+ connect.WithSchema(issueServiceMethods.ByName("GetIssue")),
116+ connect.WithClientOptions(opts...),
117+ ),
118+ addIssueComment: connect.NewClient[ermite.AddIssueCommentRequest, ermite.AddIssueCommentResponse](
119+ httpClient,
120+ baseURL+IssueServiceAddIssueCommentProcedure,
121+ connect.WithSchema(issueServiceMethods.ByName("AddIssueComment")),
122+ connect.WithClientOptions(opts...),
123+ ),
124+ closeIssue: connect.NewClient[ermite.CloseIssueRequest, ermite.CloseIssueResponse](
125+ httpClient,
126+ baseURL+IssueServiceCloseIssueProcedure,
127+ connect.WithSchema(issueServiceMethods.ByName("CloseIssue")),
128+ connect.WithClientOptions(opts...),
129+ ),
130+ reopenIssue: connect.NewClient[ermite.ReopenIssueRequest, ermite.ReopenIssueResponse](
131+ httpClient,
132+ baseURL+IssueServiceReopenIssueProcedure,
133+ connect.WithSchema(issueServiceMethods.ByName("ReopenIssue")),
134+ connect.WithClientOptions(opts...),
135+ ),
136+ listPendingIssues: connect.NewClient[ermite.ListPendingIssuesRequest, ermite.ListPendingIssuesResponse](
137+ httpClient,
138+ baseURL+IssueServiceListPendingIssuesProcedure,
139+ connect.WithSchema(issueServiceMethods.ByName("ListPendingIssues")),
140+ connect.WithClientOptions(opts...),
141+ ),
142+ approveIssue: connect.NewClient[ermite.ApproveIssueRequest, ermite.ApproveIssueResponse](
143+ httpClient,
144+ baseURL+IssueServiceApproveIssueProcedure,
145+ connect.WithSchema(issueServiceMethods.ByName("ApproveIssue")),
146+ connect.WithClientOptions(opts...),
147+ ),
148+ rejectIssue: connect.NewClient[ermite.RejectIssueRequest, ermite.RejectIssueResponse](
149+ httpClient,
150+ baseURL+IssueServiceRejectIssueProcedure,
151+ connect.WithSchema(issueServiceMethods.ByName("RejectIssue")),
152+ connect.WithClientOptions(opts...),
153+ ),
154+ }
155+}
156+
157+// issueServiceClient implements IssueServiceClient.
158+type issueServiceClient struct {
159+ createIssue *connect.Client[ermite.CreateIssueRequest, ermite.CreateIssueResponse]
160+ listIssues *connect.Client[ermite.ListIssuesRequest, ermite.ListIssuesResponse]
161+ getIssue *connect.Client[ermite.GetIssueRequest, ermite.GetIssueResponse]
162+ addIssueComment *connect.Client[ermite.AddIssueCommentRequest, ermite.AddIssueCommentResponse]
163+ closeIssue *connect.Client[ermite.CloseIssueRequest, ermite.CloseIssueResponse]
164+ reopenIssue *connect.Client[ermite.ReopenIssueRequest, ermite.ReopenIssueResponse]
165+ listPendingIssues *connect.Client[ermite.ListPendingIssuesRequest, ermite.ListPendingIssuesResponse]
166+ approveIssue *connect.Client[ermite.ApproveIssueRequest, ermite.ApproveIssueResponse]
167+ rejectIssue *connect.Client[ermite.RejectIssueRequest, ermite.RejectIssueResponse]
168+}
169+
170+// CreateIssue calls ermite.IssueService.CreateIssue.
171+func (c *issueServiceClient) CreateIssue(ctx context.Context, req *connect.Request[ermite.CreateIssueRequest]) (*connect.Response[ermite.CreateIssueResponse], error) {
172+ return c.createIssue.CallUnary(ctx, req)
173+}
174+
175+// ListIssues calls ermite.IssueService.ListIssues.
176+func (c *issueServiceClient) ListIssues(ctx context.Context, req *connect.Request[ermite.ListIssuesRequest]) (*connect.Response[ermite.ListIssuesResponse], error) {
177+ return c.listIssues.CallUnary(ctx, req)
178+}
179+
180+// GetIssue calls ermite.IssueService.GetIssue.
181+func (c *issueServiceClient) GetIssue(ctx context.Context, req *connect.Request[ermite.GetIssueRequest]) (*connect.Response[ermite.GetIssueResponse], error) {
182+ return c.getIssue.CallUnary(ctx, req)
183+}
184+
185+// AddIssueComment calls ermite.IssueService.AddIssueComment.
186+func (c *issueServiceClient) AddIssueComment(ctx context.Context, req *connect.Request[ermite.AddIssueCommentRequest]) (*connect.Response[ermite.AddIssueCommentResponse], error) {
187+ return c.addIssueComment.CallUnary(ctx, req)
188+}
189+
190+// CloseIssue calls ermite.IssueService.CloseIssue.
191+func (c *issueServiceClient) CloseIssue(ctx context.Context, req *connect.Request[ermite.CloseIssueRequest]) (*connect.Response[ermite.CloseIssueResponse], error) {
192+ return c.closeIssue.CallUnary(ctx, req)
193+}
194+
195+// ReopenIssue calls ermite.IssueService.ReopenIssue.
196+func (c *issueServiceClient) ReopenIssue(ctx context.Context, req *connect.Request[ermite.ReopenIssueRequest]) (*connect.Response[ermite.ReopenIssueResponse], error) {
197+ return c.reopenIssue.CallUnary(ctx, req)
198+}
199+
200+// ListPendingIssues calls ermite.IssueService.ListPendingIssues.
201+func (c *issueServiceClient) ListPendingIssues(ctx context.Context, req *connect.Request[ermite.ListPendingIssuesRequest]) (*connect.Response[ermite.ListPendingIssuesResponse], error) {
202+ return c.listPendingIssues.CallUnary(ctx, req)
203+}
204+
205+// ApproveIssue calls ermite.IssueService.ApproveIssue.
206+func (c *issueServiceClient) ApproveIssue(ctx context.Context, req *connect.Request[ermite.ApproveIssueRequest]) (*connect.Response[ermite.ApproveIssueResponse], error) {
207+ return c.approveIssue.CallUnary(ctx, req)
208+}
209+
210+// RejectIssue calls ermite.IssueService.RejectIssue.
211+func (c *issueServiceClient) RejectIssue(ctx context.Context, req *connect.Request[ermite.RejectIssueRequest]) (*connect.Response[ermite.RejectIssueResponse], error) {
212+ return c.rejectIssue.CallUnary(ctx, req)
213+}
214+
215+// IssueServiceHandler is an implementation of the ermite.IssueService service.
216+type IssueServiceHandler interface {
217+ // CreateIssue opens an issue. Needs the issue:write scope.
218+ CreateIssue(context.Context, *connect.Request[ermite.CreateIssueRequest]) (*connect.Response[ermite.CreateIssueResponse], error)
219+ // ListIssues lists issues, highest number first, optionally in one state.
220+ ListIssues(context.Context, *connect.Request[ermite.ListIssuesRequest]) (*connect.Response[ermite.ListIssuesResponse], error)
221+ // GetIssue returns an issue with its comments.
222+ GetIssue(context.Context, *connect.Request[ermite.GetIssueRequest]) (*connect.Response[ermite.GetIssueResponse], error)
223+ // AddIssueComment adds a comment. Needs the issue:write scope.
224+ AddIssueComment(context.Context, *connect.Request[ermite.AddIssueCommentRequest]) (*connect.Response[ermite.AddIssueCommentResponse], error)
225+ // CloseIssue closes an issue. Needs the issue:write scope.
226+ CloseIssue(context.Context, *connect.Request[ermite.CloseIssueRequest]) (*connect.Response[ermite.CloseIssueResponse], error)
227+ // ReopenIssue reopens an issue. Needs the issue:write scope.
228+ ReopenIssue(context.Context, *connect.Request[ermite.ReopenIssueRequest]) (*connect.Response[ermite.ReopenIssueResponse], error)
229+ // ListPendingIssues lists issues awaiting moderation, oldest first. Owner
230+ // rights only; anyone else gets NOT_FOUND.
231+ ListPendingIssues(context.Context, *connect.Request[ermite.ListPendingIssuesRequest]) (*connect.Response[ermite.ListPendingIssuesResponse], error)
232+ // ApproveIssue turns a pending issue into an open issue with a new number.
233+ // Owner rights only; anyone else gets NOT_FOUND.
234+ ApproveIssue(context.Context, *connect.Request[ermite.ApproveIssueRequest]) (*connect.Response[ermite.ApproveIssueResponse], error)
235+ // RejectIssue discards a pending issue, optionally banning its submitter.
236+ // Owner rights only; anyone else gets NOT_FOUND.
237+ RejectIssue(context.Context, *connect.Request[ermite.RejectIssueRequest]) (*connect.Response[ermite.RejectIssueResponse], error)
238+}
239+
240+// NewIssueServiceHandler builds an HTTP handler from the service implementation. It returns the
241+// path on which to mount the handler and the handler itself.
242+//
243+// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
244+// and JSON codecs. They also support gzip compression.
245+func NewIssueServiceHandler(svc IssueServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
246+ issueServiceMethods := ermite.File_ermite_issue_proto.Services().ByName("IssueService").Methods()
247+ issueServiceCreateIssueHandler := connect.NewUnaryHandler(
248+ IssueServiceCreateIssueProcedure,
249+ svc.CreateIssue,
250+ connect.WithSchema(issueServiceMethods.ByName("CreateIssue")),
251+ connect.WithHandlerOptions(opts...),
252+ )
253+ issueServiceListIssuesHandler := connect.NewUnaryHandler(
254+ IssueServiceListIssuesProcedure,
255+ svc.ListIssues,
256+ connect.WithSchema(issueServiceMethods.ByName("ListIssues")),
257+ connect.WithHandlerOptions(opts...),
258+ )
259+ issueServiceGetIssueHandler := connect.NewUnaryHandler(
260+ IssueServiceGetIssueProcedure,
261+ svc.GetIssue,
262+ connect.WithSchema(issueServiceMethods.ByName("GetIssue")),
263+ connect.WithHandlerOptions(opts...),
264+ )
265+ issueServiceAddIssueCommentHandler := connect.NewUnaryHandler(
266+ IssueServiceAddIssueCommentProcedure,
267+ svc.AddIssueComment,
268+ connect.WithSchema(issueServiceMethods.ByName("AddIssueComment")),
269+ connect.WithHandlerOptions(opts...),
270+ )
271+ issueServiceCloseIssueHandler := connect.NewUnaryHandler(
272+ IssueServiceCloseIssueProcedure,
273+ svc.CloseIssue,
274+ connect.WithSchema(issueServiceMethods.ByName("CloseIssue")),
275+ connect.WithHandlerOptions(opts...),
276+ )
277+ issueServiceReopenIssueHandler := connect.NewUnaryHandler(
278+ IssueServiceReopenIssueProcedure,
279+ svc.ReopenIssue,
280+ connect.WithSchema(issueServiceMethods.ByName("ReopenIssue")),
281+ connect.WithHandlerOptions(opts...),
282+ )
283+ issueServiceListPendingIssuesHandler := connect.NewUnaryHandler(
284+ IssueServiceListPendingIssuesProcedure,
285+ svc.ListPendingIssues,
286+ connect.WithSchema(issueServiceMethods.ByName("ListPendingIssues")),
287+ connect.WithHandlerOptions(opts...),
288+ )
289+ issueServiceApproveIssueHandler := connect.NewUnaryHandler(
290+ IssueServiceApproveIssueProcedure,
291+ svc.ApproveIssue,
292+ connect.WithSchema(issueServiceMethods.ByName("ApproveIssue")),
293+ connect.WithHandlerOptions(opts...),
294+ )
295+ issueServiceRejectIssueHandler := connect.NewUnaryHandler(
296+ IssueServiceRejectIssueProcedure,
297+ svc.RejectIssue,
298+ connect.WithSchema(issueServiceMethods.ByName("RejectIssue")),
299+ connect.WithHandlerOptions(opts...),
300+ )
301+ return "/ermite.IssueService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
302+ switch r.URL.Path {
303+ case IssueServiceCreateIssueProcedure:
304+ issueServiceCreateIssueHandler.ServeHTTP(w, r)
305+ case IssueServiceListIssuesProcedure:
306+ issueServiceListIssuesHandler.ServeHTTP(w, r)
307+ case IssueServiceGetIssueProcedure:
308+ issueServiceGetIssueHandler.ServeHTTP(w, r)
309+ case IssueServiceAddIssueCommentProcedure:
310+ issueServiceAddIssueCommentHandler.ServeHTTP(w, r)
311+ case IssueServiceCloseIssueProcedure:
312+ issueServiceCloseIssueHandler.ServeHTTP(w, r)
313+ case IssueServiceReopenIssueProcedure:
314+ issueServiceReopenIssueHandler.ServeHTTP(w, r)
315+ case IssueServiceListPendingIssuesProcedure:
316+ issueServiceListPendingIssuesHandler.ServeHTTP(w, r)
317+ case IssueServiceApproveIssueProcedure:
318+ issueServiceApproveIssueHandler.ServeHTTP(w, r)
319+ case IssueServiceRejectIssueProcedure:
320+ issueServiceRejectIssueHandler.ServeHTTP(w, r)
321+ default:
322+ http.NotFound(w, r)
323+ }
324+ })
325+}
326+
327+// UnimplementedIssueServiceHandler returns CodeUnimplemented from all methods.
328+type UnimplementedIssueServiceHandler struct{}
329+
330+func (UnimplementedIssueServiceHandler) CreateIssue(context.Context, *connect.Request[ermite.CreateIssueRequest]) (*connect.Response[ermite.CreateIssueResponse], error) {
331+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.CreateIssue is not implemented"))
332+}
333+
334+func (UnimplementedIssueServiceHandler) ListIssues(context.Context, *connect.Request[ermite.ListIssuesRequest]) (*connect.Response[ermite.ListIssuesResponse], error) {
335+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.ListIssues is not implemented"))
336+}
337+
338+func (UnimplementedIssueServiceHandler) GetIssue(context.Context, *connect.Request[ermite.GetIssueRequest]) (*connect.Response[ermite.GetIssueResponse], error) {
339+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.GetIssue is not implemented"))
340+}
341+
342+func (UnimplementedIssueServiceHandler) AddIssueComment(context.Context, *connect.Request[ermite.AddIssueCommentRequest]) (*connect.Response[ermite.AddIssueCommentResponse], error) {
343+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.AddIssueComment is not implemented"))
344+}
345+
346+func (UnimplementedIssueServiceHandler) CloseIssue(context.Context, *connect.Request[ermite.CloseIssueRequest]) (*connect.Response[ermite.CloseIssueResponse], error) {
347+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.CloseIssue is not implemented"))
348+}
349+
350+func (UnimplementedIssueServiceHandler) ReopenIssue(context.Context, *connect.Request[ermite.ReopenIssueRequest]) (*connect.Response[ermite.ReopenIssueResponse], error) {
351+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.ReopenIssue is not implemented"))
352+}
353+
354+func (UnimplementedIssueServiceHandler) ListPendingIssues(context.Context, *connect.Request[ermite.ListPendingIssuesRequest]) (*connect.Response[ermite.ListPendingIssuesResponse], error) {
355+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.ListPendingIssues is not implemented"))
356+}
357+
358+func (UnimplementedIssueServiceHandler) ApproveIssue(context.Context, *connect.Request[ermite.ApproveIssueRequest]) (*connect.Response[ermite.ApproveIssueResponse], error) {
359+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.ApproveIssue is not implemented"))
360+}
361+
362+func (UnimplementedIssueServiceHandler) RejectIssue(context.Context, *connect.Request[ermite.RejectIssueRequest]) (*connect.Response[ermite.RejectIssueResponse], error) {
363+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.IssueService.RejectIssue is not implemented"))
364+}
M gen/ermite/event.pb.go +445 -51
@@ -28,9 +28,17 @@ const (
2828 type WatchRequest struct {
2929 state protoimpl.MessageState `protogen:"open.v1"`
3030 // Topics are the subjects to follow: "home" for every repository visible to
31- // the caller, or "repo:<name>" for one repository. Empty means "home".
32- // Unknown topics are invalid_argument. A "repo:<name>" topic for a repository
33- // that does not exist or is not visible is not_found.
31+ // the caller, "repo:<name>" for one repository, or "owner". Empty means
32+ // "home". Unknown topics are invalid_argument. A "repo:<name>" topic for a
33+ // repository that does not exist or is not visible is not_found.
34+ //
35+ // The "owner" topic needs owner rights: root, an owner session, or a token
36+ // that holds every scope with no repository or branch limit. Anyone else
37+ // gets the same invalid_argument as for an unknown topic, so the topic is
38+ // not revealed. It carries the merge request and issue events of every
39+ // repository (merge_request_opened, merge_request_merged,
40+ // merge_request_closed, comment_added, and the issue events), repo_updated
41+ // and repo_deleted, plus issue_submitted, which is delivered nowhere else.
3442 Topics []string `protobuf:"bytes,1,rep,name=topics,proto3" json:"topics,omitempty"`
3543 // ResumeAfter is the Event.id of the last event the client has seen. Empty
3644 // to receive only new events.
@@ -157,6 +165,11 @@ type Event struct {
157165 // *Event_CommentEdited
158166 // *Event_CommentDeleted
159167 // *Event_CommentResolved
168+ // *Event_IssueOpened
169+ // *Event_IssueClosed
170+ // *Event_IssueReopened
171+ // *Event_IssueCommented
172+ // *Event_IssueSubmitted
160173 Kind isEvent_Kind `protobuf_oneof:"kind"`
161174 unknownFields protoimpl.UnknownFields
162175 sizeCache protoimpl.SizeCache
@@ -339,6 +352,51 @@ func (x *Event) GetCommentResolved() *CommentResolved {
339352 return nil
340353 }
341354
355+func (x *Event) GetIssueOpened() *IssueOpened {
356+ if x != nil {
357+ if x, ok := x.Kind.(*Event_IssueOpened); ok {
358+ return x.IssueOpened
359+ }
360+ }
361+ return nil
362+}
363+
364+func (x *Event) GetIssueClosed() *IssueClosed {
365+ if x != nil {
366+ if x, ok := x.Kind.(*Event_IssueClosed); ok {
367+ return x.IssueClosed
368+ }
369+ }
370+ return nil
371+}
372+
373+func (x *Event) GetIssueReopened() *IssueReopened {
374+ if x != nil {
375+ if x, ok := x.Kind.(*Event_IssueReopened); ok {
376+ return x.IssueReopened
377+ }
378+ }
379+ return nil
380+}
381+
382+func (x *Event) GetIssueCommented() *IssueCommented {
383+ if x != nil {
384+ if x, ok := x.Kind.(*Event_IssueCommented); ok {
385+ return x.IssueCommented
386+ }
387+ }
388+ return nil
389+}
390+
391+func (x *Event) GetIssueSubmitted() *IssueSubmitted {
392+ if x != nil {
393+ if x, ok := x.Kind.(*Event_IssueSubmitted); ok {
394+ return x.IssueSubmitted
395+ }
396+ }
397+ return nil
398+}
399+
342400 type isEvent_Kind interface {
343401 isEvent_Kind()
344402 }
@@ -413,6 +471,32 @@ type Event_CommentResolved struct {
413471 CommentResolved *CommentResolved `protobuf:"bytes,16,opt,name=comment_resolved,json=commentResolved,proto3,oneof"`
414472 }
415473
474+type Event_IssueOpened struct {
475+ // IssueOpened: an issue was opened.
476+ IssueOpened *IssueOpened `protobuf:"bytes,17,opt,name=issue_opened,json=issueOpened,proto3,oneof"`
477+}
478+
479+type Event_IssueClosed struct {
480+ // IssueClosed: an issue was closed.
481+ IssueClosed *IssueClosed `protobuf:"bytes,18,opt,name=issue_closed,json=issueClosed,proto3,oneof"`
482+}
483+
484+type Event_IssueReopened struct {
485+ // IssueReopened: an issue was reopened.
486+ IssueReopened *IssueReopened `protobuf:"bytes,19,opt,name=issue_reopened,json=issueReopened,proto3,oneof"`
487+}
488+
489+type Event_IssueCommented struct {
490+ // IssueCommented: a comment was added to an issue.
491+ IssueCommented *IssueCommented `protobuf:"bytes,20,opt,name=issue_commented,json=issueCommented,proto3,oneof"`
492+}
493+
494+type Event_IssueSubmitted struct {
495+ // IssueSubmitted: an issue is awaiting moderation. Delivered only on the
496+ // "owner" topic, never on "home" or "repo:<name>", and carries no content.
497+ IssueSubmitted *IssueSubmitted `protobuf:"bytes,21,opt,name=issue_submitted,json=issueSubmitted,proto3,oneof"`
498+}
499+
416500 func (*Event_RepoCreated) isEvent_Kind() {}
417501
418502 func (*Event_RepoUpdated) isEvent_Kind() {}
@@ -441,6 +525,16 @@ func (*Event_CommentDeleted) isEvent_Kind() {}
441525
442526 func (*Event_CommentResolved) isEvent_Kind() {}
443527
528+func (*Event_IssueOpened) isEvent_Kind() {}
529+
530+func (*Event_IssueClosed) isEvent_Kind() {}
531+
532+func (*Event_IssueReopened) isEvent_Kind() {}
533+
534+func (*Event_IssueCommented) isEvent_Kind() {}
535+
536+func (*Event_IssueSubmitted) isEvent_Kind() {}
537+
444538 // RepoCreated reports a new repository.
445539 type RepoCreated struct {
446540 state protoimpl.MessageState `protogen:"open.v1"`
@@ -1095,10 +1189,270 @@ func (x *CommentResolved) GetComment() *Comment {
10951189 return nil
10961190 }
10971191
1192+// IssueOpened reports a new issue.
1193+type IssueOpened struct {
1194+ state protoimpl.MessageState `protogen:"open.v1"`
1195+ // Issue is the new issue, including its repository and number.
1196+ Issue *Issue `protobuf:"bytes,1,opt,name=issue,proto3" json:"issue,omitempty"`
1197+ unknownFields protoimpl.UnknownFields
1198+ sizeCache protoimpl.SizeCache
1199+}
1200+
1201+func (x *IssueOpened) Reset() {
1202+ *x = IssueOpened{}
1203+ mi := &file_ermite_event_proto_msgTypes[15]
1204+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1205+ ms.StoreMessageInfo(mi)
1206+}
1207+
1208+func (x *IssueOpened) String() string {
1209+ return protoimpl.X.MessageStringOf(x)
1210+}
1211+
1212+func (*IssueOpened) ProtoMessage() {}
1213+
1214+func (x *IssueOpened) ProtoReflect() protoreflect.Message {
1215+ mi := &file_ermite_event_proto_msgTypes[15]
1216+ if x != nil {
1217+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1218+ if ms.LoadMessageInfo() == nil {
1219+ ms.StoreMessageInfo(mi)
1220+ }
1221+ return ms
1222+ }
1223+ return mi.MessageOf(x)
1224+}
1225+
1226+// Deprecated: Use IssueOpened.ProtoReflect.Descriptor instead.
1227+func (*IssueOpened) Descriptor() ([]byte, []int) {
1228+ return file_ermite_event_proto_rawDescGZIP(), []int{15}
1229+}
1230+
1231+func (x *IssueOpened) GetIssue() *Issue {
1232+ if x != nil {
1233+ return x.Issue
1234+ }
1235+ return nil
1236+}
1237+
1238+// IssueClosed reports a closed issue.
1239+type IssueClosed struct {
1240+ state protoimpl.MessageState `protogen:"open.v1"`
1241+ // Issue is the issue after closing, including its repository and number.
1242+ Issue *Issue `protobuf:"bytes,1,opt,name=issue,proto3" json:"issue,omitempty"`
1243+ unknownFields protoimpl.UnknownFields
1244+ sizeCache protoimpl.SizeCache
1245+}
1246+
1247+func (x *IssueClosed) Reset() {
1248+ *x = IssueClosed{}
1249+ mi := &file_ermite_event_proto_msgTypes[16]
1250+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1251+ ms.StoreMessageInfo(mi)
1252+}
1253+
1254+func (x *IssueClosed) String() string {
1255+ return protoimpl.X.MessageStringOf(x)
1256+}
1257+
1258+func (*IssueClosed) ProtoMessage() {}
1259+
1260+func (x *IssueClosed) ProtoReflect() protoreflect.Message {
1261+ mi := &file_ermite_event_proto_msgTypes[16]
1262+ if x != nil {
1263+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1264+ if ms.LoadMessageInfo() == nil {
1265+ ms.StoreMessageInfo(mi)
1266+ }
1267+ return ms
1268+ }
1269+ return mi.MessageOf(x)
1270+}
1271+
1272+// Deprecated: Use IssueClosed.ProtoReflect.Descriptor instead.
1273+func (*IssueClosed) Descriptor() ([]byte, []int) {
1274+ return file_ermite_event_proto_rawDescGZIP(), []int{16}
1275+}
1276+
1277+func (x *IssueClosed) GetIssue() *Issue {
1278+ if x != nil {
1279+ return x.Issue
1280+ }
1281+ return nil
1282+}
1283+
1284+// IssueReopened reports a reopened issue.
1285+type IssueReopened struct {
1286+ state protoimpl.MessageState `protogen:"open.v1"`
1287+ // Issue is the issue after reopening, including its repository and number.
1288+ Issue *Issue `protobuf:"bytes,1,opt,name=issue,proto3" json:"issue,omitempty"`
1289+ unknownFields protoimpl.UnknownFields
1290+ sizeCache protoimpl.SizeCache
1291+}
1292+
1293+func (x *IssueReopened) Reset() {
1294+ *x = IssueReopened{}
1295+ mi := &file_ermite_event_proto_msgTypes[17]
1296+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1297+ ms.StoreMessageInfo(mi)
1298+}
1299+
1300+func (x *IssueReopened) String() string {
1301+ return protoimpl.X.MessageStringOf(x)
1302+}
1303+
1304+func (*IssueReopened) ProtoMessage() {}
1305+
1306+func (x *IssueReopened) ProtoReflect() protoreflect.Message {
1307+ mi := &file_ermite_event_proto_msgTypes[17]
1308+ if x != nil {
1309+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1310+ if ms.LoadMessageInfo() == nil {
1311+ ms.StoreMessageInfo(mi)
1312+ }
1313+ return ms
1314+ }
1315+ return mi.MessageOf(x)
1316+}
1317+
1318+// Deprecated: Use IssueReopened.ProtoReflect.Descriptor instead.
1319+func (*IssueReopened) Descriptor() ([]byte, []int) {
1320+ return file_ermite_event_proto_rawDescGZIP(), []int{17}
1321+}
1322+
1323+func (x *IssueReopened) GetIssue() *Issue {
1324+ if x != nil {
1325+ return x.Issue
1326+ }
1327+ return nil
1328+}
1329+
1330+// IssueCommented reports a new comment on an issue.
1331+type IssueCommented struct {
1332+ state protoimpl.MessageState `protogen:"open.v1"`
1333+ // Repo is the name of the repository.
1334+ Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"`
1335+ // Number is the number of the issue.
1336+ Number int64 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"`
1337+ // Comment is the new comment.
1338+ Comment *IssueComment `protobuf:"bytes,3,opt,name=comment,proto3" json:"comment,omitempty"`
1339+ unknownFields protoimpl.UnknownFields
1340+ sizeCache protoimpl.SizeCache
1341+}
1342+
1343+func (x *IssueCommented) Reset() {
1344+ *x = IssueCommented{}
1345+ mi := &file_ermite_event_proto_msgTypes[18]
1346+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1347+ ms.StoreMessageInfo(mi)
1348+}
1349+
1350+func (x *IssueCommented) String() string {
1351+ return protoimpl.X.MessageStringOf(x)
1352+}
1353+
1354+func (*IssueCommented) ProtoMessage() {}
1355+
1356+func (x *IssueCommented) ProtoReflect() protoreflect.Message {
1357+ mi := &file_ermite_event_proto_msgTypes[18]
1358+ if x != nil {
1359+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1360+ if ms.LoadMessageInfo() == nil {
1361+ ms.StoreMessageInfo(mi)
1362+ }
1363+ return ms
1364+ }
1365+ return mi.MessageOf(x)
1366+}
1367+
1368+// Deprecated: Use IssueCommented.ProtoReflect.Descriptor instead.
1369+func (*IssueCommented) Descriptor() ([]byte, []int) {
1370+ return file_ermite_event_proto_rawDescGZIP(), []int{18}
1371+}
1372+
1373+func (x *IssueCommented) GetRepo() string {
1374+ if x != nil {
1375+ return x.Repo
1376+ }
1377+ return ""
1378+}
1379+
1380+func (x *IssueCommented) GetNumber() int64 {
1381+ if x != nil {
1382+ return x.Number
1383+ }
1384+ return 0
1385+}
1386+
1387+func (x *IssueCommented) GetComment() *IssueComment {
1388+ if x != nil {
1389+ return x.Comment
1390+ }
1391+ return nil
1392+}
1393+
1394+// IssueSubmitted reports an issue awaiting moderation. It is delivered only
1395+// on the "owner" topic, never on "home" or "repo:<name>". It carries no title or body: content never travels in
1396+// events, read it with IssueService.ListPendingIssues.
1397+type IssueSubmitted struct {
1398+ state protoimpl.MessageState `protogen:"open.v1"`
1399+ // Repo is the name of the repository.
1400+ Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"`
1401+ // Id is the PendingIssue.id.
1402+ Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
1403+ unknownFields protoimpl.UnknownFields
1404+ sizeCache protoimpl.SizeCache
1405+}
1406+
1407+func (x *IssueSubmitted) Reset() {
1408+ *x = IssueSubmitted{}
1409+ mi := &file_ermite_event_proto_msgTypes[19]
1410+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1411+ ms.StoreMessageInfo(mi)
1412+}
1413+
1414+func (x *IssueSubmitted) String() string {
1415+ return protoimpl.X.MessageStringOf(x)
1416+}
1417+
1418+func (*IssueSubmitted) ProtoMessage() {}
1419+
1420+func (x *IssueSubmitted) ProtoReflect() protoreflect.Message {
1421+ mi := &file_ermite_event_proto_msgTypes[19]
1422+ if x != nil {
1423+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1424+ if ms.LoadMessageInfo() == nil {
1425+ ms.StoreMessageInfo(mi)
1426+ }
1427+ return ms
1428+ }
1429+ return mi.MessageOf(x)
1430+}
1431+
1432+// Deprecated: Use IssueSubmitted.ProtoReflect.Descriptor instead.
1433+func (*IssueSubmitted) Descriptor() ([]byte, []int) {
1434+ return file_ermite_event_proto_rawDescGZIP(), []int{19}
1435+}
1436+
1437+func (x *IssueSubmitted) GetRepo() string {
1438+ if x != nil {
1439+ return x.Repo
1440+ }
1441+ return ""
1442+}
1443+
1444+func (x *IssueSubmitted) GetId() string {
1445+ if x != nil {
1446+ return x.Id
1447+ }
1448+ return ""
1449+}
1450+
10981451 // Gap tells the client that events were lost: the requested resume point is
10991452 // older than the server's buffer. It has no fields. The client should reload
11001453 // the state it displays (repositories, refs, merge requests and their
1101-// comments, CI runs and their jobs) and carry on with the next events.
1454+// comments, issues and their comments, CI runs and their jobs) and carry on
1455+// with the next events.
11021456 type Gap struct {
11031457 state protoimpl.MessageState `protogen:"open.v1"`
11041458 unknownFields protoimpl.UnknownFields
@@ -1107,7 +1461,7 @@ type Gap struct {
11071461
11081462 func (x *Gap) Reset() {
11091463 *x = Gap{}
1110- mi := &file_ermite_event_proto_msgTypes[15]
1464+ mi := &file_ermite_event_proto_msgTypes[20]
11111465 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
11121466 ms.StoreMessageInfo(mi)
11131467 }
@@ -1119,7 +1473,7 @@ func (x *Gap) String() string {
11191473 func (*Gap) ProtoMessage() {}
11201474
11211475 func (x *Gap) ProtoReflect() protoreflect.Message {
1122- mi := &file_ermite_event_proto_msgTypes[15]
1476+ mi := &file_ermite_event_proto_msgTypes[20]
11231477 if x != nil {
11241478 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
11251479 if ms.LoadMessageInfo() == nil {
@@ -1132,7 +1486,7 @@ func (x *Gap) ProtoReflect() protoreflect.Message {
11321486
11331487 // Deprecated: Use Gap.ProtoReflect.Descriptor instead.
11341488 func (*Gap) Descriptor() ([]byte, []int) {
1135- return file_ermite_event_proto_rawDescGZIP(), []int{15}
1489+ return file_ermite_event_proto_rawDescGZIP(), []int{20}
11361490 }
11371491
11381492 // RunUpdated reports a CI run that was created or whose status, conclusion or
@@ -1147,7 +1501,7 @@ type RunUpdated struct {
11471501
11481502 func (x *RunUpdated) Reset() {
11491503 *x = RunUpdated{}
1150- mi := &file_ermite_event_proto_msgTypes[16]
1504+ mi := &file_ermite_event_proto_msgTypes[21]
11511505 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
11521506 ms.StoreMessageInfo(mi)
11531507 }
@@ -1159,7 +1513,7 @@ func (x *RunUpdated) String() string {
11591513 func (*RunUpdated) ProtoMessage() {}
11601514
11611515 func (x *RunUpdated) ProtoReflect() protoreflect.Message {
1162- mi := &file_ermite_event_proto_msgTypes[16]
1516+ mi := &file_ermite_event_proto_msgTypes[21]
11631517 if x != nil {
11641518 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
11651519 if ms.LoadMessageInfo() == nil {
@@ -1172,7 +1526,7 @@ func (x *RunUpdated) ProtoReflect() protoreflect.Message {
11721526
11731527 // Deprecated: Use RunUpdated.ProtoReflect.Descriptor instead.
11741528 func (*RunUpdated) Descriptor() ([]byte, []int) {
1175- return file_ermite_event_proto_rawDescGZIP(), []int{16}
1529+ return file_ermite_event_proto_rawDescGZIP(), []int{21}
11761530 }
11771531
11781532 func (x *RunUpdated) GetRun() *Run {
@@ -1194,7 +1548,7 @@ type JobUpdated struct {
11941548
11951549 func (x *JobUpdated) Reset() {
11961550 *x = JobUpdated{}
1197- mi := &file_ermite_event_proto_msgTypes[17]
1551+ mi := &file_ermite_event_proto_msgTypes[22]
11981552 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
11991553 ms.StoreMessageInfo(mi)
12001554 }
@@ -1206,7 +1560,7 @@ func (x *JobUpdated) String() string {
12061560 func (*JobUpdated) ProtoMessage() {}
12071561
12081562 func (x *JobUpdated) ProtoReflect() protoreflect.Message {
1209- mi := &file_ermite_event_proto_msgTypes[17]
1563+ mi := &file_ermite_event_proto_msgTypes[22]
12101564 if x != nil {
12111565 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
12121566 if ms.LoadMessageInfo() == nil {
@@ -1219,7 +1573,7 @@ func (x *JobUpdated) ProtoReflect() protoreflect.Message {
12191573
12201574 // Deprecated: Use JobUpdated.ProtoReflect.Descriptor instead.
12211575 func (*JobUpdated) Descriptor() ([]byte, []int) {
1222- return file_ermite_event_proto_rawDescGZIP(), []int{17}
1576+ return file_ermite_event_proto_rawDescGZIP(), []int{22}
12231577 }
12241578
12251579 func (x *JobUpdated) GetJob() *RunJob {
@@ -1233,12 +1587,12 @@ var File_ermite_event_proto protoreflect.FileDescriptor
12331587
12341588 const file_ermite_event_proto_rawDesc = "" +
12351589 "\n" +
1236- "\x12ermite/event.proto\x12\x06ermite\x1a\x1aermite/merge_request.proto\x1a\x11ermite/repo.proto\x1a\x10ermite/run.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"I\n" +
1590+ "\x12ermite/event.proto\x12\x06ermite\x1a\x12ermite/issue.proto\x1a\x1aermite/merge_request.proto\x1a\x11ermite/repo.proto\x1a\x10ermite/run.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"I\n" +
12371591 "\fWatchRequest\x12\x16\n" +
12381592 "\x06topics\x18\x01 \x03(\tR\x06topics\x12!\n" +
12391593 "\fresume_after\x18\x02 \x01(\tR\vresumeAfter\"4\n" +
12401594 "\rWatchResponse\x12#\n" +
1241- "\x05event\x18\x01 \x01(\v2\r.ermite.EventR\x05event\"\xac\a\n" +
1595+ "\x05event\x18\x01 \x01(\v2\r.ermite.EventR\x05event\"\xe6\t\n" +
12421596 "\x05Event\x12\x0e\n" +
12431597 "\x02id\x18\x01 \x01(\tR\x02id\x12.\n" +
12441598 "\x04time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x04time\x128\n" +
@@ -1258,7 +1612,12 @@ const file_ermite_event_proto_rawDesc = "" +
12581612 "jobUpdated\x12>\n" +
12591613 "\x0ecomment_edited\x18\x0e \x01(\v2\x15.ermite.CommentEditedH\x00R\rcommentEdited\x12A\n" +
12601614 "\x0fcomment_deleted\x18\x0f \x01(\v2\x16.ermite.CommentDeletedH\x00R\x0ecommentDeleted\x12D\n" +
1261- "\x10comment_resolved\x18\x10 \x01(\v2\x17.ermite.CommentResolvedH\x00R\x0fcommentResolvedB\x06\n" +
1615+ "\x10comment_resolved\x18\x10 \x01(\v2\x17.ermite.CommentResolvedH\x00R\x0fcommentResolved\x128\n" +
1616+ "\fissue_opened\x18\x11 \x01(\v2\x13.ermite.IssueOpenedH\x00R\vissueOpened\x128\n" +
1617+ "\fissue_closed\x18\x12 \x01(\v2\x13.ermite.IssueClosedH\x00R\vissueClosed\x12>\n" +
1618+ "\x0eissue_reopened\x18\x13 \x01(\v2\x15.ermite.IssueReopenedH\x00R\rissueReopened\x12A\n" +
1619+ "\x0fissue_commented\x18\x14 \x01(\v2\x16.ermite.IssueCommentedH\x00R\x0eissueCommented\x12A\n" +
1620+ "\x0fissue_submitted\x18\x15 \x01(\v2\x16.ermite.IssueSubmittedH\x00R\x0eissueSubmittedB\x06\n" +
12621621 "\x04kind\"/\n" +
12631622 "\vRepoCreated\x12 \n" +
12641623 "\x04repo\x18\x01 \x01(\v2\f.ermite.RepoR\x04repo\"/\n" +
@@ -1295,7 +1654,20 @@ const file_ermite_event_proto_rawDesc = "" +
12951654 "\x0fCommentResolved\x12\x12\n" +
12961655 "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x16\n" +
12971656 "\x06number\x18\x02 \x01(\x03R\x06number\x12)\n" +
1298- "\acomment\x18\x03 \x01(\v2\x0f.ermite.CommentR\acomment\"\x05\n" +
1657+ "\acomment\x18\x03 \x01(\v2\x0f.ermite.CommentR\acomment\"2\n" +
1658+ "\vIssueOpened\x12#\n" +
1659+ "\x05issue\x18\x01 \x01(\v2\r.ermite.IssueR\x05issue\"2\n" +
1660+ "\vIssueClosed\x12#\n" +
1661+ "\x05issue\x18\x01 \x01(\v2\r.ermite.IssueR\x05issue\"4\n" +
1662+ "\rIssueReopened\x12#\n" +
1663+ "\x05issue\x18\x01 \x01(\v2\r.ermite.IssueR\x05issue\"l\n" +
1664+ "\x0eIssueCommented\x12\x12\n" +
1665+ "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x16\n" +
1666+ "\x06number\x18\x02 \x01(\x03R\x06number\x12.\n" +
1667+ "\acomment\x18\x03 \x01(\v2\x14.ermite.IssueCommentR\acomment\"4\n" +
1668+ "\x0eIssueSubmitted\x12\x12\n" +
1669+ "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x0e\n" +
1670+ "\x02id\x18\x02 \x01(\tR\x02id\"\x05\n" +
12991671 "\x03Gap\"+\n" +
13001672 "\n" +
13011673 "RunUpdated\x12\x1d\n" +
@@ -1321,7 +1693,7 @@ func file_ermite_event_proto_rawDescGZIP() []byte {
13211693 return file_ermite_event_proto_rawDescData
13221694 }
13231695
1324-var file_ermite_event_proto_msgTypes = make([]protoimpl.MessageInfo, 18)
1696+var file_ermite_event_proto_msgTypes = make([]protoimpl.MessageInfo, 23)
13251697 var file_ermite_event_proto_goTypes = []any{
13261698 (*WatchRequest)(nil), // 0: ermite.WatchRequest
13271699 (*WatchResponse)(nil), // 1: ermite.WatchResponse
@@ -1338,52 +1710,68 @@ var file_ermite_event_proto_goTypes = []any{
13381710 (*CommentEdited)(nil), // 12: ermite.CommentEdited
13391711 (*CommentDeleted)(nil), // 13: ermite.CommentDeleted
13401712 (*CommentResolved)(nil), // 14: ermite.CommentResolved
1341- (*Gap)(nil), // 15: ermite.Gap
1342- (*RunUpdated)(nil), // 16: ermite.RunUpdated
1343- (*JobUpdated)(nil), // 17: ermite.JobUpdated
1344- (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp
1345- (*Repo)(nil), // 19: ermite.Repo
1346- (*MergeRequest)(nil), // 20: ermite.MergeRequest
1347- (*Comment)(nil), // 21: ermite.Comment
1348- (*Run)(nil), // 22: ermite.Run
1349- (*RunJob)(nil), // 23: ermite.RunJob
1713+ (*IssueOpened)(nil), // 15: ermite.IssueOpened
1714+ (*IssueClosed)(nil), // 16: ermite.IssueClosed
1715+ (*IssueReopened)(nil), // 17: ermite.IssueReopened
1716+ (*IssueCommented)(nil), // 18: ermite.IssueCommented
1717+ (*IssueSubmitted)(nil), // 19: ermite.IssueSubmitted
1718+ (*Gap)(nil), // 20: ermite.Gap
1719+ (*RunUpdated)(nil), // 21: ermite.RunUpdated
1720+ (*JobUpdated)(nil), // 22: ermite.JobUpdated
1721+ (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp
1722+ (*Repo)(nil), // 24: ermite.Repo
1723+ (*MergeRequest)(nil), // 25: ermite.MergeRequest
1724+ (*Comment)(nil), // 26: ermite.Comment
1725+ (*Issue)(nil), // 27: ermite.Issue
1726+ (*IssueComment)(nil), // 28: ermite.IssueComment
1727+ (*Run)(nil), // 29: ermite.Run
1728+ (*RunJob)(nil), // 30: ermite.RunJob
13501729 }
13511730 var file_ermite_event_proto_depIdxs = []int32{
13521731 2, // 0: ermite.WatchResponse.event:type_name -> ermite.Event
1353- 18, // 1: ermite.Event.time:type_name -> google.protobuf.Timestamp
1732+ 23, // 1: ermite.Event.time:type_name -> google.protobuf.Timestamp
13541733 3, // 2: ermite.Event.repo_created:type_name -> ermite.RepoCreated
13551734 4, // 3: ermite.Event.repo_updated:type_name -> ermite.RepoUpdated
13561735 5, // 4: ermite.Event.repo_deleted:type_name -> ermite.RepoDeleted
13571736 6, // 5: ermite.Event.pushed:type_name -> ermite.Pushed
1358- 15, // 6: ermite.Event.gap:type_name -> ermite.Gap
1737+ 20, // 6: ermite.Event.gap:type_name -> ermite.Gap
13591738 8, // 7: ermite.Event.merge_request_opened:type_name -> ermite.MergeRequestOpened
13601739 9, // 8: ermite.Event.merge_request_merged:type_name -> ermite.MergeRequestMerged
13611740 10, // 9: ermite.Event.merge_request_closed:type_name -> ermite.MergeRequestClosed
13621741 11, // 10: ermite.Event.comment_added:type_name -> ermite.CommentAdded
1363- 16, // 11: ermite.Event.run_updated:type_name -> ermite.RunUpdated
1364- 17, // 12: ermite.Event.job_updated:type_name -> ermite.JobUpdated
1742+ 21, // 11: ermite.Event.run_updated:type_name -> ermite.RunUpdated
1743+ 22, // 12: ermite.Event.job_updated:type_name -> ermite.JobUpdated
13651744 12, // 13: ermite.Event.comment_edited:type_name -> ermite.CommentEdited
13661745 13, // 14: ermite.Event.comment_deleted:type_name -> ermite.CommentDeleted
13671746 14, // 15: ermite.Event.comment_resolved:type_name -> ermite.CommentResolved
1368- 19, // 16: ermite.RepoCreated.repo:type_name -> ermite.Repo
1369- 19, // 17: ermite.RepoUpdated.repo:type_name -> ermite.Repo
1370- 7, // 18: ermite.Pushed.ref_updates:type_name -> ermite.RefUpdate
1371- 20, // 19: ermite.MergeRequestOpened.merge_request:type_name -> ermite.MergeRequest
1372- 20, // 20: ermite.MergeRequestMerged.merge_request:type_name -> ermite.MergeRequest
1373- 20, // 21: ermite.MergeRequestClosed.merge_request:type_name -> ermite.MergeRequest
1374- 21, // 22: ermite.CommentAdded.comment:type_name -> ermite.Comment
1375- 21, // 23: ermite.CommentEdited.comment:type_name -> ermite.Comment
1376- 21, // 24: ermite.CommentDeleted.comment:type_name -> ermite.Comment
1377- 21, // 25: ermite.CommentResolved.comment:type_name -> ermite.Comment
1378- 22, // 26: ermite.RunUpdated.run:type_name -> ermite.Run
1379- 23, // 27: ermite.JobUpdated.job:type_name -> ermite.RunJob
1380- 0, // 28: ermite.EventService.Watch:input_type -> ermite.WatchRequest
1381- 1, // 29: ermite.EventService.Watch:output_type -> ermite.WatchResponse
1382- 29, // [29:30] is the sub-list for method output_type
1383- 28, // [28:29] is the sub-list for method input_type
1384- 28, // [28:28] is the sub-list for extension type_name
1385- 28, // [28:28] is the sub-list for extension extendee
1386- 0, // [0:28] is the sub-list for field type_name
1747+ 15, // 16: ermite.Event.issue_opened:type_name -> ermite.IssueOpened
1748+ 16, // 17: ermite.Event.issue_closed:type_name -> ermite.IssueClosed
1749+ 17, // 18: ermite.Event.issue_reopened:type_name -> ermite.IssueReopened
1750+ 18, // 19: ermite.Event.issue_commented:type_name -> ermite.IssueCommented
1751+ 19, // 20: ermite.Event.issue_submitted:type_name -> ermite.IssueSubmitted
1752+ 24, // 21: ermite.RepoCreated.repo:type_name -> ermite.Repo
1753+ 24, // 22: ermite.RepoUpdated.repo:type_name -> ermite.Repo
1754+ 7, // 23: ermite.Pushed.ref_updates:type_name -> ermite.RefUpdate
1755+ 25, // 24: ermite.MergeRequestOpened.merge_request:type_name -> ermite.MergeRequest
1756+ 25, // 25: ermite.MergeRequestMerged.merge_request:type_name -> ermite.MergeRequest
1757+ 25, // 26: ermite.MergeRequestClosed.merge_request:type_name -> ermite.MergeRequest
1758+ 26, // 27: ermite.CommentAdded.comment:type_name -> ermite.Comment
1759+ 26, // 28: ermite.CommentEdited.comment:type_name -> ermite.Comment
1760+ 26, // 29: ermite.CommentDeleted.comment:type_name -> ermite.Comment
1761+ 26, // 30: ermite.CommentResolved.comment:type_name -> ermite.Comment
1762+ 27, // 31: ermite.IssueOpened.issue:type_name -> ermite.Issue
1763+ 27, // 32: ermite.IssueClosed.issue:type_name -> ermite.Issue
1764+ 27, // 33: ermite.IssueReopened.issue:type_name -> ermite.Issue
1765+ 28, // 34: ermite.IssueCommented.comment:type_name -> ermite.IssueComment
1766+ 29, // 35: ermite.RunUpdated.run:type_name -> ermite.Run
1767+ 30, // 36: ermite.JobUpdated.job:type_name -> ermite.RunJob
1768+ 0, // 37: ermite.EventService.Watch:input_type -> ermite.WatchRequest
1769+ 1, // 38: ermite.EventService.Watch:output_type -> ermite.WatchResponse
1770+ 38, // [38:39] is the sub-list for method output_type
1771+ 37, // [37:38] is the sub-list for method input_type
1772+ 37, // [37:37] is the sub-list for extension type_name
1773+ 37, // [37:37] is the sub-list for extension extendee
1774+ 0, // [0:37] is the sub-list for field type_name
13871775 }
13881776
13891777 func init() { file_ermite_event_proto_init() }
@@ -1391,6 +1779,7 @@ func file_ermite_event_proto_init() {
13911779 if File_ermite_event_proto != nil {
13921780 return
13931781 }
1782+ file_ermite_issue_proto_init()
13941783 file_ermite_merge_request_proto_init()
13951784 file_ermite_repo_proto_init()
13961785 file_ermite_run_proto_init()
@@ -1409,6 +1798,11 @@ func file_ermite_event_proto_init() {
14091798 (*Event_CommentEdited)(nil),
14101799 (*Event_CommentDeleted)(nil),
14111800 (*Event_CommentResolved)(nil),
1801+ (*Event_IssueOpened)(nil),
1802+ (*Event_IssueClosed)(nil),
1803+ (*Event_IssueReopened)(nil),
1804+ (*Event_IssueCommented)(nil),
1805+ (*Event_IssueSubmitted)(nil),
14121806 }
14131807 type x struct{}
14141808 out := protoimpl.TypeBuilder{
@@ -1416,7 +1810,7 @@ func file_ermite_event_proto_init() {
14161810 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
14171811 RawDescriptor: unsafe.Slice(unsafe.StringData(file_ermite_event_proto_rawDesc), len(file_ermite_event_proto_rawDesc)),
14181812 NumEnums: 0,
1419- NumMessages: 18,
1813+ NumMessages: 23,
14201814 NumExtensions: 0,
14211815 NumServices: 1,
14221816 },
@@ -28,9 +28,17 @@ const (
28 type WatchRequest struct {28 type WatchRequest struct {
29 state protoimpl.MessageState `protogen:"open.v1"`29 state protoimpl.MessageState `protogen:"open.v1"`
30 // Topics are the subjects to follow: "home" for every repository visible to30 // Topics are the subjects to follow: "home" for every repository visible to
31- // the caller, or "repo:<name>" for one repository. Empty means "home".31+ // the caller, "repo:<name>" for one repository, or "owner". Empty means
32- // Unknown topics are invalid_argument. A "repo:<name>" topic for a repository32+ // "home". Unknown topics are invalid_argument. A "repo:<name>" topic for a
33- // that does not exist or is not visible is not_found.33+ // repository that does not exist or is not visible is not_found.
34+ //
35+ // The "owner" topic needs owner rights: root, an owner session, or a token
36+ // that holds every scope with no repository or branch limit. Anyone else
37+ // gets the same invalid_argument as for an unknown topic, so the topic is
38+ // not revealed. It carries the merge request and issue events of every
39+ // repository (merge_request_opened, merge_request_merged,
40+ // merge_request_closed, comment_added, and the issue events), repo_updated
41+ // and repo_deleted, plus issue_submitted, which is delivered nowhere else.
34 Topics []string `protobuf:"bytes,1,rep,name=topics,proto3" json:"topics,omitempty"`42 Topics []string `protobuf:"bytes,1,rep,name=topics,proto3" json:"topics,omitempty"`
35 // ResumeAfter is the Event.id of the last event the client has seen. Empty43 // ResumeAfter is the Event.id of the last event the client has seen. Empty
36 // to receive only new events.44 // to receive only new events.
@@ -157,6 +165,11 @@ type Event struct {
157 // *Event_CommentEdited165 // *Event_CommentEdited
158 // *Event_CommentDeleted166 // *Event_CommentDeleted
159 // *Event_CommentResolved167 // *Event_CommentResolved
168+ // *Event_IssueOpened
169+ // *Event_IssueClosed
170+ // *Event_IssueReopened
171+ // *Event_IssueCommented
172+ // *Event_IssueSubmitted
160 Kind isEvent_Kind `protobuf_oneof:"kind"`173 Kind isEvent_Kind `protobuf_oneof:"kind"`
161 unknownFields protoimpl.UnknownFields174 unknownFields protoimpl.UnknownFields
162 sizeCache protoimpl.SizeCache175 sizeCache protoimpl.SizeCache
@@ -339,6 +352,51 @@ func (x *Event) GetCommentResolved() *CommentResolved {
339 return nil352 return nil
340 }353 }
341 354
355+func (x *Event) GetIssueOpened() *IssueOpened {
356+ if x != nil {
357+ if x, ok := x.Kind.(*Event_IssueOpened); ok {
358+ return x.IssueOpened
359+ }
360+ }
361+ return nil
362+}
363+
364+func (x *Event) GetIssueClosed() *IssueClosed {
365+ if x != nil {
366+ if x, ok := x.Kind.(*Event_IssueClosed); ok {
367+ return x.IssueClosed
368+ }
369+ }
370+ return nil
371+}
372+
373+func (x *Event) GetIssueReopened() *IssueReopened {
374+ if x != nil {
375+ if x, ok := x.Kind.(*Event_IssueReopened); ok {
376+ return x.IssueReopened
377+ }
378+ }
379+ return nil
380+}
381+
382+func (x *Event) GetIssueCommented() *IssueCommented {
383+ if x != nil {
384+ if x, ok := x.Kind.(*Event_IssueCommented); ok {
385+ return x.IssueCommented
386+ }
387+ }
388+ return nil
389+}
390+
391+func (x *Event) GetIssueSubmitted() *IssueSubmitted {
392+ if x != nil {
393+ if x, ok := x.Kind.(*Event_IssueSubmitted); ok {
394+ return x.IssueSubmitted
395+ }
396+ }
397+ return nil
398+}
399+
342 type isEvent_Kind interface {400 type isEvent_Kind interface {
343 isEvent_Kind()401 isEvent_Kind()
344 }402 }
@@ -413,6 +471,32 @@ type Event_CommentResolved struct {
413 CommentResolved *CommentResolved `protobuf:"bytes,16,opt,name=comment_resolved,json=commentResolved,proto3,oneof"`471 CommentResolved *CommentResolved `protobuf:"bytes,16,opt,name=comment_resolved,json=commentResolved,proto3,oneof"`
414 }472 }
415 473
474+type Event_IssueOpened struct {
475+ // IssueOpened: an issue was opened.
476+ IssueOpened *IssueOpened `protobuf:"bytes,17,opt,name=issue_opened,json=issueOpened,proto3,oneof"`
477+}
478+
479+type Event_IssueClosed struct {
480+ // IssueClosed: an issue was closed.
481+ IssueClosed *IssueClosed `protobuf:"bytes,18,opt,name=issue_closed,json=issueClosed,proto3,oneof"`
482+}
483+
484+type Event_IssueReopened struct {
485+ // IssueReopened: an issue was reopened.
486+ IssueReopened *IssueReopened `protobuf:"bytes,19,opt,name=issue_reopened,json=issueReopened,proto3,oneof"`
487+}
488+
489+type Event_IssueCommented struct {
490+ // IssueCommented: a comment was added to an issue.
491+ IssueCommented *IssueCommented `protobuf:"bytes,20,opt,name=issue_commented,json=issueCommented,proto3,oneof"`
492+}
493+
494+type Event_IssueSubmitted struct {
495+ // IssueSubmitted: an issue is awaiting moderation. Delivered only on the
496+ // "owner" topic, never on "home" or "repo:<name>", and carries no content.
497+ IssueSubmitted *IssueSubmitted `protobuf:"bytes,21,opt,name=issue_submitted,json=issueSubmitted,proto3,oneof"`
498+}
499+
416 func (*Event_RepoCreated) isEvent_Kind() {}500 func (*Event_RepoCreated) isEvent_Kind() {}
417 501
418 func (*Event_RepoUpdated) isEvent_Kind() {}502 func (*Event_RepoUpdated) isEvent_Kind() {}
@@ -441,6 +525,16 @@ func (*Event_CommentDeleted) isEvent_Kind() {}
441 525
442 func (*Event_CommentResolved) isEvent_Kind() {}526 func (*Event_CommentResolved) isEvent_Kind() {}
443 527
528+func (*Event_IssueOpened) isEvent_Kind() {}
529+
530+func (*Event_IssueClosed) isEvent_Kind() {}
531+
532+func (*Event_IssueReopened) isEvent_Kind() {}
533+
534+func (*Event_IssueCommented) isEvent_Kind() {}
535+
536+func (*Event_IssueSubmitted) isEvent_Kind() {}
537+
444 // RepoCreated reports a new repository.538 // RepoCreated reports a new repository.
445 type RepoCreated struct {539 type RepoCreated struct {
446 state protoimpl.MessageState `protogen:"open.v1"`540 state protoimpl.MessageState `protogen:"open.v1"`
@@ -1095,10 +1189,270 @@ func (x *CommentResolved) GetComment() *Comment {
1095 return nil1189 return nil
1096 }1190 }
1097 1191
1192+// IssueOpened reports a new issue.
1193+type IssueOpened struct {
1194+ state protoimpl.MessageState `protogen:"open.v1"`
1195+ // Issue is the new issue, including its repository and number.
1196+ Issue *Issue `protobuf:"bytes,1,opt,name=issue,proto3" json:"issue,omitempty"`
1197+ unknownFields protoimpl.UnknownFields
1198+ sizeCache protoimpl.SizeCache
1199+}
1200+
1201+func (x *IssueOpened) Reset() {
1202+ *x = IssueOpened{}
1203+ mi := &file_ermite_event_proto_msgTypes[15]
1204+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1205+ ms.StoreMessageInfo(mi)
1206+}
1207+
1208+func (x *IssueOpened) String() string {
1209+ return protoimpl.X.MessageStringOf(x)
1210+}
1211+
1212+func (*IssueOpened) ProtoMessage() {}
1213+
1214+func (x *IssueOpened) ProtoReflect() protoreflect.Message {
1215+ mi := &file_ermite_event_proto_msgTypes[15]
1216+ if x != nil {
1217+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1218+ if ms.LoadMessageInfo() == nil {
1219+ ms.StoreMessageInfo(mi)
1220+ }
1221+ return ms
1222+ }
1223+ return mi.MessageOf(x)
1224+}
1225+
1226+// Deprecated: Use IssueOpened.ProtoReflect.Descriptor instead.
1227+func (*IssueOpened) Descriptor() ([]byte, []int) {
1228+ return file_ermite_event_proto_rawDescGZIP(), []int{15}
1229+}
1230+
1231+func (x *IssueOpened) GetIssue() *Issue {
1232+ if x != nil {
1233+ return x.Issue
1234+ }
1235+ return nil
1236+}
1237+
1238+// IssueClosed reports a closed issue.
1239+type IssueClosed struct {
1240+ state protoimpl.MessageState `protogen:"open.v1"`
1241+ // Issue is the issue after closing, including its repository and number.
1242+ Issue *Issue `protobuf:"bytes,1,opt,name=issue,proto3" json:"issue,omitempty"`
1243+ unknownFields protoimpl.UnknownFields
1244+ sizeCache protoimpl.SizeCache
1245+}
1246+
1247+func (x *IssueClosed) Reset() {
1248+ *x = IssueClosed{}
1249+ mi := &file_ermite_event_proto_msgTypes[16]
1250+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1251+ ms.StoreMessageInfo(mi)
1252+}
1253+
1254+func (x *IssueClosed) String() string {
1255+ return protoimpl.X.MessageStringOf(x)
1256+}
1257+
1258+func (*IssueClosed) ProtoMessage() {}
1259+
1260+func (x *IssueClosed) ProtoReflect() protoreflect.Message {
1261+ mi := &file_ermite_event_proto_msgTypes[16]
1262+ if x != nil {
1263+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1264+ if ms.LoadMessageInfo() == nil {
1265+ ms.StoreMessageInfo(mi)
1266+ }
1267+ return ms
1268+ }
1269+ return mi.MessageOf(x)
1270+}
1271+
1272+// Deprecated: Use IssueClosed.ProtoReflect.Descriptor instead.
1273+func (*IssueClosed) Descriptor() ([]byte, []int) {
1274+ return file_ermite_event_proto_rawDescGZIP(), []int{16}
1275+}
1276+
1277+func (x *IssueClosed) GetIssue() *Issue {
1278+ if x != nil {
1279+ return x.Issue
1280+ }
1281+ return nil
1282+}
1283+
1284+// IssueReopened reports a reopened issue.
1285+type IssueReopened struct {
1286+ state protoimpl.MessageState `protogen:"open.v1"`
1287+ // Issue is the issue after reopening, including its repository and number.
1288+ Issue *Issue `protobuf:"bytes,1,opt,name=issue,proto3" json:"issue,omitempty"`
1289+ unknownFields protoimpl.UnknownFields
1290+ sizeCache protoimpl.SizeCache
1291+}
1292+
1293+func (x *IssueReopened) Reset() {
1294+ *x = IssueReopened{}
1295+ mi := &file_ermite_event_proto_msgTypes[17]
1296+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1297+ ms.StoreMessageInfo(mi)
1298+}
1299+
1300+func (x *IssueReopened) String() string {
1301+ return protoimpl.X.MessageStringOf(x)
1302+}
1303+
1304+func (*IssueReopened) ProtoMessage() {}
1305+
1306+func (x *IssueReopened) ProtoReflect() protoreflect.Message {
1307+ mi := &file_ermite_event_proto_msgTypes[17]
1308+ if x != nil {
1309+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1310+ if ms.LoadMessageInfo() == nil {
1311+ ms.StoreMessageInfo(mi)
1312+ }
1313+ return ms
1314+ }
1315+ return mi.MessageOf(x)
1316+}
1317+
1318+// Deprecated: Use IssueReopened.ProtoReflect.Descriptor instead.
1319+func (*IssueReopened) Descriptor() ([]byte, []int) {
1320+ return file_ermite_event_proto_rawDescGZIP(), []int{17}
1321+}
1322+
1323+func (x *IssueReopened) GetIssue() *Issue {
1324+ if x != nil {
1325+ return x.Issue
1326+ }
1327+ return nil
1328+}
1329+
1330+// IssueCommented reports a new comment on an issue.
1331+type IssueCommented struct {
1332+ state protoimpl.MessageState `protogen:"open.v1"`
1333+ // Repo is the name of the repository.
1334+ Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"`
1335+ // Number is the number of the issue.
1336+ Number int64 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"`
1337+ // Comment is the new comment.
1338+ Comment *IssueComment `protobuf:"bytes,3,opt,name=comment,proto3" json:"comment,omitempty"`
1339+ unknownFields protoimpl.UnknownFields
1340+ sizeCache protoimpl.SizeCache
1341+}
1342+
1343+func (x *IssueCommented) Reset() {
1344+ *x = IssueCommented{}
1345+ mi := &file_ermite_event_proto_msgTypes[18]
1346+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1347+ ms.StoreMessageInfo(mi)
1348+}
1349+
1350+func (x *IssueCommented) String() string {
1351+ return protoimpl.X.MessageStringOf(x)
1352+}
1353+
1354+func (*IssueCommented) ProtoMessage() {}
1355+
1356+func (x *IssueCommented) ProtoReflect() protoreflect.Message {
1357+ mi := &file_ermite_event_proto_msgTypes[18]
1358+ if x != nil {
1359+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1360+ if ms.LoadMessageInfo() == nil {
1361+ ms.StoreMessageInfo(mi)
1362+ }
1363+ return ms
1364+ }
1365+ return mi.MessageOf(x)
1366+}
1367+
1368+// Deprecated: Use IssueCommented.ProtoReflect.Descriptor instead.
1369+func (*IssueCommented) Descriptor() ([]byte, []int) {
1370+ return file_ermite_event_proto_rawDescGZIP(), []int{18}
1371+}
1372+
1373+func (x *IssueCommented) GetRepo() string {
1374+ if x != nil {
1375+ return x.Repo
1376+ }
1377+ return ""
1378+}
1379+
1380+func (x *IssueCommented) GetNumber() int64 {
1381+ if x != nil {
1382+ return x.Number
1383+ }
1384+ return 0
1385+}
1386+
1387+func (x *IssueCommented) GetComment() *IssueComment {
1388+ if x != nil {
1389+ return x.Comment
1390+ }
1391+ return nil
1392+}
1393+
1394+// IssueSubmitted reports an issue awaiting moderation. It is delivered only
1395+// on the "owner" topic, never on "home" or "repo:<name>". It carries no title or body: content never travels in
1396+// events, read it with IssueService.ListPendingIssues.
1397+type IssueSubmitted struct {
1398+ state protoimpl.MessageState `protogen:"open.v1"`
1399+ // Repo is the name of the repository.
1400+ Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"`
1401+ // Id is the PendingIssue.id.
1402+ Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
1403+ unknownFields protoimpl.UnknownFields
1404+ sizeCache protoimpl.SizeCache
1405+}
1406+
1407+func (x *IssueSubmitted) Reset() {
1408+ *x = IssueSubmitted{}
1409+ mi := &file_ermite_event_proto_msgTypes[19]
1410+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1411+ ms.StoreMessageInfo(mi)
1412+}
1413+
1414+func (x *IssueSubmitted) String() string {
1415+ return protoimpl.X.MessageStringOf(x)
1416+}
1417+
1418+func (*IssueSubmitted) ProtoMessage() {}
1419+
1420+func (x *IssueSubmitted) ProtoReflect() protoreflect.Message {
1421+ mi := &file_ermite_event_proto_msgTypes[19]
1422+ if x != nil {
1423+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1424+ if ms.LoadMessageInfo() == nil {
1425+ ms.StoreMessageInfo(mi)
1426+ }
1427+ return ms
1428+ }
1429+ return mi.MessageOf(x)
1430+}
1431+
1432+// Deprecated: Use IssueSubmitted.ProtoReflect.Descriptor instead.
1433+func (*IssueSubmitted) Descriptor() ([]byte, []int) {
1434+ return file_ermite_event_proto_rawDescGZIP(), []int{19}
1435+}
1436+
1437+func (x *IssueSubmitted) GetRepo() string {
1438+ if x != nil {
1439+ return x.Repo
1440+ }
1441+ return ""
1442+}
1443+
1444+func (x *IssueSubmitted) GetId() string {
1445+ if x != nil {
1446+ return x.Id
1447+ }
1448+ return ""
1449+}
1450+
1098 // Gap tells the client that events were lost: the requested resume point is1451 // Gap tells the client that events were lost: the requested resume point is
1099 // older than the server's buffer. It has no fields. The client should reload1452 // older than the server's buffer. It has no fields. The client should reload
1100 // the state it displays (repositories, refs, merge requests and their1453 // the state it displays (repositories, refs, merge requests and their
1101-// comments, CI runs and their jobs) and carry on with the next events.1454+// comments, issues and their comments, CI runs and their jobs) and carry on
1455+// with the next events.
1102 type Gap struct {1456 type Gap struct {
1103 state protoimpl.MessageState `protogen:"open.v1"`1457 state protoimpl.MessageState `protogen:"open.v1"`
1104 unknownFields protoimpl.UnknownFields1458 unknownFields protoimpl.UnknownFields
@@ -1107,7 +1461,7 @@ type Gap struct {
1107 1461
1108 func (x *Gap) Reset() {1462 func (x *Gap) Reset() {
1109 *x = Gap{}1463 *x = Gap{}
1110- mi := &file_ermite_event_proto_msgTypes[15]1464+ mi := &file_ermite_event_proto_msgTypes[20]
1111 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))1465 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1112 ms.StoreMessageInfo(mi)1466 ms.StoreMessageInfo(mi)
1113 }1467 }
@@ -1119,7 +1473,7 @@ func (x *Gap) String() string {
1119 func (*Gap) ProtoMessage() {}1473 func (*Gap) ProtoMessage() {}
1120 1474
1121 func (x *Gap) ProtoReflect() protoreflect.Message {1475 func (x *Gap) ProtoReflect() protoreflect.Message {
1122- mi := &file_ermite_event_proto_msgTypes[15]1476+ mi := &file_ermite_event_proto_msgTypes[20]
1123 if x != nil {1477 if x != nil {
1124 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))1478 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1125 if ms.LoadMessageInfo() == nil {1479 if ms.LoadMessageInfo() == nil {
@@ -1132,7 +1486,7 @@ func (x *Gap) ProtoReflect() protoreflect.Message {
1132 1486
1133 // Deprecated: Use Gap.ProtoReflect.Descriptor instead.1487 // Deprecated: Use Gap.ProtoReflect.Descriptor instead.
1134 func (*Gap) Descriptor() ([]byte, []int) {1488 func (*Gap) Descriptor() ([]byte, []int) {
1135- return file_ermite_event_proto_rawDescGZIP(), []int{15}1489+ return file_ermite_event_proto_rawDescGZIP(), []int{20}
1136 }1490 }
1137 1491
1138 // RunUpdated reports a CI run that was created or whose status, conclusion or1492 // RunUpdated reports a CI run that was created or whose status, conclusion or
@@ -1147,7 +1501,7 @@ type RunUpdated struct {
1147 1501
1148 func (x *RunUpdated) Reset() {1502 func (x *RunUpdated) Reset() {
1149 *x = RunUpdated{}1503 *x = RunUpdated{}
1150- mi := &file_ermite_event_proto_msgTypes[16]1504+ mi := &file_ermite_event_proto_msgTypes[21]
1151 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))1505 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1152 ms.StoreMessageInfo(mi)1506 ms.StoreMessageInfo(mi)
1153 }1507 }
@@ -1159,7 +1513,7 @@ func (x *RunUpdated) String() string {
1159 func (*RunUpdated) ProtoMessage() {}1513 func (*RunUpdated) ProtoMessage() {}
1160 1514
1161 func (x *RunUpdated) ProtoReflect() protoreflect.Message {1515 func (x *RunUpdated) ProtoReflect() protoreflect.Message {
1162- mi := &file_ermite_event_proto_msgTypes[16]1516+ mi := &file_ermite_event_proto_msgTypes[21]
1163 if x != nil {1517 if x != nil {
1164 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))1518 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1165 if ms.LoadMessageInfo() == nil {1519 if ms.LoadMessageInfo() == nil {
@@ -1172,7 +1526,7 @@ func (x *RunUpdated) ProtoReflect() protoreflect.Message {
1172 1526
1173 // Deprecated: Use RunUpdated.ProtoReflect.Descriptor instead.1527 // Deprecated: Use RunUpdated.ProtoReflect.Descriptor instead.
1174 func (*RunUpdated) Descriptor() ([]byte, []int) {1528 func (*RunUpdated) Descriptor() ([]byte, []int) {
1175- return file_ermite_event_proto_rawDescGZIP(), []int{16}1529+ return file_ermite_event_proto_rawDescGZIP(), []int{21}
1176 }1530 }
1177 1531
1178 func (x *RunUpdated) GetRun() *Run {1532 func (x *RunUpdated) GetRun() *Run {
@@ -1194,7 +1548,7 @@ type JobUpdated struct {
1194 1548
1195 func (x *JobUpdated) Reset() {1549 func (x *JobUpdated) Reset() {
1196 *x = JobUpdated{}1550 *x = JobUpdated{}
1197- mi := &file_ermite_event_proto_msgTypes[17]1551+ mi := &file_ermite_event_proto_msgTypes[22]
1198 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))1552 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1199 ms.StoreMessageInfo(mi)1553 ms.StoreMessageInfo(mi)
1200 }1554 }
@@ -1206,7 +1560,7 @@ func (x *JobUpdated) String() string {
1206 func (*JobUpdated) ProtoMessage() {}1560 func (*JobUpdated) ProtoMessage() {}
1207 1561
1208 func (x *JobUpdated) ProtoReflect() protoreflect.Message {1562 func (x *JobUpdated) ProtoReflect() protoreflect.Message {
1209- mi := &file_ermite_event_proto_msgTypes[17]1563+ mi := &file_ermite_event_proto_msgTypes[22]
1210 if x != nil {1564 if x != nil {
1211 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))1565 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1212 if ms.LoadMessageInfo() == nil {1566 if ms.LoadMessageInfo() == nil {
@@ -1219,7 +1573,7 @@ func (x *JobUpdated) ProtoReflect() protoreflect.Message {
1219 1573
1220 // Deprecated: Use JobUpdated.ProtoReflect.Descriptor instead.1574 // Deprecated: Use JobUpdated.ProtoReflect.Descriptor instead.
1221 func (*JobUpdated) Descriptor() ([]byte, []int) {1575 func (*JobUpdated) Descriptor() ([]byte, []int) {
1222- return file_ermite_event_proto_rawDescGZIP(), []int{17}1576+ return file_ermite_event_proto_rawDescGZIP(), []int{22}
1223 }1577 }
1224 1578
1225 func (x *JobUpdated) GetJob() *RunJob {1579 func (x *JobUpdated) GetJob() *RunJob {
@@ -1233,12 +1587,12 @@ var File_ermite_event_proto protoreflect.FileDescriptor
1233 1587
1234 const file_ermite_event_proto_rawDesc = "" +1588 const file_ermite_event_proto_rawDesc = "" +
1235 "\n" +1589 "\n" +
1236- "\x12ermite/event.proto\x12\x06ermite\x1a\x1aermite/merge_request.proto\x1a\x11ermite/repo.proto\x1a\x10ermite/run.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"I\n" +1590+ "\x12ermite/event.proto\x12\x06ermite\x1a\x12ermite/issue.proto\x1a\x1aermite/merge_request.proto\x1a\x11ermite/repo.proto\x1a\x10ermite/run.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"I\n" +
1237 "\fWatchRequest\x12\x16\n" +1591 "\fWatchRequest\x12\x16\n" +
1238 "\x06topics\x18\x01 \x03(\tR\x06topics\x12!\n" +1592 "\x06topics\x18\x01 \x03(\tR\x06topics\x12!\n" +
1239 "\fresume_after\x18\x02 \x01(\tR\vresumeAfter\"4\n" +1593 "\fresume_after\x18\x02 \x01(\tR\vresumeAfter\"4\n" +
1240 "\rWatchResponse\x12#\n" +1594 "\rWatchResponse\x12#\n" +
1241- "\x05event\x18\x01 \x01(\v2\r.ermite.EventR\x05event\"\xac\a\n" +1595+ "\x05event\x18\x01 \x01(\v2\r.ermite.EventR\x05event\"\xe6\t\n" +
1242 "\x05Event\x12\x0e\n" +1596 "\x05Event\x12\x0e\n" +
1243 "\x02id\x18\x01 \x01(\tR\x02id\x12.\n" +1597 "\x02id\x18\x01 \x01(\tR\x02id\x12.\n" +
1244 "\x04time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x04time\x128\n" +1598 "\x04time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x04time\x128\n" +
@@ -1258,7 +1612,12 @@ const file_ermite_event_proto_rawDesc = "" +
1258 "jobUpdated\x12>\n" +1612 "jobUpdated\x12>\n" +
1259 "\x0ecomment_edited\x18\x0e \x01(\v2\x15.ermite.CommentEditedH\x00R\rcommentEdited\x12A\n" +1613 "\x0ecomment_edited\x18\x0e \x01(\v2\x15.ermite.CommentEditedH\x00R\rcommentEdited\x12A\n" +
1260 "\x0fcomment_deleted\x18\x0f \x01(\v2\x16.ermite.CommentDeletedH\x00R\x0ecommentDeleted\x12D\n" +1614 "\x0fcomment_deleted\x18\x0f \x01(\v2\x16.ermite.CommentDeletedH\x00R\x0ecommentDeleted\x12D\n" +
1261- "\x10comment_resolved\x18\x10 \x01(\v2\x17.ermite.CommentResolvedH\x00R\x0fcommentResolvedB\x06\n" +1615+ "\x10comment_resolved\x18\x10 \x01(\v2\x17.ermite.CommentResolvedH\x00R\x0fcommentResolved\x128\n" +
1616+ "\fissue_opened\x18\x11 \x01(\v2\x13.ermite.IssueOpenedH\x00R\vissueOpened\x128\n" +
1617+ "\fissue_closed\x18\x12 \x01(\v2\x13.ermite.IssueClosedH\x00R\vissueClosed\x12>\n" +
1618+ "\x0eissue_reopened\x18\x13 \x01(\v2\x15.ermite.IssueReopenedH\x00R\rissueReopened\x12A\n" +
1619+ "\x0fissue_commented\x18\x14 \x01(\v2\x16.ermite.IssueCommentedH\x00R\x0eissueCommented\x12A\n" +
1620+ "\x0fissue_submitted\x18\x15 \x01(\v2\x16.ermite.IssueSubmittedH\x00R\x0eissueSubmittedB\x06\n" +
1262 "\x04kind\"/\n" +1621 "\x04kind\"/\n" +
1263 "\vRepoCreated\x12 \n" +1622 "\vRepoCreated\x12 \n" +
1264 "\x04repo\x18\x01 \x01(\v2\f.ermite.RepoR\x04repo\"/\n" +1623 "\x04repo\x18\x01 \x01(\v2\f.ermite.RepoR\x04repo\"/\n" +
@@ -1295,7 +1654,20 @@ const file_ermite_event_proto_rawDesc = "" +
1295 "\x0fCommentResolved\x12\x12\n" +1654 "\x0fCommentResolved\x12\x12\n" +
1296 "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x16\n" +1655 "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x16\n" +
1297 "\x06number\x18\x02 \x01(\x03R\x06number\x12)\n" +1656 "\x06number\x18\x02 \x01(\x03R\x06number\x12)\n" +
1298- "\acomment\x18\x03 \x01(\v2\x0f.ermite.CommentR\acomment\"\x05\n" +1657+ "\acomment\x18\x03 \x01(\v2\x0f.ermite.CommentR\acomment\"2\n" +
1658+ "\vIssueOpened\x12#\n" +
1659+ "\x05issue\x18\x01 \x01(\v2\r.ermite.IssueR\x05issue\"2\n" +
1660+ "\vIssueClosed\x12#\n" +
1661+ "\x05issue\x18\x01 \x01(\v2\r.ermite.IssueR\x05issue\"4\n" +
1662+ "\rIssueReopened\x12#\n" +
1663+ "\x05issue\x18\x01 \x01(\v2\r.ermite.IssueR\x05issue\"l\n" +
1664+ "\x0eIssueCommented\x12\x12\n" +
1665+ "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x16\n" +
1666+ "\x06number\x18\x02 \x01(\x03R\x06number\x12.\n" +
1667+ "\acomment\x18\x03 \x01(\v2\x14.ermite.IssueCommentR\acomment\"4\n" +
1668+ "\x0eIssueSubmitted\x12\x12\n" +
1669+ "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x0e\n" +
1670+ "\x02id\x18\x02 \x01(\tR\x02id\"\x05\n" +
1299 "\x03Gap\"+\n" +1671 "\x03Gap\"+\n" +
1300 "\n" +1672 "\n" +
1301 "RunUpdated\x12\x1d\n" +1673 "RunUpdated\x12\x1d\n" +
@@ -1321,7 +1693,7 @@ func file_ermite_event_proto_rawDescGZIP() []byte {
1321 return file_ermite_event_proto_rawDescData1693 return file_ermite_event_proto_rawDescData
1322 }1694 }
1323 1695
1324-var file_ermite_event_proto_msgTypes = make([]protoimpl.MessageInfo, 18)1696+var file_ermite_event_proto_msgTypes = make([]protoimpl.MessageInfo, 23)
1325 var file_ermite_event_proto_goTypes = []any{1697 var file_ermite_event_proto_goTypes = []any{
1326 (*WatchRequest)(nil), // 0: ermite.WatchRequest1698 (*WatchRequest)(nil), // 0: ermite.WatchRequest
1327 (*WatchResponse)(nil), // 1: ermite.WatchResponse1699 (*WatchResponse)(nil), // 1: ermite.WatchResponse
@@ -1338,52 +1710,68 @@ var file_ermite_event_proto_goTypes = []any{
1338 (*CommentEdited)(nil), // 12: ermite.CommentEdited1710 (*CommentEdited)(nil), // 12: ermite.CommentEdited
1339 (*CommentDeleted)(nil), // 13: ermite.CommentDeleted1711 (*CommentDeleted)(nil), // 13: ermite.CommentDeleted
1340 (*CommentResolved)(nil), // 14: ermite.CommentResolved1712 (*CommentResolved)(nil), // 14: ermite.CommentResolved
1341- (*Gap)(nil), // 15: ermite.Gap1713+ (*IssueOpened)(nil), // 15: ermite.IssueOpened
1342- (*RunUpdated)(nil), // 16: ermite.RunUpdated1714+ (*IssueClosed)(nil), // 16: ermite.IssueClosed
1343- (*JobUpdated)(nil), // 17: ermite.JobUpdated1715+ (*IssueReopened)(nil), // 17: ermite.IssueReopened
1344- (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp1716+ (*IssueCommented)(nil), // 18: ermite.IssueCommented
1345- (*Repo)(nil), // 19: ermite.Repo1717+ (*IssueSubmitted)(nil), // 19: ermite.IssueSubmitted
1346- (*MergeRequest)(nil), // 20: ermite.MergeRequest1718+ (*Gap)(nil), // 20: ermite.Gap
1347- (*Comment)(nil), // 21: ermite.Comment1719+ (*RunUpdated)(nil), // 21: ermite.RunUpdated
1348- (*Run)(nil), // 22: ermite.Run1720+ (*JobUpdated)(nil), // 22: ermite.JobUpdated
1349- (*RunJob)(nil), // 23: ermite.RunJob1721+ (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp
1722+ (*Repo)(nil), // 24: ermite.Repo
1723+ (*MergeRequest)(nil), // 25: ermite.MergeRequest
1724+ (*Comment)(nil), // 26: ermite.Comment
1725+ (*Issue)(nil), // 27: ermite.Issue
1726+ (*IssueComment)(nil), // 28: ermite.IssueComment
1727+ (*Run)(nil), // 29: ermite.Run
1728+ (*RunJob)(nil), // 30: ermite.RunJob
1350 }1729 }
1351 var file_ermite_event_proto_depIdxs = []int32{1730 var file_ermite_event_proto_depIdxs = []int32{
1352 2, // 0: ermite.WatchResponse.event:type_name -> ermite.Event1731 2, // 0: ermite.WatchResponse.event:type_name -> ermite.Event
1353- 18, // 1: ermite.Event.time:type_name -> google.protobuf.Timestamp1732+ 23, // 1: ermite.Event.time:type_name -> google.protobuf.Timestamp
1354 3, // 2: ermite.Event.repo_created:type_name -> ermite.RepoCreated1733 3, // 2: ermite.Event.repo_created:type_name -> ermite.RepoCreated
1355 4, // 3: ermite.Event.repo_updated:type_name -> ermite.RepoUpdated1734 4, // 3: ermite.Event.repo_updated:type_name -> ermite.RepoUpdated
1356 5, // 4: ermite.Event.repo_deleted:type_name -> ermite.RepoDeleted1735 5, // 4: ermite.Event.repo_deleted:type_name -> ermite.RepoDeleted
1357 6, // 5: ermite.Event.pushed:type_name -> ermite.Pushed1736 6, // 5: ermite.Event.pushed:type_name -> ermite.Pushed
1358- 15, // 6: ermite.Event.gap:type_name -> ermite.Gap1737+ 20, // 6: ermite.Event.gap:type_name -> ermite.Gap
1359 8, // 7: ermite.Event.merge_request_opened:type_name -> ermite.MergeRequestOpened1738 8, // 7: ermite.Event.merge_request_opened:type_name -> ermite.MergeRequestOpened
1360 9, // 8: ermite.Event.merge_request_merged:type_name -> ermite.MergeRequestMerged1739 9, // 8: ermite.Event.merge_request_merged:type_name -> ermite.MergeRequestMerged
1361 10, // 9: ermite.Event.merge_request_closed:type_name -> ermite.MergeRequestClosed1740 10, // 9: ermite.Event.merge_request_closed:type_name -> ermite.MergeRequestClosed
1362 11, // 10: ermite.Event.comment_added:type_name -> ermite.CommentAdded1741 11, // 10: ermite.Event.comment_added:type_name -> ermite.CommentAdded
1363- 16, // 11: ermite.Event.run_updated:type_name -> ermite.RunUpdated1742+ 21, // 11: ermite.Event.run_updated:type_name -> ermite.RunUpdated
1364- 17, // 12: ermite.Event.job_updated:type_name -> ermite.JobUpdated1743+ 22, // 12: ermite.Event.job_updated:type_name -> ermite.JobUpdated
1365 12, // 13: ermite.Event.comment_edited:type_name -> ermite.CommentEdited1744 12, // 13: ermite.Event.comment_edited:type_name -> ermite.CommentEdited
1366 13, // 14: ermite.Event.comment_deleted:type_name -> ermite.CommentDeleted1745 13, // 14: ermite.Event.comment_deleted:type_name -> ermite.CommentDeleted
1367 14, // 15: ermite.Event.comment_resolved:type_name -> ermite.CommentResolved1746 14, // 15: ermite.Event.comment_resolved:type_name -> ermite.CommentResolved
1368- 19, // 16: ermite.RepoCreated.repo:type_name -> ermite.Repo1747+ 15, // 16: ermite.Event.issue_opened:type_name -> ermite.IssueOpened
1369- 19, // 17: ermite.RepoUpdated.repo:type_name -> ermite.Repo1748+ 16, // 17: ermite.Event.issue_closed:type_name -> ermite.IssueClosed
1370- 7, // 18: ermite.Pushed.ref_updates:type_name -> ermite.RefUpdate1749+ 17, // 18: ermite.Event.issue_reopened:type_name -> ermite.IssueReopened
1371- 20, // 19: ermite.MergeRequestOpened.merge_request:type_name -> ermite.MergeRequest1750+ 18, // 19: ermite.Event.issue_commented:type_name -> ermite.IssueCommented
1372- 20, // 20: ermite.MergeRequestMerged.merge_request:type_name -> ermite.MergeRequest1751+ 19, // 20: ermite.Event.issue_submitted:type_name -> ermite.IssueSubmitted
1373- 20, // 21: ermite.MergeRequestClosed.merge_request:type_name -> ermite.MergeRequest1752+ 24, // 21: ermite.RepoCreated.repo:type_name -> ermite.Repo
1374- 21, // 22: ermite.CommentAdded.comment:type_name -> ermite.Comment1753+ 24, // 22: ermite.RepoUpdated.repo:type_name -> ermite.Repo
1375- 21, // 23: ermite.CommentEdited.comment:type_name -> ermite.Comment1754+ 7, // 23: ermite.Pushed.ref_updates:type_name -> ermite.RefUpdate
1376- 21, // 24: ermite.CommentDeleted.comment:type_name -> ermite.Comment1755+ 25, // 24: ermite.MergeRequestOpened.merge_request:type_name -> ermite.MergeRequest
1377- 21, // 25: ermite.CommentResolved.comment:type_name -> ermite.Comment1756+ 25, // 25: ermite.MergeRequestMerged.merge_request:type_name -> ermite.MergeRequest
1378- 22, // 26: ermite.RunUpdated.run:type_name -> ermite.Run1757+ 25, // 26: ermite.MergeRequestClosed.merge_request:type_name -> ermite.MergeRequest
1379- 23, // 27: ermite.JobUpdated.job:type_name -> ermite.RunJob1758+ 26, // 27: ermite.CommentAdded.comment:type_name -> ermite.Comment
1380- 0, // 28: ermite.EventService.Watch:input_type -> ermite.WatchRequest1759+ 26, // 28: ermite.CommentEdited.comment:type_name -> ermite.Comment
1381- 1, // 29: ermite.EventService.Watch:output_type -> ermite.WatchResponse1760+ 26, // 29: ermite.CommentDeleted.comment:type_name -> ermite.Comment
1382- 29, // [29:30] is the sub-list for method output_type1761+ 26, // 30: ermite.CommentResolved.comment:type_name -> ermite.Comment
1383- 28, // [28:29] is the sub-list for method input_type1762+ 27, // 31: ermite.IssueOpened.issue:type_name -> ermite.Issue
1384- 28, // [28:28] is the sub-list for extension type_name1763+ 27, // 32: ermite.IssueClosed.issue:type_name -> ermite.Issue
1385- 28, // [28:28] is the sub-list for extension extendee1764+ 27, // 33: ermite.IssueReopened.issue:type_name -> ermite.Issue
1386- 0, // [0:28] is the sub-list for field type_name1765+ 28, // 34: ermite.IssueCommented.comment:type_name -> ermite.IssueComment
1766+ 29, // 35: ermite.RunUpdated.run:type_name -> ermite.Run
1767+ 30, // 36: ermite.JobUpdated.job:type_name -> ermite.RunJob
1768+ 0, // 37: ermite.EventService.Watch:input_type -> ermite.WatchRequest
1769+ 1, // 38: ermite.EventService.Watch:output_type -> ermite.WatchResponse
1770+ 38, // [38:39] is the sub-list for method output_type
1771+ 37, // [37:38] is the sub-list for method input_type
1772+ 37, // [37:37] is the sub-list for extension type_name
1773+ 37, // [37:37] is the sub-list for extension extendee
1774+ 0, // [0:37] is the sub-list for field type_name
1387 }1775 }
1388 1776
1389 func init() { file_ermite_event_proto_init() }1777 func init() { file_ermite_event_proto_init() }
@@ -1391,6 +1779,7 @@ func file_ermite_event_proto_init() {
1391 if File_ermite_event_proto != nil {1779 if File_ermite_event_proto != nil {
1392 return1780 return
1393 }1781 }
1782+ file_ermite_issue_proto_init()
1394 file_ermite_merge_request_proto_init()1783 file_ermite_merge_request_proto_init()
1395 file_ermite_repo_proto_init()1784 file_ermite_repo_proto_init()
1396 file_ermite_run_proto_init()1785 file_ermite_run_proto_init()
@@ -1409,6 +1798,11 @@ func file_ermite_event_proto_init() {
1409 (*Event_CommentEdited)(nil),1798 (*Event_CommentEdited)(nil),
1410 (*Event_CommentDeleted)(nil),1799 (*Event_CommentDeleted)(nil),
1411 (*Event_CommentResolved)(nil),1800 (*Event_CommentResolved)(nil),
1801+ (*Event_IssueOpened)(nil),
1802+ (*Event_IssueClosed)(nil),
1803+ (*Event_IssueReopened)(nil),
1804+ (*Event_IssueCommented)(nil),
1805+ (*Event_IssueSubmitted)(nil),
1412 }1806 }
1413 type x struct{}1807 type x struct{}
1414 out := protoimpl.TypeBuilder{1808 out := protoimpl.TypeBuilder{
@@ -1416,7 +1810,7 @@ func file_ermite_event_proto_init() {
1416 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),1810 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
1417 RawDescriptor: unsafe.Slice(unsafe.StringData(file_ermite_event_proto_rawDesc), len(file_ermite_event_proto_rawDesc)),1811 RawDescriptor: unsafe.Slice(unsafe.StringData(file_ermite_event_proto_rawDesc), len(file_ermite_event_proto_rawDesc)),
1418 NumEnums: 0,1812 NumEnums: 0,
1419- NumMessages: 18,1813+ NumMessages: 23,
1420 NumExtensions: 0,1814 NumExtensions: 0,
1421 NumServices: 1,1815 NumServices: 1,
1422 },1816 },
A gen/ermite/issue.pb.go +1574 -0 generated file: collapsed
M gen/ermite/repo.pb.go +151 -57 generated file: collapsed
M gen/ermite/token.pb.go +8 -2 generated file: collapsed
A issue_test.go +98 -0
@@ -0,0 +1,98 @@
1+// SPDX-License-Identifier: MIT
2+
3+package api_test
4+
5+import (
6+ "testing"
7+
8+ "bnema.dev/ermite-api/gen/ermite"
9+ "bnema.dev/ermite-api/gen/ermite/ermiteconnect"
10+ "google.golang.org/protobuf/proto"
11+ "google.golang.org/protobuf/reflect/protoreflect"
12+)
13+
14+func TestIssueProcedures(t *testing.T) {
15+ tests := map[string]string{
16+ ermiteconnect.IssueServiceCreateIssueProcedure: "CreateIssue",
17+ ermiteconnect.IssueServiceListIssuesProcedure: "ListIssues",
18+ ermiteconnect.IssueServiceGetIssueProcedure: "GetIssue",
19+ ermiteconnect.IssueServiceAddIssueCommentProcedure: "AddIssueComment",
20+ ermiteconnect.IssueServiceCloseIssueProcedure: "CloseIssue",
21+ ermiteconnect.IssueServiceReopenIssueProcedure: "ReopenIssue",
22+ ermiteconnect.IssueServiceListPendingIssuesProcedure: "ListPendingIssues",
23+ ermiteconnect.IssueServiceApproveIssueProcedure: "ApproveIssue",
24+ ermiteconnect.IssueServiceRejectIssueProcedure: "RejectIssue",
25+ }
26+ for got, name := range tests {
27+ if want := "/ermite.IssueService/" + name; got != want {
28+ t.Errorf("procedure = %q, want %q", got, want)
29+ }
30+ }
31+}
32+
33+func TestIssueContract(t *testing.T) {
34+ for _, tt := range []struct {
35+ msg proto.Message
36+ fields map[string]int
37+ }{
38+ {&ermite.Issue{}, map[string]int{"repo": 1, "number": 2, "title": 3, "body": 4, "state": 5, "author": 6, "created_at": 7, "updated_at": 8, "comment_count": 9}},
39+ {&ermite.IssueComment{}, map[string]int{"id": 1, "author": 2, "text": 3, "created_at": 4}},
40+ {&ermite.RepoSettings{}, map[string]int{"issues": 3}},
41+ {&ermite.UpdateRepoRequest{}, map[string]int{"issues": 8}},
42+ {&ermite.Event{}, map[string]int{"issue_opened": 17, "issue_closed": 18, "issue_reopened": 19, "issue_commented": 20, "issue_submitted": 21}},
43+ {&ermite.IssueSubmitted{}, map[string]int{"repo": 1, "id": 2}},
44+ {&ermite.PendingIssue{}, map[string]int{"id": 1, "repo": 2, "title": 3, "body": 4, "author": 5, "created_at": 6}},
45+ {&ermite.ListPendingIssuesRequest{}, map[string]int{"repo": 1, "page_size": 2, "page_token": 3}},
46+ {&ermite.ListPendingIssuesResponse{}, map[string]int{"issues": 1, "next_page_token": 2}},
47+ {&ermite.ApproveIssueRequest{}, map[string]int{"repo": 1, "id": 2}},
48+ {&ermite.ApproveIssueResponse{}, map[string]int{"issue": 1}},
49+ {&ermite.RejectIssueRequest{}, map[string]int{"repo": 1, "id": 2, "ban": 3}},
50+ } {
51+ md := tt.msg.ProtoReflect().Descriptor()
52+ for name, num := range tt.fields {
53+ if fd := md.Fields().ByName(protoreflect.Name(name)); fd == nil || int(fd.Number()) != num {
54+ t.Errorf("%s.%s = %v, want %d", md.Name(), name, fd, num)
55+ }
56+ }
57+ }
58+ if ermite.Scope_SCOPE_ISSUE_WRITE != 11 {
59+ t.Fatal("issue:write scope number changed")
60+ }
61+ for name, want := range map[string]int32{"ISSUE_STATE_UNSPECIFIED": 0, "ISSUE_STATE_OPEN": 1, "ISSUE_STATE_CLOSED": 2, "ISSUE_STATE_PENDING": 3} {
62+ if got := ermite.IssueState_value[name]; got != want {
63+ t.Errorf("%s = %d, want %d", name, got, want)
64+ }
65+ }
66+ for name, want := range map[string]int32{"ISSUES_MODE_UNSPECIFIED": 0, "ISSUES_MODE_OFF": 1, "ISSUES_MODE_OWNER": 2, "ISSUES_MODE_PUBLIC": 3} {
67+ if got := ermite.IssuesMode_value[name]; got != want {
68+ t.Errorf("%s = %d, want %d", name, got, want)
69+ }
70+ }
71+ mode := ermite.IssuesMode_ISSUES_MODE_OFF
72+ for _, in := range []proto.Message{
73+ &ermite.UpdateRepoRequest{Repo: "r", Issues: &mode},
74+ &ermite.Event{Kind: &ermite.Event_IssueOpened{IssueOpened: &ermite.IssueOpened{Issue: &ermite.Issue{Repo: "r", Number: 1}}}},
75+ &ermite.Event{Kind: &ermite.Event_IssueClosed{IssueClosed: &ermite.IssueClosed{Issue: &ermite.Issue{Repo: "r", Number: 1}}}},
76+ &ermite.Event{Kind: &ermite.Event_IssueReopened{IssueReopened: &ermite.IssueReopened{Issue: &ermite.Issue{Repo: "r", Number: 1}}}},
77+ &ermite.Event{Kind: &ermite.Event_IssueSubmitted{IssueSubmitted: &ermite.IssueSubmitted{Repo: "r", Id: "p1"}}},
78+ &ermite.PendingIssue{Id: "p1", Repo: "r", Title: "t", Author: "anon"},
79+ &ermite.RejectIssueRequest{Repo: "r", Id: "p1", Ban: true},
80+ &ermite.Event{Kind: &ermite.Event_IssueCommented{IssueCommented: &ermite.IssueCommented{Repo: "r", Number: 1, Comment: &ermite.IssueComment{Id: "c", Text: "hi"}}}},
81+ } {
82+ b, err := proto.Marshal(in)
83+ if err != nil {
84+ t.Fatal(err)
85+ }
86+ out := in.ProtoReflect().New().Interface()
87+ if err := proto.Unmarshal(b, out); err != nil {
88+ t.Fatal(err)
89+ }
90+ if !proto.Equal(in, out) {
91+ t.Errorf("%T: round trip mismatch", in)
92+ }
93+ }
94+ fd := (&ermite.UpdateRepoRequest{}).ProtoReflect().Descriptor().Fields().ByName("issues")
95+ if !fd.HasOptionalKeyword() {
96+ t.Fatal("UpdateRepoRequest.issues must be optional")
97+ }
98+}
@@ -0,0 +1,98 @@
1+// SPDX-License-Identifier: MIT
2+
3+package api_test
4+
5+import (
6+ "testing"
7+
8+ "bnema.dev/ermite-api/gen/ermite"
9+ "bnema.dev/ermite-api/gen/ermite/ermiteconnect"
10+ "google.golang.org/protobuf/proto"
11+ "google.golang.org/protobuf/reflect/protoreflect"
12+)
13+
14+func TestIssueProcedures(t *testing.T) {
15+ tests := map[string]string{
16+ ermiteconnect.IssueServiceCreateIssueProcedure: "CreateIssue",
17+ ermiteconnect.IssueServiceListIssuesProcedure: "ListIssues",
18+ ermiteconnect.IssueServiceGetIssueProcedure: "GetIssue",
19+ ermiteconnect.IssueServiceAddIssueCommentProcedure: "AddIssueComment",
20+ ermiteconnect.IssueServiceCloseIssueProcedure: "CloseIssue",
21+ ermiteconnect.IssueServiceReopenIssueProcedure: "ReopenIssue",
22+ ermiteconnect.IssueServiceListPendingIssuesProcedure: "ListPendingIssues",
23+ ermiteconnect.IssueServiceApproveIssueProcedure: "ApproveIssue",
24+ ermiteconnect.IssueServiceRejectIssueProcedure: "RejectIssue",
25+ }
26+ for got, name := range tests {
27+ if want := "/ermite.IssueService/" + name; got != want {
28+ t.Errorf("procedure = %q, want %q", got, want)
29+ }
30+ }
31+}
32+
33+func TestIssueContract(t *testing.T) {
34+ for _, tt := range []struct {
35+ msg proto.Message
36+ fields map[string]int
37+ }{
38+ {&ermite.Issue{}, map[string]int{"repo": 1, "number": 2, "title": 3, "body": 4, "state": 5, "author": 6, "created_at": 7, "updated_at": 8, "comment_count": 9}},
39+ {&ermite.IssueComment{}, map[string]int{"id": 1, "author": 2, "text": 3, "created_at": 4}},
40+ {&ermite.RepoSettings{}, map[string]int{"issues": 3}},
41+ {&ermite.UpdateRepoRequest{}, map[string]int{"issues": 8}},
42+ {&ermite.Event{}, map[string]int{"issue_opened": 17, "issue_closed": 18, "issue_reopened": 19, "issue_commented": 20, "issue_submitted": 21}},
43+ {&ermite.IssueSubmitted{}, map[string]int{"repo": 1, "id": 2}},
44+ {&ermite.PendingIssue{}, map[string]int{"id": 1, "repo": 2, "title": 3, "body": 4, "author": 5, "created_at": 6}},
45+ {&ermite.ListPendingIssuesRequest{}, map[string]int{"repo": 1, "page_size": 2, "page_token": 3}},
46+ {&ermite.ListPendingIssuesResponse{}, map[string]int{"issues": 1, "next_page_token": 2}},
47+ {&ermite.ApproveIssueRequest{}, map[string]int{"repo": 1, "id": 2}},
48+ {&ermite.ApproveIssueResponse{}, map[string]int{"issue": 1}},
49+ {&ermite.RejectIssueRequest{}, map[string]int{"repo": 1, "id": 2, "ban": 3}},
50+ } {
51+ md := tt.msg.ProtoReflect().Descriptor()
52+ for name, num := range tt.fields {
53+ if fd := md.Fields().ByName(protoreflect.Name(name)); fd == nil || int(fd.Number()) != num {
54+ t.Errorf("%s.%s = %v, want %d", md.Name(), name, fd, num)
55+ }
56+ }
57+ }
58+ if ermite.Scope_SCOPE_ISSUE_WRITE != 11 {
59+ t.Fatal("issue:write scope number changed")
60+ }
61+ for name, want := range map[string]int32{"ISSUE_STATE_UNSPECIFIED": 0, "ISSUE_STATE_OPEN": 1, "ISSUE_STATE_CLOSED": 2, "ISSUE_STATE_PENDING": 3} {
62+ if got := ermite.IssueState_value[name]; got != want {
63+ t.Errorf("%s = %d, want %d", name, got, want)
64+ }
65+ }
66+ for name, want := range map[string]int32{"ISSUES_MODE_UNSPECIFIED": 0, "ISSUES_MODE_OFF": 1, "ISSUES_MODE_OWNER": 2, "ISSUES_MODE_PUBLIC": 3} {
67+ if got := ermite.IssuesMode_value[name]; got != want {
68+ t.Errorf("%s = %d, want %d", name, got, want)
69+ }
70+ }
71+ mode := ermite.IssuesMode_ISSUES_MODE_OFF
72+ for _, in := range []proto.Message{
73+ &ermite.UpdateRepoRequest{Repo: "r", Issues: &mode},
74+ &ermite.Event{Kind: &ermite.Event_IssueOpened{IssueOpened: &ermite.IssueOpened{Issue: &ermite.Issue{Repo: "r", Number: 1}}}},
75+ &ermite.Event{Kind: &ermite.Event_IssueClosed{IssueClosed: &ermite.IssueClosed{Issue: &ermite.Issue{Repo: "r", Number: 1}}}},
76+ &ermite.Event{Kind: &ermite.Event_IssueReopened{IssueReopened: &ermite.IssueReopened{Issue: &ermite.Issue{Repo: "r", Number: 1}}}},
77+ &ermite.Event{Kind: &ermite.Event_IssueSubmitted{IssueSubmitted: &ermite.IssueSubmitted{Repo: "r", Id: "p1"}}},
78+ &ermite.PendingIssue{Id: "p1", Repo: "r", Title: "t", Author: "anon"},
79+ &ermite.RejectIssueRequest{Repo: "r", Id: "p1", Ban: true},
80+ &ermite.Event{Kind: &ermite.Event_IssueCommented{IssueCommented: &ermite.IssueCommented{Repo: "r", Number: 1, Comment: &ermite.IssueComment{Id: "c", Text: "hi"}}}},
81+ } {
82+ b, err := proto.Marshal(in)
83+ if err != nil {
84+ t.Fatal(err)
85+ }
86+ out := in.ProtoReflect().New().Interface()
87+ if err := proto.Unmarshal(b, out); err != nil {
88+ t.Fatal(err)
89+ }
90+ if !proto.Equal(in, out) {
91+ t.Errorf("%T: round trip mismatch", in)
92+ }
93+ }
94+ fd := (&ermite.UpdateRepoRequest{}).ProtoReflect().Descriptor().Fields().ByName("issues")
95+ if !fd.HasOptionalKeyword() {
96+ t.Fatal("UpdateRepoRequest.issues must be optional")
97+ }
98+}
M proto/ermite/event.proto +69 -7
@@ -4,6 +4,7 @@ syntax = "proto3";
44
55 package ermite;
66
7+import "ermite/issue.proto";
78 import "ermite/merge_request.proto";
89 import "ermite/repo.proto";
910 import "ermite/run.proto";
@@ -18,9 +19,12 @@ service EventService {
1819 // The events are repo_created, repo_updated, repo_deleted, pushed, gap and,
1920 // for merge requests, merge_request_opened, merge_request_merged,
2021 // merge_request_closed, comment_added, comment_edited, comment_deleted and
21- // comment_resolved (a thread resolved or reopened). Each one is delivered on the
22- // "repo:<name>" topic of its repository and on "home", subject to the
23- // visibility of the repository.
22+ // comment_resolved (a thread resolved or reopened); for issues, issue_opened,
23+ // issue_closed, issue_reopened and issue_commented, and issue_submitted. Each
24+ // one is delivered on the "repo:<name>" topic of its repository and on
25+ // "home", subject to the visibility of the repository, except
26+ // issue_submitted: it is delivered only on the "owner" topic, never on
27+ // "home" or "repo:<name>", and carries no content (see IssueSubmitted).
2428 //
2529 // Servers with the feature "ci.runs" also publish run_updated and
2630 // job_updated, only on the "repo:<name>" topic of their repository (never on
@@ -55,9 +59,17 @@ service EventService {
5559 // WatchRequest selects the events to receive.
5660 message WatchRequest {
5761 // Topics are the subjects to follow: "home" for every repository visible to
58- // the caller, or "repo:<name>" for one repository. Empty means "home".
59- // Unknown topics are invalid_argument. A "repo:<name>" topic for a repository
60- // that does not exist or is not visible is not_found.
62+ // the caller, "repo:<name>" for one repository, or "owner". Empty means
63+ // "home". Unknown topics are invalid_argument. A "repo:<name>" topic for a
64+ // repository that does not exist or is not visible is not_found.
65+ //
66+ // The "owner" topic needs owner rights: root, an owner session, or a token
67+ // that holds every scope with no repository or branch limit. Anyone else
68+ // gets the same invalid_argument as for an unknown topic, so the topic is
69+ // not revealed. It carries the merge request and issue events of every
70+ // repository (merge_request_opened, merge_request_merged,
71+ // merge_request_closed, comment_added, and the issue events), repo_updated
72+ // and repo_deleted, plus issue_submitted, which is delivered nowhere else.
6173 repeated string topics = 1;
6274 // ResumeAfter is the Event.id of the last event the client has seen. Empty
6375 // to receive only new events.
@@ -109,6 +121,17 @@ message Event {
109121 CommentDeleted comment_deleted = 15;
110122 // CommentResolved: a merge request comment was resolved or unresolved.
111123 CommentResolved comment_resolved = 16;
124+ // IssueOpened: an issue was opened.
125+ IssueOpened issue_opened = 17;
126+ // IssueClosed: an issue was closed.
127+ IssueClosed issue_closed = 18;
128+ // IssueReopened: an issue was reopened.
129+ IssueReopened issue_reopened = 19;
130+ // IssueCommented: a comment was added to an issue.
131+ IssueCommented issue_commented = 20;
132+ // IssueSubmitted: an issue is awaiting moderation. Delivered only on the
133+ // "owner" topic, never on "home" or "repo:<name>", and carries no content.
134+ IssueSubmitted issue_submitted = 21;
112135 }
113136 }
114137
@@ -209,10 +232,49 @@ message CommentResolved {
209232 Comment comment = 3;
210233 }
211234
235+// IssueOpened reports a new issue.
236+message IssueOpened {
237+ // Issue is the new issue, including its repository and number.
238+ Issue issue = 1;
239+}
240+
241+// IssueClosed reports a closed issue.
242+message IssueClosed {
243+ // Issue is the issue after closing, including its repository and number.
244+ Issue issue = 1;
245+}
246+
247+// IssueReopened reports a reopened issue.
248+message IssueReopened {
249+ // Issue is the issue after reopening, including its repository and number.
250+ Issue issue = 1;
251+}
252+
253+// IssueCommented reports a new comment on an issue.
254+message IssueCommented {
255+ // Repo is the name of the repository.
256+ string repo = 1;
257+ // Number is the number of the issue.
258+ int64 number = 2;
259+ // Comment is the new comment.
260+ IssueComment comment = 3;
261+}
262+
263+// IssueSubmitted reports an issue awaiting moderation. It is delivered only
264+// on the "owner" topic, never on "home" or "repo:<name>". It carries no title or body: content never travels in
265+// events, read it with IssueService.ListPendingIssues.
266+message IssueSubmitted {
267+ // Repo is the name of the repository.
268+ string repo = 1;
269+ // Id is the PendingIssue.id.
270+ string id = 2;
271+}
272+
212273 // Gap tells the client that events were lost: the requested resume point is
213274 // older than the server's buffer. It has no fields. The client should reload
214275 // the state it displays (repositories, refs, merge requests and their
215-// comments, CI runs and their jobs) and carry on with the next events.
276+// comments, issues and their comments, CI runs and their jobs) and carry on
277+// with the next events.
216278 message Gap {}
217279
218280 // RunUpdated reports a CI run that was created or whose status, conclusion or
@@ -4,6 +4,7 @@ syntax = "proto3";
4 4
5 package ermite;5 package ermite;
6 6
7+import "ermite/issue.proto";
7 import "ermite/merge_request.proto";8 import "ermite/merge_request.proto";
8 import "ermite/repo.proto";9 import "ermite/repo.proto";
9 import "ermite/run.proto";10 import "ermite/run.proto";
@@ -18,9 +19,12 @@ service EventService {
18 // The events are repo_created, repo_updated, repo_deleted, pushed, gap and,19 // The events are repo_created, repo_updated, repo_deleted, pushed, gap and,
19 // for merge requests, merge_request_opened, merge_request_merged,20 // for merge requests, merge_request_opened, merge_request_merged,
20 // merge_request_closed, comment_added, comment_edited, comment_deleted and21 // merge_request_closed, comment_added, comment_edited, comment_deleted and
21- // comment_resolved (a thread resolved or reopened). Each one is delivered on the22+ // comment_resolved (a thread resolved or reopened); for issues, issue_opened,
22- // "repo:<name>" topic of its repository and on "home", subject to the23+ // issue_closed, issue_reopened and issue_commented, and issue_submitted. Each
23- // visibility of the repository.24+ // one is delivered on the "repo:<name>" topic of its repository and on
25+ // "home", subject to the visibility of the repository, except
26+ // issue_submitted: it is delivered only on the "owner" topic, never on
27+ // "home" or "repo:<name>", and carries no content (see IssueSubmitted).
24 //28 //
25 // Servers with the feature "ci.runs" also publish run_updated and29 // Servers with the feature "ci.runs" also publish run_updated and
26 // job_updated, only on the "repo:<name>" topic of their repository (never on30 // job_updated, only on the "repo:<name>" topic of their repository (never on
@@ -55,9 +59,17 @@ service EventService {
55 // WatchRequest selects the events to receive.59 // WatchRequest selects the events to receive.
56 message WatchRequest {60 message WatchRequest {
57 // Topics are the subjects to follow: "home" for every repository visible to61 // Topics are the subjects to follow: "home" for every repository visible to
58- // the caller, or "repo:<name>" for one repository. Empty means "home".62+ // the caller, "repo:<name>" for one repository, or "owner". Empty means
59- // Unknown topics are invalid_argument. A "repo:<name>" topic for a repository63+ // "home". Unknown topics are invalid_argument. A "repo:<name>" topic for a
60- // that does not exist or is not visible is not_found.64+ // repository that does not exist or is not visible is not_found.
65+ //
66+ // The "owner" topic needs owner rights: root, an owner session, or a token
67+ // that holds every scope with no repository or branch limit. Anyone else
68+ // gets the same invalid_argument as for an unknown topic, so the topic is
69+ // not revealed. It carries the merge request and issue events of every
70+ // repository (merge_request_opened, merge_request_merged,
71+ // merge_request_closed, comment_added, and the issue events), repo_updated
72+ // and repo_deleted, plus issue_submitted, which is delivered nowhere else.
61 repeated string topics = 1;73 repeated string topics = 1;
62 // ResumeAfter is the Event.id of the last event the client has seen. Empty74 // ResumeAfter is the Event.id of the last event the client has seen. Empty
63 // to receive only new events.75 // to receive only new events.
@@ -109,6 +121,17 @@ message Event {
109 CommentDeleted comment_deleted = 15;121 CommentDeleted comment_deleted = 15;
110 // CommentResolved: a merge request comment was resolved or unresolved.122 // CommentResolved: a merge request comment was resolved or unresolved.
111 CommentResolved comment_resolved = 16;123 CommentResolved comment_resolved = 16;
124+ // IssueOpened: an issue was opened.
125+ IssueOpened issue_opened = 17;
126+ // IssueClosed: an issue was closed.
127+ IssueClosed issue_closed = 18;
128+ // IssueReopened: an issue was reopened.
129+ IssueReopened issue_reopened = 19;
130+ // IssueCommented: a comment was added to an issue.
131+ IssueCommented issue_commented = 20;
132+ // IssueSubmitted: an issue is awaiting moderation. Delivered only on the
133+ // "owner" topic, never on "home" or "repo:<name>", and carries no content.
134+ IssueSubmitted issue_submitted = 21;
112 }135 }
113 }136 }
114 137
@@ -209,10 +232,49 @@ message CommentResolved {
209 Comment comment = 3;232 Comment comment = 3;
210 }233 }
211 234
235+// IssueOpened reports a new issue.
236+message IssueOpened {
237+ // Issue is the new issue, including its repository and number.
238+ Issue issue = 1;
239+}
240+
241+// IssueClosed reports a closed issue.
242+message IssueClosed {
243+ // Issue is the issue after closing, including its repository and number.
244+ Issue issue = 1;
245+}
246+
247+// IssueReopened reports a reopened issue.
248+message IssueReopened {
249+ // Issue is the issue after reopening, including its repository and number.
250+ Issue issue = 1;
251+}
252+
253+// IssueCommented reports a new comment on an issue.
254+message IssueCommented {
255+ // Repo is the name of the repository.
256+ string repo = 1;
257+ // Number is the number of the issue.
258+ int64 number = 2;
259+ // Comment is the new comment.
260+ IssueComment comment = 3;
261+}
262+
263+// IssueSubmitted reports an issue awaiting moderation. It is delivered only
264+// on the "owner" topic, never on "home" or "repo:<name>". It carries no title or body: content never travels in
265+// events, read it with IssueService.ListPendingIssues.
266+message IssueSubmitted {
267+ // Repo is the name of the repository.
268+ string repo = 1;
269+ // Id is the PendingIssue.id.
270+ string id = 2;
271+}
272+
212 // Gap tells the client that events were lost: the requested resume point is273 // Gap tells the client that events were lost: the requested resume point is
213 // older than the server's buffer. It has no fields. The client should reload274 // older than the server's buffer. It has no fields. The client should reload
214 // the state it displays (repositories, refs, merge requests and their275 // the state it displays (repositories, refs, merge requests and their
215-// comments, CI runs and their jobs) and carry on with the next events.276+// comments, issues and their comments, CI runs and their jobs) and carry on
277+// with the next events.
216 message Gap {}278 message Gap {}
217 279
218 // RunUpdated reports a CI run that was created or whose status, conclusion or280 // RunUpdated reports a CI run that was created or whose status, conclusion or
A proto/ermite/issue.proto +281 -0
@@ -0,0 +1,281 @@
1+// SPDX-License-Identifier: MIT
2+
3+syntax = "proto3";
4+
5+package ermite;
6+
7+import "google/protobuf/timestamp.proto";
8+
9+// IssueState is where an issue is in its life.
10+enum IssueState {
11+ // Not set. In ListIssuesRequest.state it means every state. Never returned
12+ // by the server.
13+ ISSUE_STATE_UNSPECIFIED = 0;
14+ // The issue is open.
15+ ISSUE_STATE_OPEN = 1;
16+ // The issue is closed.
17+ ISSUE_STATE_CLOSED = 2;
18+ // Reserved for later use: awaiting moderation, owner-only.
19+ ISSUE_STATE_PENDING = 3;
20+}
21+
22+// Issue is a discussion in a repository.
23+message Issue {
24+ // Repo is the name of the repository.
25+ string repo = 1;
26+ // Number identifies the issue within its repository.
27+ int64 number = 2;
28+ // Title is the one-line title.
29+ string title = 3;
30+ // Body is the content of the issue. It may be empty.
31+ string body = 4;
32+ // State is where the issue is in its life.
33+ IssueState state = 5;
34+ // Author names who created the issue: the label of the token or session
35+ // that was used ("root" for the root token, "owner" for a web session), or,
36+ // for an issue approved from the public form, the unverified display name
37+ // the visitor typed (or "anonymous"). It is informational and never proves
38+ // identity: labels are not unique, the token may be gone, and a visitor can
39+ // type "owner".
40+ string author = 6;
41+ // CreatedAt is when the issue was created.
42+ google.protobuf.Timestamp created_at = 7;
43+ // UpdatedAt is when the issue last changed.
44+ google.protobuf.Timestamp updated_at = 8;
45+ // CommentCount is the number of comments on the issue.
46+ int32 comment_count = 9;
47+}
48+
49+// IssueComment is a note on an issue.
50+message IssueComment {
51+ // Id identifies the comment within its issue. Opaque.
52+ string id = 1;
53+ // Author names who wrote the comment, like Issue.author.
54+ string author = 2;
55+ // Text is the content of the comment.
56+ string text = 3;
57+ // CreatedAt is when the comment was written.
58+ google.protobuf.Timestamp created_at = 4;
59+}
60+
61+// IssueService manages issues and their comments.
62+//
63+// Servers that implement this service list "issues" in
64+// GetVersionResponse.features. Issues and merge requests of a repository share
65+// one number sequence. When the issues mode of the repository is off, every
66+// call answers not_found, as for a repository that does not exist.
67+//
68+// Reading (ListIssues, GetIssue) needs the same access as reading the
69+// repository: nothing for a public one, the repo:read scope for a private one.
70+// Writing (CreateIssue, AddIssueComment, CloseIssue, ReopenIssue) needs the
71+// owner or a token with the issue:write scope on the repository; branch
72+// prefixes do not restrict it. A caller without credentials gets
73+// unauthenticated, one with an insufficient scope gets permission_denied, and
74+// one that cannot read the repository gets not_found.
75+//
76+// Text fields are normalized to NFC and stripped of control and Unicode
77+// bidirectional characters (line breaks and tabs stay in bodies and comments).
78+// The title is one line of 1 to 120 code points; body and comment text are at
79+// most 10,000 code points and a comment must not be blank. A text that breaks
80+// a rule is rejected with invalid_argument. A comment on an issue that already
81+// holds 1,000 comments gives resource_exhausted. Closing an issue that is not
82+// open, or reopening one that is not closed, gives failed_precondition.
83+//
84+// The ordinary RPCs only return issues in state OPEN or CLOSED, and
85+// ListIssues with state ISSUE_STATE_PENDING is invalid_argument. Submissions
86+// from the public form wait as PendingIssue records, reachable only through
87+// the three moderation RPCs (ListPendingIssues, ApproveIssue, RejectIssue).
88+// These need owner rights (root, an owner session, or a token holding every
89+// scope with no repository or branch limit); anyone else gets not_found,
90+// whatever the request holds. For the owner, a malformed pending issue id is
91+// not_found and a malformed repository name is invalid_argument.
92+service IssueService {
93+ // CreateIssue opens an issue. Needs the issue:write scope.
94+ rpc CreateIssue(CreateIssueRequest) returns (CreateIssueResponse);
95+ // ListIssues lists issues, highest number first, optionally in one state.
96+ rpc ListIssues(ListIssuesRequest) returns (ListIssuesResponse);
97+ // GetIssue returns an issue with its comments.
98+ rpc GetIssue(GetIssueRequest) returns (GetIssueResponse);
99+ // AddIssueComment adds a comment. Needs the issue:write scope.
100+ rpc AddIssueComment(AddIssueCommentRequest) returns (AddIssueCommentResponse);
101+ // CloseIssue closes an issue. Needs the issue:write scope.
102+ rpc CloseIssue(CloseIssueRequest) returns (CloseIssueResponse);
103+ // ReopenIssue reopens an issue. Needs the issue:write scope.
104+ rpc ReopenIssue(ReopenIssueRequest) returns (ReopenIssueResponse);
105+ // ListPendingIssues lists issues awaiting moderation, oldest first. Owner
106+ // rights only; anyone else gets NOT_FOUND.
107+ rpc ListPendingIssues(ListPendingIssuesRequest) returns (ListPendingIssuesResponse);
108+ // ApproveIssue turns a pending issue into an open issue with a new number.
109+ // Owner rights only; anyone else gets NOT_FOUND.
110+ rpc ApproveIssue(ApproveIssueRequest) returns (ApproveIssueResponse);
111+ // RejectIssue discards a pending issue, optionally banning its submitter.
112+ // Owner rights only; anyone else gets NOT_FOUND.
113+ rpc RejectIssue(RejectIssueRequest) returns (RejectIssueResponse);
114+}
115+
116+// CreateIssueRequest describes the issue to open.
117+message CreateIssueRequest {
118+ // Repo is the repository name.
119+ string repo = 1;
120+ // Title is the one-line title. Required.
121+ string title = 2;
122+ // Body is the optional content.
123+ string body = 3;
124+}
125+
126+// CreateIssueResponse holds the new issue.
127+message CreateIssueResponse {
128+ // Issue is the created issue.
129+ Issue issue = 1;
130+}
131+
132+// ListIssuesRequest selects a page of issues.
133+message ListIssuesRequest {
134+ // Repo is the repository name.
135+ string repo = 1;
136+ // State restricts the result to one state. ISSUE_STATE_UNSPECIFIED means
137+ // every state.
138+ IssueState state = 2;
139+ // PageSize is the maximum number of issues to return. 0 means the server
140+ // default; values above the server maximum are lowered to it.
141+ int32 page_size = 3;
142+ // PageToken is the next_page_token of a previous response, to continue the
143+ // same listing. Empty for the first page. Other fields must be unchanged.
144+ string page_token = 4;
145+}
146+
147+// ListIssuesResponse is one page of issues.
148+message ListIssuesResponse {
149+ // Issues are the issues of this page, highest number first.
150+ repeated Issue issues = 1;
151+ // NextPageToken is passed as page_token to get the next page. Empty when
152+ // there is no next page.
153+ string next_page_token = 2;
154+}
155+
156+// GetIssueRequest selects an issue.
157+message GetIssueRequest {
158+ // Repo is the repository name.
159+ string repo = 1;
160+ // Number is the issue number.
161+ int64 number = 2;
162+}
163+
164+// GetIssueResponse holds an issue with its comments.
165+message GetIssueResponse {
166+ // Issue is the issue.
167+ Issue issue = 1;
168+ // Comments are every comment of the issue, oldest first.
169+ repeated IssueComment comments = 2;
170+}
171+
172+// AddIssueCommentRequest describes the comment to add.
173+message AddIssueCommentRequest {
174+ // Repo is the repository name.
175+ string repo = 1;
176+ // Number is the issue number.
177+ int64 number = 2;
178+ // Text is the content. Required.
179+ string text = 3;
180+}
181+
182+// AddIssueCommentResponse holds the new comment.
183+message AddIssueCommentResponse {
184+ // Comment is the created comment.
185+ IssueComment comment = 1;
186+}
187+
188+// CloseIssueRequest names the issue to close.
189+message CloseIssueRequest {
190+ // Repo is the repository name.
191+ string repo = 1;
192+ // Number is the issue number.
193+ int64 number = 2;
194+}
195+
196+// CloseIssueResponse holds the issue after closing.
197+message CloseIssueResponse {
198+ // Issue is the closed issue.
199+ Issue issue = 1;
200+}
201+
202+// ReopenIssueRequest names the issue to reopen.
203+message ReopenIssueRequest {
204+ // Repo is the repository name.
205+ string repo = 1;
206+ // Number is the issue number.
207+ int64 number = 2;
208+}
209+
210+// ReopenIssueResponse holds the issue after reopening.
211+message ReopenIssueResponse {
212+ // Issue is the reopened issue.
213+ Issue issue = 1;
214+}
215+
216+// PendingIssue is an issue awaiting moderation. It has no number yet.
217+message PendingIssue {
218+ // Id identifies the pending issue. Opaque internal id, not a number.
219+ string id = 1;
220+ // Repo is the name of the repository.
221+ string repo = 2;
222+ // Title is the one-line title.
223+ string title = 3;
224+ // Body is the content. It may be empty.
225+ string body = 4;
226+ // Author is the optional display name given by the anonymous submitter. It
227+ // may be empty or "anonymous", and is not verified: it never proves
228+ // identity (a visitor can type "owner"). It becomes Issue.author on approval.
229+ string author = 5;
230+ // CreatedAt is when the issue was submitted.
231+ google.protobuf.Timestamp created_at = 6;
232+}
233+
234+// ListPendingIssuesRequest selects a page of pending issues.
235+message ListPendingIssuesRequest {
236+ // Repo is the repository name. Empty means every repository.
237+ string repo = 1;
238+ // PageSize is the maximum number of issues to return. 0 means the server
239+ // default; values above the server maximum are lowered to it.
240+ int32 page_size = 2;
241+ // PageToken is the next_page_token of a previous response, to continue the
242+ // same listing. Empty for the first page. Other fields must be unchanged.
243+ string page_token = 3;
244+}
245+
246+// ListPendingIssuesResponse is one page of pending issues.
247+message ListPendingIssuesResponse {
248+ // Issues are the pending issues of this page, oldest first.
249+ repeated PendingIssue issues = 1;
250+ // NextPageToken is passed as page_token to get the next page. Empty when
251+ // there is no next page.
252+ string next_page_token = 2;
253+}
254+
255+// ApproveIssueRequest names the pending issue to approve.
256+message ApproveIssueRequest {
257+ // Repo is the repository name.
258+ string repo = 1;
259+ // Id is the PendingIssue.id.
260+ string id = 2;
261+}
262+
263+// ApproveIssueResponse holds the approved issue.
264+message ApproveIssueResponse {
265+ // Issue is the approved issue, with its new number and state
266+ // ISSUE_STATE_OPEN.
267+ Issue issue = 1;
268+}
269+
270+// RejectIssueRequest names the pending issue to reject.
271+message RejectIssueRequest {
272+ // Repo is the repository name.
273+ string repo = 1;
274+ // Id is the PendingIssue.id.
275+ string id = 2;
276+ // Ban also bans the submitter for a while.
277+ bool ban = 3;
278+}
279+
280+// RejectIssueResponse is empty: the pending issue is gone.
281+message RejectIssueResponse {}
@@ -0,0 +1,281 @@
1+// SPDX-License-Identifier: MIT
2+
3+syntax = "proto3";
4+
5+package ermite;
6+
7+import "google/protobuf/timestamp.proto";
8+
9+// IssueState is where an issue is in its life.
10+enum IssueState {
11+ // Not set. In ListIssuesRequest.state it means every state. Never returned
12+ // by the server.
13+ ISSUE_STATE_UNSPECIFIED = 0;
14+ // The issue is open.
15+ ISSUE_STATE_OPEN = 1;
16+ // The issue is closed.
17+ ISSUE_STATE_CLOSED = 2;
18+ // Reserved for later use: awaiting moderation, owner-only.
19+ ISSUE_STATE_PENDING = 3;
20+}
21+
22+// Issue is a discussion in a repository.
23+message Issue {
24+ // Repo is the name of the repository.
25+ string repo = 1;
26+ // Number identifies the issue within its repository.
27+ int64 number = 2;
28+ // Title is the one-line title.
29+ string title = 3;
30+ // Body is the content of the issue. It may be empty.
31+ string body = 4;
32+ // State is where the issue is in its life.
33+ IssueState state = 5;
34+ // Author names who created the issue: the label of the token or session
35+ // that was used ("root" for the root token, "owner" for a web session), or,
36+ // for an issue approved from the public form, the unverified display name
37+ // the visitor typed (or "anonymous"). It is informational and never proves
38+ // identity: labels are not unique, the token may be gone, and a visitor can
39+ // type "owner".
40+ string author = 6;
41+ // CreatedAt is when the issue was created.
42+ google.protobuf.Timestamp created_at = 7;
43+ // UpdatedAt is when the issue last changed.
44+ google.protobuf.Timestamp updated_at = 8;
45+ // CommentCount is the number of comments on the issue.
46+ int32 comment_count = 9;
47+}
48+
49+// IssueComment is a note on an issue.
50+message IssueComment {
51+ // Id identifies the comment within its issue. Opaque.
52+ string id = 1;
53+ // Author names who wrote the comment, like Issue.author.
54+ string author = 2;
55+ // Text is the content of the comment.
56+ string text = 3;
57+ // CreatedAt is when the comment was written.
58+ google.protobuf.Timestamp created_at = 4;
59+}
60+
61+// IssueService manages issues and their comments.
62+//
63+// Servers that implement this service list "issues" in
64+// GetVersionResponse.features. Issues and merge requests of a repository share
65+// one number sequence. When the issues mode of the repository is off, every
66+// call answers not_found, as for a repository that does not exist.
67+//
68+// Reading (ListIssues, GetIssue) needs the same access as reading the
69+// repository: nothing for a public one, the repo:read scope for a private one.
70+// Writing (CreateIssue, AddIssueComment, CloseIssue, ReopenIssue) needs the
71+// owner or a token with the issue:write scope on the repository; branch
72+// prefixes do not restrict it. A caller without credentials gets
73+// unauthenticated, one with an insufficient scope gets permission_denied, and
74+// one that cannot read the repository gets not_found.
75+//
76+// Text fields are normalized to NFC and stripped of control and Unicode
77+// bidirectional characters (line breaks and tabs stay in bodies and comments).
78+// The title is one line of 1 to 120 code points; body and comment text are at
79+// most 10,000 code points and a comment must not be blank. A text that breaks
80+// a rule is rejected with invalid_argument. A comment on an issue that already
81+// holds 1,000 comments gives resource_exhausted. Closing an issue that is not
82+// open, or reopening one that is not closed, gives failed_precondition.
83+//
84+// The ordinary RPCs only return issues in state OPEN or CLOSED, and
85+// ListIssues with state ISSUE_STATE_PENDING is invalid_argument. Submissions
86+// from the public form wait as PendingIssue records, reachable only through
87+// the three moderation RPCs (ListPendingIssues, ApproveIssue, RejectIssue).
88+// These need owner rights (root, an owner session, or a token holding every
89+// scope with no repository or branch limit); anyone else gets not_found,
90+// whatever the request holds. For the owner, a malformed pending issue id is
91+// not_found and a malformed repository name is invalid_argument.
92+service IssueService {
93+ // CreateIssue opens an issue. Needs the issue:write scope.
94+ rpc CreateIssue(CreateIssueRequest) returns (CreateIssueResponse);
95+ // ListIssues lists issues, highest number first, optionally in one state.
96+ rpc ListIssues(ListIssuesRequest) returns (ListIssuesResponse);
97+ // GetIssue returns an issue with its comments.
98+ rpc GetIssue(GetIssueRequest) returns (GetIssueResponse);
99+ // AddIssueComment adds a comment. Needs the issue:write scope.
100+ rpc AddIssueComment(AddIssueCommentRequest) returns (AddIssueCommentResponse);
101+ // CloseIssue closes an issue. Needs the issue:write scope.
102+ rpc CloseIssue(CloseIssueRequest) returns (CloseIssueResponse);
103+ // ReopenIssue reopens an issue. Needs the issue:write scope.
104+ rpc ReopenIssue(ReopenIssueRequest) returns (ReopenIssueResponse);
105+ // ListPendingIssues lists issues awaiting moderation, oldest first. Owner
106+ // rights only; anyone else gets NOT_FOUND.
107+ rpc ListPendingIssues(ListPendingIssuesRequest) returns (ListPendingIssuesResponse);
108+ // ApproveIssue turns a pending issue into an open issue with a new number.
109+ // Owner rights only; anyone else gets NOT_FOUND.
110+ rpc ApproveIssue(ApproveIssueRequest) returns (ApproveIssueResponse);
111+ // RejectIssue discards a pending issue, optionally banning its submitter.
112+ // Owner rights only; anyone else gets NOT_FOUND.
113+ rpc RejectIssue(RejectIssueRequest) returns (RejectIssueResponse);
114+}
115+
116+// CreateIssueRequest describes the issue to open.
117+message CreateIssueRequest {
118+ // Repo is the repository name.
119+ string repo = 1;
120+ // Title is the one-line title. Required.
121+ string title = 2;
122+ // Body is the optional content.
123+ string body = 3;
124+}
125+
126+// CreateIssueResponse holds the new issue.
127+message CreateIssueResponse {
128+ // Issue is the created issue.
129+ Issue issue = 1;
130+}
131+
132+// ListIssuesRequest selects a page of issues.
133+message ListIssuesRequest {
134+ // Repo is the repository name.
135+ string repo = 1;
136+ // State restricts the result to one state. ISSUE_STATE_UNSPECIFIED means
137+ // every state.
138+ IssueState state = 2;
139+ // PageSize is the maximum number of issues to return. 0 means the server
140+ // default; values above the server maximum are lowered to it.
141+ int32 page_size = 3;
142+ // PageToken is the next_page_token of a previous response, to continue the
143+ // same listing. Empty for the first page. Other fields must be unchanged.
144+ string page_token = 4;
145+}
146+
147+// ListIssuesResponse is one page of issues.
148+message ListIssuesResponse {
149+ // Issues are the issues of this page, highest number first.
150+ repeated Issue issues = 1;
151+ // NextPageToken is passed as page_token to get the next page. Empty when
152+ // there is no next page.
153+ string next_page_token = 2;
154+}
155+
156+// GetIssueRequest selects an issue.
157+message GetIssueRequest {
158+ // Repo is the repository name.
159+ string repo = 1;
160+ // Number is the issue number.
161+ int64 number = 2;
162+}
163+
164+// GetIssueResponse holds an issue with its comments.
165+message GetIssueResponse {
166+ // Issue is the issue.
167+ Issue issue = 1;
168+ // Comments are every comment of the issue, oldest first.
169+ repeated IssueComment comments = 2;
170+}
171+
172+// AddIssueCommentRequest describes the comment to add.
173+message AddIssueCommentRequest {
174+ // Repo is the repository name.
175+ string repo = 1;
176+ // Number is the issue number.
177+ int64 number = 2;
178+ // Text is the content. Required.
179+ string text = 3;
180+}
181+
182+// AddIssueCommentResponse holds the new comment.
183+message AddIssueCommentResponse {
184+ // Comment is the created comment.
185+ IssueComment comment = 1;
186+}
187+
188+// CloseIssueRequest names the issue to close.
189+message CloseIssueRequest {
190+ // Repo is the repository name.
191+ string repo = 1;
192+ // Number is the issue number.
193+ int64 number = 2;
194+}
195+
196+// CloseIssueResponse holds the issue after closing.
197+message CloseIssueResponse {
198+ // Issue is the closed issue.
199+ Issue issue = 1;
200+}
201+
202+// ReopenIssueRequest names the issue to reopen.
203+message ReopenIssueRequest {
204+ // Repo is the repository name.
205+ string repo = 1;
206+ // Number is the issue number.
207+ int64 number = 2;
208+}
209+
210+// ReopenIssueResponse holds the issue after reopening.
211+message ReopenIssueResponse {
212+ // Issue is the reopened issue.
213+ Issue issue = 1;
214+}
215+
216+// PendingIssue is an issue awaiting moderation. It has no number yet.
217+message PendingIssue {
218+ // Id identifies the pending issue. Opaque internal id, not a number.
219+ string id = 1;
220+ // Repo is the name of the repository.
221+ string repo = 2;
222+ // Title is the one-line title.
223+ string title = 3;
224+ // Body is the content. It may be empty.
225+ string body = 4;
226+ // Author is the optional display name given by the anonymous submitter. It
227+ // may be empty or "anonymous", and is not verified: it never proves
228+ // identity (a visitor can type "owner"). It becomes Issue.author on approval.
229+ string author = 5;
230+ // CreatedAt is when the issue was submitted.
231+ google.protobuf.Timestamp created_at = 6;
232+}
233+
234+// ListPendingIssuesRequest selects a page of pending issues.
235+message ListPendingIssuesRequest {
236+ // Repo is the repository name. Empty means every repository.
237+ string repo = 1;
238+ // PageSize is the maximum number of issues to return. 0 means the server
239+ // default; values above the server maximum are lowered to it.
240+ int32 page_size = 2;
241+ // PageToken is the next_page_token of a previous response, to continue the
242+ // same listing. Empty for the first page. Other fields must be unchanged.
243+ string page_token = 3;
244+}
245+
246+// ListPendingIssuesResponse is one page of pending issues.
247+message ListPendingIssuesResponse {
248+ // Issues are the pending issues of this page, oldest first.
249+ repeated PendingIssue issues = 1;
250+ // NextPageToken is passed as page_token to get the next page. Empty when
251+ // there is no next page.
252+ string next_page_token = 2;
253+}
254+
255+// ApproveIssueRequest names the pending issue to approve.
256+message ApproveIssueRequest {
257+ // Repo is the repository name.
258+ string repo = 1;
259+ // Id is the PendingIssue.id.
260+ string id = 2;
261+}
262+
263+// ApproveIssueResponse holds the approved issue.
264+message ApproveIssueResponse {
265+ // Issue is the approved issue, with its new number and state
266+ // ISSUE_STATE_OPEN.
267+ Issue issue = 1;
268+}
269+
270+// RejectIssueRequest names the pending issue to reject.
271+message RejectIssueRequest {
272+ // Repo is the repository name.
273+ string repo = 1;
274+ // Id is the PendingIssue.id.
275+ string id = 2;
276+ // Ban also bans the submitter for a while.
277+ bool ban = 3;
278+}
279+
280+// RejectIssueResponse is empty: the pending issue is gone.
281+message RejectIssueResponse {}
M proto/ermite/repo.proto +26 -4
@@ -20,8 +20,20 @@ enum Visibility {
2020 VISIBILITY_PRIVATE = 2;
2121 }
2222
23+// IssuesMode says who may write issues in a repository.
24+enum IssuesMode {
25+ // Not set.
26+ ISSUES_MODE_UNSPECIFIED = 0;
27+ // Issues are disabled.
28+ ISSUES_MODE_OFF = 1;
29+ // Only the owner may write issues.
30+ ISSUES_MODE_OWNER = 2;
31+ // Issues are open to public participation.
32+ ISSUES_MODE_PUBLIC = 3;
33+}
34+
2335 // RepoSettings are the settings of a repository that govern its merge
24-// requests.
36+// requests and issues.
2537 message RepoSettings {
2638 // AllowedMergeModes are the modes with which a merge request of the
2739 // repository may be merged. It is never empty in a response and has no
@@ -33,6 +45,8 @@ message RepoSettings {
3345 // explicitly, so a later change of the server default never alters an
3446 // existing repository.
3547 bool failing_checks_block = 2;
48+ // Issues is the issue participation mode of the repository.
49+ IssuesMode issues = 3;
3650 }
3751
3852 // Repo is the metadata of a repository. Git-owned state (refs, trees, history)
@@ -53,7 +67,7 @@ message Repo {
5367 google.protobuf.Timestamp created_at = 5;
5468 // PushedAt is the time of the last push. It is unset until the first push.
5569 google.protobuf.Timestamp pushed_at = 6;
56- // Settings are the merge settings of the repository. Always set in a
70+ // Settings are the settings of the repository. Always set in a
5771 // response, with the defaults for a repository that never changed them.
5872 RepoSettings settings = 7;
5973 // Topics classify the repository, as on GitHub: at most 20, each 1-50
@@ -153,8 +167,10 @@ message UpdateRepoRequest {
153167 string default_branch = 4;
154168 // UpdateMask lists the fields to change: "description", "visibility",
155169 // "default_branch", "topics", "settings.allowed_merge_modes" and/or
156- // "settings.failing_checks_block". "settings" stands for both settings
157- // paths. It must not be empty. Other paths are invalid_argument.
170+ // "settings.failing_checks_block". "settings" stands for both merge settings
171+ // paths. It must not be empty unless issues is set. Other paths are
172+ // invalid_argument, including "settings.issues" and "issues": the issues
173+ // field is applied outside the mask.
158174 google.protobuf.FieldMask update_mask = 5;
159175 // Settings holds the new merge settings. Only the fields named in
160176 // update_mask are used. allowed_merge_modes must then not be empty nor
@@ -165,6 +181,12 @@ message UpdateRepoRequest {
165181 // Topics replace the topics of the repository (see Repo.topics). Used only
166182 // if update_mask contains "topics"; an empty list then clears them.
167183 repeated string topics = 7;
184+ // Issues is the new issue participation mode. When absent it is unchanged.
185+ // It is applied whatever update_mask contains, and may be the only change
186+ // (an empty update_mask is then valid). When present it must not be
187+ // ISSUES_MODE_UNSPECIFIED: that is invalid_argument. Changing it needs the
188+ // repo:admin scope and a token with no branch limit, like any other field.
189+ optional IssuesMode issues = 8;
168190 }
169191
170192 // UpdateRepoResponse holds the repository after the update.
@@ -20,8 +20,20 @@ enum Visibility {
20 VISIBILITY_PRIVATE = 2;20 VISIBILITY_PRIVATE = 2;
21 }21 }
22 22
23+// IssuesMode says who may write issues in a repository.
24+enum IssuesMode {
25+ // Not set.
26+ ISSUES_MODE_UNSPECIFIED = 0;
27+ // Issues are disabled.
28+ ISSUES_MODE_OFF = 1;
29+ // Only the owner may write issues.
30+ ISSUES_MODE_OWNER = 2;
31+ // Issues are open to public participation.
32+ ISSUES_MODE_PUBLIC = 3;
33+}
34+
23 // RepoSettings are the settings of a repository that govern its merge35 // RepoSettings are the settings of a repository that govern its merge
24-// requests.36+// requests and issues.
25 message RepoSettings {37 message RepoSettings {
26 // AllowedMergeModes are the modes with which a merge request of the38 // AllowedMergeModes are the modes with which a merge request of the
27 // repository may be merged. It is never empty in a response and has no39 // repository may be merged. It is never empty in a response and has no
@@ -33,6 +45,8 @@ message RepoSettings {
33 // explicitly, so a later change of the server default never alters an45 // explicitly, so a later change of the server default never alters an
34 // existing repository.46 // existing repository.
35 bool failing_checks_block = 2;47 bool failing_checks_block = 2;
48+ // Issues is the issue participation mode of the repository.
49+ IssuesMode issues = 3;
36 }50 }
37 51
38 // Repo is the metadata of a repository. Git-owned state (refs, trees, history)52 // Repo is the metadata of a repository. Git-owned state (refs, trees, history)
@@ -53,7 +67,7 @@ message Repo {
53 google.protobuf.Timestamp created_at = 5;67 google.protobuf.Timestamp created_at = 5;
54 // PushedAt is the time of the last push. It is unset until the first push.68 // PushedAt is the time of the last push. It is unset until the first push.
55 google.protobuf.Timestamp pushed_at = 6;69 google.protobuf.Timestamp pushed_at = 6;
56- // Settings are the merge settings of the repository. Always set in a70+ // Settings are the settings of the repository. Always set in a
57 // response, with the defaults for a repository that never changed them.71 // response, with the defaults for a repository that never changed them.
58 RepoSettings settings = 7;72 RepoSettings settings = 7;
59 // Topics classify the repository, as on GitHub: at most 20, each 1-5073 // Topics classify the repository, as on GitHub: at most 20, each 1-50
@@ -153,8 +167,10 @@ message UpdateRepoRequest {
153 string default_branch = 4;167 string default_branch = 4;
154 // UpdateMask lists the fields to change: "description", "visibility",168 // UpdateMask lists the fields to change: "description", "visibility",
155 // "default_branch", "topics", "settings.allowed_merge_modes" and/or169 // "default_branch", "topics", "settings.allowed_merge_modes" and/or
156- // "settings.failing_checks_block". "settings" stands for both settings170+ // "settings.failing_checks_block". "settings" stands for both merge settings
157- // paths. It must not be empty. Other paths are invalid_argument.171+ // paths. It must not be empty unless issues is set. Other paths are
172+ // invalid_argument, including "settings.issues" and "issues": the issues
173+ // field is applied outside the mask.
158 google.protobuf.FieldMask update_mask = 5;174 google.protobuf.FieldMask update_mask = 5;
159 // Settings holds the new merge settings. Only the fields named in175 // Settings holds the new merge settings. Only the fields named in
160 // update_mask are used. allowed_merge_modes must then not be empty nor176 // update_mask are used. allowed_merge_modes must then not be empty nor
@@ -165,6 +181,12 @@ message UpdateRepoRequest {
165 // Topics replace the topics of the repository (see Repo.topics). Used only181 // Topics replace the topics of the repository (see Repo.topics). Used only
166 // if update_mask contains "topics"; an empty list then clears them.182 // if update_mask contains "topics"; an empty list then clears them.
167 repeated string topics = 7;183 repeated string topics = 7;
184+ // Issues is the new issue participation mode. When absent it is unchanged.
185+ // It is applied whatever update_mask contains, and may be the only change
186+ // (an empty update_mask is then valid). When present it must not be
187+ // ISSUES_MODE_UNSPECIFIED: that is invalid_argument. Changing it needs the
188+ // repo:admin scope and a token with no branch limit, like any other field.
189+ optional IssuesMode issues = 8;
168 }190 }
169 191
170 // UpdateRepoResponse holds the repository after the update.192 // UpdateRepoResponse holds the repository after the update.
M proto/ermite/token.proto +3 -0
@@ -42,6 +42,9 @@ enum Scope {
4242 // SCOPE_MR_REVIEW allows setting a verdict (approve, changes requested) on
4343 // merge request notes. Wire name: mr:review.
4444 SCOPE_MR_REVIEW = 10;
45+ // SCOPE_ISSUE_WRITE allows creating, commenting on, closing and reopening
46+ // issues. Wire name: issue:write.
47+ SCOPE_ISSUE_WRITE = 11;
4548 }
4649
4750 // Token describes a stored token. It never contains the secret nor its hash.
@@ -42,6 +42,9 @@ enum Scope {
42 // SCOPE_MR_REVIEW allows setting a verdict (approve, changes requested) on42 // SCOPE_MR_REVIEW allows setting a verdict (approve, changes requested) on
43 // merge request notes. Wire name: mr:review.43 // merge request notes. Wire name: mr:review.
44 SCOPE_MR_REVIEW = 10;44 SCOPE_MR_REVIEW = 10;
45+ // SCOPE_ISSUE_WRITE allows creating, commenting on, closing and reopening
46+ // issues. Wire name: issue:write.
47+ SCOPE_ISSUE_WRITE = 11;
45 }48 }
46 49
47 // Token describes a stored token. It never contains the secret nor its hash.50 // Token describes a stored token. It never contains the secret nor its hash.

Comments0 open / 0

no comments yet.

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
l
merge request: the list of files (j k move, enter opens, esc back)
M
merge request: the merge menu; there 1–3 pick the mode, D deletes the branch, enter merges
R
merge request: mark the head read
esc
close a dialog, leave a field

Branches 2

Tags 18

↑↓ moveenter openesc close