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