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