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