Adrià Vilanova Martínez | f19ea43 | 2024-01-23 20:20:52 +0100 | [diff] [blame] | 1 | // 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. |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 4 | |
| 5 | // This file defines protobufs for issues and related business |
| 6 | // objects, e.g., field values, comments, and attachments. |
| 7 | |
| 8 | syntax = "proto3"; |
| 9 | |
| 10 | package monorail; |
| 11 | |
Adrià Vilanova Martínez | de94280 | 2022-07-15 14:06:55 +0200 | [diff] [blame] | 12 | option go_package = "infra/monorailv2/api/api_proto;monorail"; |
| 13 | |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 14 | import "google/protobuf/wrappers.proto"; |
| 15 | import "api/api_proto/common.proto"; |
| 16 | |
| 17 | |
| 18 | // Next available tag: 8 |
| 19 | message Approval { |
| 20 | FieldRef field_ref = 1; |
| 21 | repeated UserRef approver_refs = 2; |
| 22 | ApprovalStatus status = 3; |
| 23 | fixed32 set_on = 4; |
| 24 | UserRef setter_ref = 5; |
| 25 | PhaseRef phase_ref = 7; |
| 26 | } |
| 27 | |
| 28 | |
| 29 | // Next available tag: 8 |
| 30 | enum ApprovalStatus { |
| 31 | NOT_SET = 0; |
| 32 | NEEDS_REVIEW = 1; |
| 33 | NA = 2; |
| 34 | REVIEW_REQUESTED = 3; |
| 35 | REVIEW_STARTED = 4; |
| 36 | NEED_INFO = 5; |
| 37 | APPROVED = 6; |
| 38 | NOT_APPROVED = 7; |
| 39 | } |
| 40 | |
| 41 | |
| 42 | // This message is only suitable for displaying the amendment to users. |
| 43 | // We don't currently offer structured amendments that client code can |
| 44 | // reason about, field names can be ambiguous, and we don't have |
| 45 | // old_value for most changes. |
| 46 | // Next available tag: 4 |
| 47 | message Amendment { |
| 48 | // This may be the name of a built-in or custom field, or relative to |
| 49 | // an approval field name. |
| 50 | string field_name = 1; |
| 51 | // This may be a new value that overwrote the old value, e.g., "Assigned", |
| 52 | // or it may be a space-separated list of changes, e.g., "Size-L -Size-S". |
| 53 | string new_or_delta_value = 2; |
| 54 | // old_value is only used when the user changes the summary. |
| 55 | string old_value = 3; |
| 56 | } |
| 57 | |
| 58 | |
| 59 | // Next available tag: 9 |
| 60 | message Attachment { |
| 61 | uint64 attachment_id = 1; |
| 62 | string filename = 2; |
| 63 | uint64 size = 3; // Size in bytes. |
| 64 | string content_type = 4; |
| 65 | bool is_deleted = 5; |
| 66 | string thumbnail_url = 6; |
| 67 | string view_url = 7; |
| 68 | string download_url = 8; |
| 69 | } |
| 70 | |
| 71 | |
| 72 | // Next available tag: 16 |
| 73 | message Comment { |
| 74 | string project_name = 1; |
| 75 | uint32 local_id = 2; |
| 76 | uint32 sequence_num = 3; |
| 77 | bool is_deleted = 4; |
| 78 | UserRef commenter = 5; |
| 79 | fixed32 timestamp = 6; |
| 80 | string content = 7; |
| 81 | string inbound_message = 8; |
| 82 | repeated Amendment amendments = 9; |
| 83 | repeated Attachment attachments = 10; |
| 84 | FieldRef approval_ref = 11; |
| 85 | // If set, this comment is an issue description. |
| 86 | uint32 description_num = 12; |
| 87 | bool is_spam = 13; |
| 88 | bool can_delete = 14; |
| 89 | bool can_flag = 15; |
| 90 | } |
| 91 | |
| 92 | |
| 93 | // Next available tag: 5 |
| 94 | message FieldValue { |
| 95 | FieldRef field_ref = 1; |
| 96 | string value = 2; |
| 97 | bool is_derived = 3; |
| 98 | PhaseRef phase_ref = 4; |
| 99 | } |
| 100 | |
| 101 | |
Adrià Vilanova Martínez | f19ea43 | 2024-01-23 20:20:52 +0100 | [diff] [blame] | 102 | // Next available tag: 29 |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 103 | message Issue { |
| 104 | string project_name = 1; |
| 105 | uint32 local_id = 2; |
| 106 | string summary = 3; |
| 107 | StatusRef status_ref = 4; |
| 108 | UserRef owner_ref = 5; |
| 109 | repeated UserRef cc_refs = 6; |
| 110 | repeated LabelRef label_refs = 7; |
| 111 | repeated ComponentRef component_refs = 8; |
| 112 | repeated IssueRef blocked_on_issue_refs = 9; |
| 113 | repeated IssueRef blocking_issue_refs = 10; |
| 114 | repeated IssueRef dangling_blocked_on_refs = 23; |
| 115 | repeated IssueRef dangling_blocking_refs = 24; |
| 116 | IssueRef merged_into_issue_ref = 11; |
| 117 | repeated FieldValue field_values = 12; |
| 118 | bool is_deleted = 13; |
| 119 | UserRef reporter_ref = 14; |
| 120 | fixed32 opened_timestamp = 15; |
| 121 | fixed32 closed_timestamp = 16; |
| 122 | fixed32 modified_timestamp = 17; |
| 123 | fixed32 component_modified_timestamp = 25; |
| 124 | fixed32 status_modified_timestamp = 26; |
| 125 | fixed32 owner_modified_timestamp = 27; |
| 126 | uint32 star_count = 18; |
| 127 | bool is_spam = 19; |
| 128 | uint32 attachment_count = 20; |
| 129 | repeated Approval approval_values = 21; |
| 130 | repeated PhaseDef phases = 22; |
Adrià Vilanova Martínez | f19ea43 | 2024-01-23 20:20:52 +0100 | [diff] [blame] | 131 | string migrated_id = 28; |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 132 | } |
| 133 | |
| 134 | |
| 135 | // Next available tag: 18 |
| 136 | message IssueDelta { |
| 137 | // Note: We use StringValue instead of string so that we can |
| 138 | // check if delta.HasField('status'). Proto3 only allows that |
| 139 | // for nested messages and provides "boxed" values for this purpose. |
| 140 | // In JSON, a StringValue is represented as a simple string. |
| 141 | google.protobuf.StringValue status = 1; |
| 142 | UserRef owner_ref = 2; |
| 143 | repeated UserRef cc_refs_add = 3; |
| 144 | repeated UserRef cc_refs_remove = 4; |
| 145 | repeated ComponentRef comp_refs_add = 5; |
| 146 | repeated ComponentRef comp_refs_remove = 6; |
| 147 | repeated LabelRef label_refs_add = 7; |
| 148 | repeated LabelRef label_refs_remove = 8; |
| 149 | repeated FieldValue field_vals_add = 9; |
| 150 | repeated FieldValue field_vals_remove = 10; |
| 151 | repeated FieldRef fields_clear = 11; |
| 152 | repeated IssueRef blocked_on_refs_add = 12; |
| 153 | repeated IssueRef blocked_on_refs_remove = 13; |
| 154 | repeated IssueRef blocking_refs_add = 14; |
| 155 | repeated IssueRef blocking_refs_remove = 15; |
| 156 | IssueRef merged_into_ref = 16; |
| 157 | google.protobuf.StringValue summary = 17; |
| 158 | } |
| 159 | |
| 160 | |
| 161 | // Next available tag: 7 |
| 162 | message ApprovalDelta { |
| 163 | ApprovalStatus status = 1; |
| 164 | repeated UserRef approver_refs_add = 2; |
| 165 | repeated UserRef approver_refs_remove = 3; |
| 166 | repeated FieldValue field_vals_add = 4; |
| 167 | repeated FieldValue field_vals_remove = 5; |
| 168 | repeated FieldRef fields_clear = 6; |
| 169 | } |
| 170 | |
| 171 | |
| 172 | // Next available tag: 3 |
| 173 | message AttachmentUpload { |
| 174 | string filename = 1; |
| 175 | bytes content = 2; |
| 176 | } |
| 177 | |
| 178 | |
| 179 | // Next available tag: 4 |
| 180 | message IssueSummary { |
| 181 | string project_name = 1; |
| 182 | uint32 local_id = 2; |
| 183 | string summary = 3; |
| 184 | } |
| 185 | |
| 186 | |
| 187 | // Next available tag: 3 |
| 188 | message PhaseDef { |
| 189 | PhaseRef phase_ref = 1; |
| 190 | uint32 rank = 2; |
| 191 | } |
| 192 | |
| 193 | |
| 194 | // Next available tag: 2 |
| 195 | message PhaseRef { |
| 196 | string phase_name = 1; |
| 197 | } |
| 198 | |
| 199 | |
| 200 | // Next available tag: 7 |
| 201 | enum SearchScope { |
| 202 | ALL = 0; |
| 203 | NEW = 1; |
| 204 | OPEN = 2; |
| 205 | OWNED = 3; |
| 206 | REPORTED = 4; |
| 207 | STARRED = 5; |
| 208 | TO_VERIFY = 6; |
| 209 | } |