blob: c6edfda0cb79df46bfc1e498d9bf1ed1e24b9b69 [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
6// This file defines protobufs for issues and related business
7// objects, e.g., field values, comments, and attachments.
8
9syntax = "proto3";
10
11package monorail;
12
Adrià Vilanova Martínezde942802022-07-15 14:06:55 +020013option go_package = "infra/monorailv2/api/api_proto;monorail";
14
Copybara854996b2021-09-07 19:36:02 +000015import "google/protobuf/wrappers.proto";
16import "api/api_proto/common.proto";
17
18
19// Next available tag: 8
20message Approval {
21 FieldRef field_ref = 1;
22 repeated UserRef approver_refs = 2;
23 ApprovalStatus status = 3;
24 fixed32 set_on = 4;
25 UserRef setter_ref = 5;
26 PhaseRef phase_ref = 7;
27}
28
29
30// Next available tag: 8
31enum ApprovalStatus {
32 NOT_SET = 0;
33 NEEDS_REVIEW = 1;
34 NA = 2;
35 REVIEW_REQUESTED = 3;
36 REVIEW_STARTED = 4;
37 NEED_INFO = 5;
38 APPROVED = 6;
39 NOT_APPROVED = 7;
40}
41
42
43// This message is only suitable for displaying the amendment to users.
44// We don't currently offer structured amendments that client code can
45// reason about, field names can be ambiguous, and we don't have
46// old_value for most changes.
47// Next available tag: 4
48message Amendment {
49 // This may be the name of a built-in or custom field, or relative to
50 // an approval field name.
51 string field_name = 1;
52 // This may be a new value that overwrote the old value, e.g., "Assigned",
53 // or it may be a space-separated list of changes, e.g., "Size-L -Size-S".
54 string new_or_delta_value = 2;
55 // old_value is only used when the user changes the summary.
56 string old_value = 3;
57}
58
59
60// Next available tag: 9
61message Attachment {
62 uint64 attachment_id = 1;
63 string filename = 2;
64 uint64 size = 3; // Size in bytes.
65 string content_type = 4;
66 bool is_deleted = 5;
67 string thumbnail_url = 6;
68 string view_url = 7;
69 string download_url = 8;
70}
71
72
73// Next available tag: 16
74message Comment {
75 string project_name = 1;
76 uint32 local_id = 2;
77 uint32 sequence_num = 3;
78 bool is_deleted = 4;
79 UserRef commenter = 5;
80 fixed32 timestamp = 6;
81 string content = 7;
82 string inbound_message = 8;
83 repeated Amendment amendments = 9;
84 repeated Attachment attachments = 10;
85 FieldRef approval_ref = 11;
86 // If set, this comment is an issue description.
87 uint32 description_num = 12;
88 bool is_spam = 13;
89 bool can_delete = 14;
90 bool can_flag = 15;
91}
92
93
94// Next available tag: 5
95message FieldValue {
96 FieldRef field_ref = 1;
97 string value = 2;
98 bool is_derived = 3;
99 PhaseRef phase_ref = 4;
100}
101
102
103// Next available tag: 28
104message Issue {
105 string project_name = 1;
106 uint32 local_id = 2;
107 string summary = 3;
108 StatusRef status_ref = 4;
109 UserRef owner_ref = 5;
110 repeated UserRef cc_refs = 6;
111 repeated LabelRef label_refs = 7;
112 repeated ComponentRef component_refs = 8;
113 repeated IssueRef blocked_on_issue_refs = 9;
114 repeated IssueRef blocking_issue_refs = 10;
115 repeated IssueRef dangling_blocked_on_refs = 23;
116 repeated IssueRef dangling_blocking_refs = 24;
117 IssueRef merged_into_issue_ref = 11;
118 repeated FieldValue field_values = 12;
119 bool is_deleted = 13;
120 UserRef reporter_ref = 14;
121 fixed32 opened_timestamp = 15;
122 fixed32 closed_timestamp = 16;
123 fixed32 modified_timestamp = 17;
124 fixed32 component_modified_timestamp = 25;
125 fixed32 status_modified_timestamp = 26;
126 fixed32 owner_modified_timestamp = 27;
127 uint32 star_count = 18;
128 bool is_spam = 19;
129 uint32 attachment_count = 20;
130 repeated Approval approval_values = 21;
131 repeated PhaseDef phases = 22;
132}
133
134
135// Next available tag: 18
136message 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
162message 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
173message AttachmentUpload {
174 string filename = 1;
175 bytes content = 2;
176}
177
178
179// Next available tag: 4
180message IssueSummary {
181 string project_name = 1;
182 uint32 local_id = 2;
183 string summary = 3;
184}
185
186
187// Next available tag: 3
188message PhaseDef {
189 PhaseRef phase_ref = 1;
190 uint32 rank = 2;
191}
192
193
194// Next available tag: 2
195message PhaseRef {
196 string phase_name = 1;
197}
198
199
200// Next available tag: 7
201enum SearchScope {
202 ALL = 0;
203 NEW = 1;
204 OPEN = 2;
205 OWNED = 3;
206 REPORTED = 4;
207 STARRED = 5;
208 TO_VERIFY = 6;
209}