blob: 93ccd9a240aa2a52d69924b1fde0539aeed0326d [file] [log] [blame]
Adrià Vilanova Martínezf19ea432024-01-23 20:20:52 +01001// Copyright 2018 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Copybara854996b2021-09-07 19:36:02 +00004
5syntax = "proto3";
6
7package monorail;
8
Adrià Vilanova Martínezde942802022-07-15 14:06:55 +02009option go_package = "infra/monorailv2/api/api_proto;monorail";
10
Copybara854996b2021-09-07 19:36:02 +000011import "google/protobuf/empty.proto";
12import "api/api_proto/common.proto";
13import "api/api_proto/issue_objects.proto";
14import "api/api_proto/project_objects.proto";
15
16
17service Issues {
18 rpc CreateIssue (CreateIssueRequest) returns (IssueResponse) {}
19 rpc GetIssue (GetIssueRequest) returns (IssueResponse) {}
20 rpc ListIssues (ListIssuesRequest) returns (ListIssuesResponse) {}
21 rpc ListReferencedIssues(ListReferencedIssuesRequest) returns (ListReferencedIssuesResponse) {}
22 rpc ListApplicableFieldDefs(ListApplicableFieldDefsRequest) returns (ListApplicableFieldDefsResponse) {}
23 rpc UpdateIssue (UpdateIssueRequest) returns (IssueResponse) {}
24 rpc StarIssue (StarIssueRequest) returns (StarIssueResponse) {}
25 rpc IsIssueStarred (IsIssueStarredRequest) returns (IsIssueStarredResponse) {}
26 rpc ListStarredIssues (ListStarredIssuesRequest) returns (ListStarredIssuesResponse) {}
27 // There is no CreateComment method because comments are created by updates,
28 // which may have just comment content and no delta.
29 // There is no GetComment method, clients should use ListComments.
30 rpc ListComments (ListCommentsRequest) returns (ListCommentsResponse) {}
31 rpc ListActivities (ListActivitiesRequest) returns (ListActivitiesResponse) {}
32 rpc DeleteComment (DeleteCommentRequest) returns (google.protobuf.Empty) {}
33 rpc BulkUpdateApprovals (BulkUpdateApprovalsRequest) returns (BulkUpdateApprovalsResponse) {}
34 rpc UpdateApproval (UpdateApprovalRequest) returns (UpdateApprovalResponse) {}
35 rpc ConvertIssueApprovalsTemplate (ConvertIssueApprovalsTemplateRequest) returns (ConvertIssueApprovalsTemplateResponse) {}
36 rpc IssueSnapshot (IssueSnapshotRequest) returns (IssueSnapshotResponse) {}
37 rpc PresubmitIssue (PresubmitIssueRequest) returns (PresubmitIssueResponse) {}
38 rpc RerankBlockedOnIssues (RerankBlockedOnIssuesRequest) returns (RerankBlockedOnIssuesResponse) {}
39 rpc DeleteIssue (DeleteIssueRequest) returns (DeleteIssueResponse) {}
40 rpc DeleteIssueComment (DeleteIssueCommentRequest) returns (DeleteIssueCommentResponse) {}
41 rpc DeleteAttachment (DeleteAttachmentRequest) returns (DeleteAttachmentResponse) {}
42 rpc FlagIssues (FlagIssuesRequest) returns (FlagIssuesResponse) {}
43 rpc FlagComment (FlagCommentRequest) returns (FlagCommentResponse) {}
44 rpc ListIssuePermissions (ListIssuePermissionsRequest) returns (ListIssuePermissionsResponse) {}
45 rpc MoveIssue (MoveIssueRequest) returns (MoveIssueResponse) {}
46 rpc CopyIssue (CopyIssueRequest) returns (CopyIssueResponse) {}
47}
48
49
50// Next available tag: 4
51message CreateIssueRequest {
52 string project_name = 2;
53 Issue issue = 3;
54}
55
56
57// Next available tag: 3
58message GetIssueRequest {
59 IssueRef issue_ref = 2;
60}
61
62
63// Next available tag: 3
64message IssueResponse {
65 Issue issue = 1;
66 IssueRef moved_to_ref = 2;
67}
68
69
70// Next available tag: 8
71message ListIssuesRequest {
72 string query = 2;
73 uint32 canned_query = 3;
74 repeated string project_names = 4;
75 Pagination pagination = 5;
76 string group_by_spec = 6;
77 string sort_spec = 7;
78}
79
80
81// Next available tag: 3
82message ListIssuesResponse {
83 repeated Issue issues = 1;
84 uint32 total_results = 2;
85}
86
87
88// Next available tag: 3
89message ListReferencedIssuesRequest {
90 repeated IssueRef issue_refs = 2;
91}
92
93
94// Next available tag: 2
95message ListReferencedIssuesResponse {
96 // TODO(ehmaldonado): monorail:4033 Rename these fields to issues rather than
97 // refs.
98 repeated Issue open_refs = 1;
99 repeated Issue closed_refs = 2;
100}
101
102
103// Next available tag: 3
104message ListApplicableFieldDefsRequest {
105 repeated IssueRef issue_refs = 2;
106}
107
108
109// Next available tag: 2
110message ListApplicableFieldDefsResponse {
111 repeated FieldDef field_defs = 1;
112}
113
114
115// Next available tag: 9
116message UpdateIssueRequest {
117 IssueRef issue_ref = 2;
118 bool send_email = 3;
119 IssueDelta delta = 4;
120 string comment_content = 5;
121 bool is_description = 6;
122 repeated AttachmentUpload uploads = 7;
123 repeated int64 kept_attachments = 8;
124}
125
126
127// Next available tag: 4
128message StarIssueRequest {
129 IssueRef issue_ref = 2;
130 bool starred = 3; // True to add a star, False to remove one.
131}
132
133
134// Next available tag: 2
135message StarIssueResponse {
136 uint32 star_count = 1;
137}
138
139
140// Next available tag: 3
141message IsIssueStarredRequest {
142 IssueRef issue_ref = 2;
143}
144
145
146// Next available tag: 2
147message IsIssueStarredResponse {
148 bool is_starred = 1;
149}
150
151
152// Next available tag: 1
153message ListStarredIssuesRequest {
154}
155
156
157// Next available tag: 2
158message ListStarredIssuesResponse {
159 repeated IssueRef starred_issue_refs = 1;
160}
161
162
163// Next available tag: 3
164message ListCommentsRequest {
165 IssueRef issue_ref = 2;
166}
167
168
169// Next available tag: 2
170message ListCommentsResponse {
171 // Comments are in chronological order. The list of comments may
172 // include deleted, spam, and description comments. Spam and
173 // deleted comments will only have content supplied if the user is
174 // allowed to see it.
175 repeated Comment comments = 1;
176}
177
178
179// Next available tag: 5
180message ListActivitiesRequest {
181 // TODO(tyreej) description
182 UserRef user_ref = 2;
183 fixed32 before = 3;
184 fixed32 after = 4;
185}
186
187
188// Next available tag: 3
189message ListActivitiesResponse {
190 // TODO(tyreej) description
191 repeated Comment comments = 1;
192 repeated IssueSummary issue_summaries = 2;
193}
194
195
196// Next available tag: 5
197message DeleteCommentRequest {
198 IssueRef issue_ref = 2;
199 int64 sequence_num = 3;
200 bool delete = 4; // True to delete, False to undelete.
201}
202
203
204// TODO: Consider eventually replacing calls to UpdateApprovalRequest
205// with BulkUpdateApprovalsRequest.
206// TODO: For now, block bulk attaching uploads and survey editing.
207// Next available tag: 7
208message BulkUpdateApprovalsRequest {
209 repeated IssueRef issue_refs = 2;
210 FieldRef field_ref = 3;
211 ApprovalDelta approval_delta = 4;
212 string comment_content = 5;
213 bool send_email = 6;
214}
215
216
217// Next available tag: 2
218message BulkUpdateApprovalsResponse {
219 repeated IssueRef issue_refs = 1;
220}
221
222
223// Next available tag: 10
224message UpdateApprovalRequest {
225 IssueRef issue_ref = 2;
226 FieldRef field_ref = 3;
227 ApprovalDelta approval_delta = 4;
228 string comment_content = 5;
229 bool send_email = 6;
230 bool is_description = 7;
231 repeated AttachmentUpload uploads = 8;
232 repeated int64 kept_attachments = 9;
233}
234
235
236// Next available tag: 2
237message UpdateApprovalResponse {
238 Approval approval = 1;
239 // TODO(jojwang): monorail:3895, add new_comment field.
240}
241
242
243// Next available tag: 6
244message ConvertIssueApprovalsTemplateRequest {
245 IssueRef issue_ref = 2;
246 string template_name = 3;
247 string comment_content = 4;
248 bool send_email = 5;
249}
250
251
252// Next available tag: 2
253message ConvertIssueApprovalsTemplateResponse {
254 Issue issue = 1;
255}
256
257
258// Next available tag: 9
259message IssueSnapshotRequest {
260 int32 timestamp = 2;
261 string query = 3;
262 int32 canned_query = 4;
263 string group_by = 5;
264 string label_prefix = 6;
265 string project_name = 7;
266 int32 hotlist_id = 8;
267}
268
269
270// Next available tag: 3
271message IssueSnapshotCount {
272 string dimension = 1;
273 int32 count = 2;
274}
275
276
277// Next available tag: 3
278message IssueSnapshotResponse {
279 repeated IssueSnapshotCount snapshot_count = 1;
280 repeated string unsupported_field = 2;
281 bool search_limit_reached = 3;
282}
283
284
285// Next available tag: 4
286message PresubmitIssueRequest {
287 IssueRef issue_ref = 2;
288 IssueDelta issue_delta = 3;
289}
290
291
292// Next available tag: 8
293message PresubmitIssueResponse {
294 string owner_availability = 1;
295 string owner_availability_state = 2;
296 repeated ValueAndWhy derived_labels = 3;
297 repeated ValueAndWhy derived_owners = 4;
298 repeated ValueAndWhy derived_ccs = 5;
299 repeated ValueAndWhy warnings = 6;
300 repeated ValueAndWhy errors = 7;
301}
302
303
304// Next available tag: 6
305message RerankBlockedOnIssuesRequest {
306 IssueRef issue_ref = 2;
307 IssueRef moved_ref = 3;
308 IssueRef target_ref = 4;
309 bool split_above = 5;
310}
311
312
313// Next available tag: 2
314message RerankBlockedOnIssuesResponse {
315 repeated IssueRef blocked_on_issue_refs = 1;
316}
317
318
319// Next available tag: 4
320message DeleteIssueRequest {
321 IssueRef issue_ref = 2;
322 bool delete = 3;
323}
324
325
326// Next available tag: 1
327message DeleteIssueResponse {
328}
329
330
331// Next available tag: 5
332message DeleteIssueCommentRequest {
333 IssueRef issue_ref = 2;
334 uint32 sequence_num = 3;
335 bool delete = 4;
336}
337
338
339// Next available tag: 1
340message DeleteIssueCommentResponse {
341}
342
343
344// Next available tag: 6
345message DeleteAttachmentRequest {
346 IssueRef issue_ref = 2;
347 uint32 sequence_num = 3;
348 uint32 attachment_id = 4;
349 bool delete = 5;
350}
351
352
353// Next available tag: 1
354message DeleteAttachmentResponse {
355}
356
357
358// Next available tag: 4
359message FlagIssuesRequest {
360 repeated IssueRef issue_refs = 2;
361 bool flag = 3;
362}
363
364
365// Next available tag: 1
366message FlagIssuesResponse {
367}
368
369
370// Next available tag: 5
371message FlagCommentRequest {
372 IssueRef issue_ref = 2;
373 uint32 sequence_num = 3;
374 bool flag = 4;
375}
376
377
378// Next available tag: 1
379message FlagCommentResponse {
380}
381
382
383// Next available tag: 3
384message ListIssuePermissionsRequest {
385 IssueRef issue_ref = 2;
386}
387
388
389// Next available tag: 2
390message ListIssuePermissionsResponse {
391 repeated string permissions = 1;
392}
393
394
395// Next available tag: 4
396message MoveIssueRequest {
397 IssueRef issue_ref = 2;
398 string target_project_name = 3;
399}
400
401
402// Next available tag: 2
403message MoveIssueResponse {
404 IssueRef new_issue_ref = 1;
405}
406
407
408// Next available tag: 4
409message CopyIssueRequest {
410 IssueRef issue_ref = 2;
411 string target_project_name = 3;
412}
413
414
415// Next available tag: 2
416message CopyIssueResponse {
417 IssueRef new_issue_ref = 1;
418}