blob: 335db62a886e9d36ac0b37e61f2d843ef140f099 [file] [log] [blame]
Alice Kober-Sotzek09cdbd92018-12-05 17:16:21 +01001// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto2";
16
Alice Kober-Sotzek342b8362018-12-05 17:42:47 +010017package devtools.gerritcodereview;
18
Alice Kober-Sotzek5af77ef2018-12-14 16:48:58 +010019option java_package = "com.google.gerrit.proto";
Alice Kober-Sotzek09cdbd92018-12-05 17:16:21 +010020
David Ostrovskyb03a6e92019-05-26 14:11:47 +020021// Serialized form of com.google.gerrit.entities.Change.Id.
Alice Kober-Sotzek342b8362018-12-05 17:42:47 +010022// Next ID: 2
Alice Kober-Sotzek09cdbd92018-12-05 17:16:21 +010023message Change_Id {
Alice Kober-Sotzek342b8362018-12-05 17:42:47 +010024 required int32 id = 1;
Alice Kober-Sotzek09cdbd92018-12-05 17:16:21 +010025}
26
David Ostrovskyb03a6e92019-05-26 14:11:47 +020027// Serialized form of com.google.gerrit.entities.Change.Key.
Alice Kober-Sotzek342b8362018-12-05 17:42:47 +010028// Next ID: 2
Alice Kober-Sotzek09cdbd92018-12-05 17:16:21 +010029message Change_Key {
Alice Kober-Sotzek342b8362018-12-05 17:42:47 +010030 optional string id = 1;
Alice Kober-Sotzek09cdbd92018-12-05 17:16:21 +010031}
32
David Ostrovskyb03a6e92019-05-26 14:11:47 +020033// Serialized form of com.google.gerrit.entities.Change.
Kaushik Lingarkar4a711ed2019-11-12 13:53:29 -080034// Next ID: 25
Alice Kober-Sotzek09cdbd92018-12-05 17:16:21 +010035message Change {
Alice Kober-Sotzek342b8362018-12-05 17:42:47 +010036 required Change_Id change_id = 1;
37 optional Change_Key change_key = 2;
Alice Kober-Sotzek342b8362018-12-05 17:42:47 +010038 optional fixed64 created_on = 4;
39 optional fixed64 last_updated_on = 5;
40 optional Account_Id owner_account_id = 7;
41 optional Branch_NameKey dest = 8;
42 optional uint32 status = 10;
43 optional int32 current_patch_set_id = 12;
44 optional string subject = 13;
45 optional string topic = 14;
46 optional string original_subject = 17;
47 optional string submission_id = 18;
Alice Kober-Sotzek342b8362018-12-05 17:42:47 +010048 optional bool is_private = 20;
49 optional bool work_in_progress = 21;
50 optional bool review_started = 22;
51 optional Change_Id revert_of = 23;
Kaushik Lingarkar4a711ed2019-11-12 13:53:29 -080052 optional PatchSet_Id cherry_pick_of = 24;
Alice Kober-Sotzek342b8362018-12-05 17:42:47 +010053
54 // Deleted fields, should not be reused:
Patrick Hieselbd700ed2021-05-25 09:03:59 +020055 reserved 3; // row_version
Dave Borowitz2839aa62018-12-13 14:46:03 -080056 reserved 6; // sortkey
57 reserved 9; // open
58 reserved 11; // nbrPatchSets
59 reserved 15; // lastSha1MergeTested
60 reserved 16; // mergeable
Kamil Musin2a9ff782023-02-06 13:54:07 +010061 reserved 19; // assignee
Dave Borowitz2839aa62018-12-13 14:46:03 -080062 reserved 101; // note_db_state
Alice Kober-Sotzek09cdbd92018-12-05 17:16:21 +010063}
64
David Ostrovskyb03a6e92019-05-26 14:11:47 +020065// Serialized form of com.google.gerrit.enities.ChangeMessage.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +010066// Next ID: 3
67message ChangeMessage_Key {
68 required Change_Id change_id = 1;
69 required string uuid = 2;
70}
71
David Ostrovskyb03a6e92019-05-26 14:11:47 +020072// Serialized form of com.google.gerrit.entities.ChangeMessage.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +010073// Next ID: 8
74message ChangeMessage {
75 required ChangeMessage_Key key = 1;
76 optional Account_Id author_id = 2;
77 optional fixed64 written_on = 3;
78 optional string message = 4;
79 optional PatchSet_Id patchset = 5;
80 optional string tag = 6;
81 optional Account_Id real_author = 7;
82}
83
David Ostrovskyb03a6e92019-05-26 14:11:47 +020084// Serialized form of com.google.gerrit.entities.PatchSet.Id.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +010085// Next ID: 3
86message PatchSet_Id {
87 required Change_Id change_id = 1;
Dave Borowitz766a93d2019-04-19 08:44:05 -070088 required int32 id = 2;
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +010089}
90
David Ostrovskyb03a6e92019-05-26 14:11:47 +020091// Serialized form of com.google.gerrit.entities.PatchSet.
Youssef Elghareeb4c115442023-06-15 18:16:42 +020092// Next ID: 12
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +010093message PatchSet {
94 required PatchSet_Id id = 1;
Dave Borowitz20a984f2019-04-23 14:19:25 -070095 optional ObjectId commitId = 2;
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +010096 optional Account_Id uploader_account_id = 3;
97 optional fixed64 created_on = 4;
98 optional string groups = 6;
99 optional string push_certificate = 8;
100 optional string description = 9;
Edwin Kempinccc9da02023-01-23 17:57:15 +0100101 optional Account_Id real_uploader_account_id = 10;
Youssef Elghareeb4c115442023-06-15 18:16:42 +0200102 optional string branch = 11;
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100103
104 // Deleted fields, should not be reused:
105 reserved 5; // draft
106 reserved 7; // pushCertficate
107}
108
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200109// Serialized form of com.google.gerrit.entities.Account.Id.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100110// Next ID: 2
111message Account_Id {
112 required int32 id = 1;
113}
114
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200115// Serialized form of com.google.gerrit.entities.LabelId.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100116// Next ID: 2
117message LabelId {
118 required string id = 1;
119}
120
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200121// Serialized form of com.google.gerrit.entities.PatchSetApproval.Key.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100122// Next ID: 4
123message PatchSetApproval_Key {
124 required PatchSet_Id patch_set_id = 1;
125 required Account_Id account_id = 2;
Dave Borowitzc144e782019-04-17 12:53:07 -0700126 required LabelId label_id = 3;
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100127}
128
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200129// Serialized form of com.google.gerrit.entities.PatchSetApproval.
Marija Savtchoukd5283202021-11-26 12:14:04 +0000130// Next ID: 11
Alice Kober-Sotzek09cdbd92018-12-05 17:16:21 +0100131message PatchSetApproval {
Alice Kober-Sotzek342b8362018-12-05 17:42:47 +0100132 required PatchSetApproval_Key key = 1;
133 optional int32 value = 2;
134 optional fixed64 granted = 3;
135 optional string tag = 6;
136 optional Account_Id real_account_id = 7;
137 optional bool post_submit = 8;
Gal Paikin5381c5f2021-09-06 17:35:48 +0200138 optional bool copied = 9;
Marija Savtchoukd5283202021-11-26 12:14:04 +0000139 optional string uuid = 10;
Alice Kober-Sotzek342b8362018-12-05 17:42:47 +0100140
141 // Deleted fields, should not be reused:
142 reserved 4; // changeOpen
143 reserved 5; // changeSortKey
Alice Kober-Sotzek09cdbd92018-12-05 17:16:21 +0100144}
145
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200146// Serialized form of com.google.gerrit.entities.Project.NameKey.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100147// Next ID: 2
148message Project_NameKey {
149 optional string name = 1;
150}
151
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200152// Serialized form of com.google.gerrit.entities.Branch.NameKey.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100153// Next ID: 3
154message Branch_NameKey {
Dave Borowitzac3b3d62019-04-17 15:53:44 -0700155 optional Project_NameKey project = 1;
156 optional string branch = 2;
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100157}
158
Dave Borowitz20a984f2019-04-23 14:19:25 -0700159// Serialized form of org.eclipse.jgit.lib.ObjectId.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100160// Next ID: 2
Dave Borowitz20a984f2019-04-23 14:19:25 -0700161message ObjectId {
162 // Hex string representation of the ID.
163 optional string name = 1;
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100164}
Youssef Elghareeb875bc6f2023-09-07 14:37:34 +0200165
166// Serialized form of a continuation token used for pagination.
167// Next ID: 2
168message PaginationToken {
169 optional string next_page_token = 1;
170}
Nitzan Gur-Furman61581322023-09-15 09:59:29 +0200171
172// Proto representation of the User preferences classes
173// Next ID: 4
174message UserPreferences {
Frank Bordena12b3d42023-10-17 14:55:17 +0200175 // Next ID: 24
Nitzan Gur-Furman61581322023-09-15 09:59:29 +0200176 message GeneralPreferencesInfo {
177 // Number of changes to show in a screen.
178 optional int32 changes_per_page = 1 [default = 25];
179
180 // Type of download URL the user prefers to use. */
181 optional string download_scheme = 2;
182
183 enum Theme {
184 AUTO = 0;
185 DARK = 1;
186 LIGHT = 2;
187 }
188 optional Theme theme = 3;
189
190 enum DateFormat {
191 STD = 0;
192 US = 1;
193 ISO = 2;
194 EURO = 3;
195 UK = 4;
196 }
197 optional DateFormat date_format = 4;
198
199 enum TimeFormat {
200 HHMM_12 = 0;
201 HHMM_24 = 1;
202 }
203 optional TimeFormat time_format = 5;
204
205 optional bool expand_inline_diffs = 6;
206 optional bool relative_date_in_change_table = 20;
207
208 enum DiffView {
209 SIDE_BY_SIDE = 0;
210 UNIFIED_DIFF = 1;
211 }
212 optional DiffView diff_view = 21;
213
214 optional bool size_bar_in_change_table = 22 [default = true];
215 optional bool legacycid_in_change_table = 7;
216 optional bool mute_common_path_prefixes = 8 [default = true];
217 optional bool signed_off_by = 9;
218
219 enum EmailStrategy {
220 ENABLED = 0;
221 CC_ON_OWN_COMMENTS = 1;
222 ATTENTION_SET_ONLY = 2;
223 DISABLED = 3;
224 }
225 optional EmailStrategy email_strategy = 10;
226
227 enum EmailFormat {
228 PLAINTEXT = 0;
229 HTML_PLAINTEXT = 1;
230 }
231 optional EmailFormat email_format = 11 [default = HTML_PLAINTEXT];
232
233 enum DefaultBase {
234 AUTO_MERGE = 0;
235 FIRST_PARENT = 1;
236 }
237 optional DefaultBase default_base_for_merges = 12 [default = FIRST_PARENT];
238
239 optional bool publish_comments_on_push = 13;
240 optional bool disable_keyboard_shortcuts = 14;
241 optional bool disable_token_highlighting = 15;
242 optional bool work_in_progress_by_default = 16;
243
244 message MenuItem {
245 optional string url = 1;
246 optional string name = 2;
247 optional string target = 3;
248 optional string id = 4;
249 }
250 repeated MenuItem my_menu_items = 17;
251
252 repeated string change_table = 18;
253 optional bool allow_browser_notifications = 19 [default = true];
Frank Bordena12b3d42023-10-17 14:55:17 +0200254 optional string diff_page_sidebar = 23 [default = "NONE"];
Nitzan Gur-Furman61581322023-09-15 09:59:29 +0200255 }
256 optional GeneralPreferencesInfo general_preferences_info = 1;
257
258 // Next ID: 25
259 message DiffPreferencesInfo {
260 optional int32 context = 1 [default = 10];
261 optional int32 tab_size = 2 [default = 8];
262 optional int32 font_size = 3 [default = 12];
263 optional int32 line_length = 4 [default = 100];
264 optional int32 cursor_blink_rate = 5;
265 optional bool expand_all_comments = 6;
266 optional bool intraline_difference = 7 [default = true];
267 optional bool manual_review = 8;
268 optional bool show_line_endings = 9 [default = true];
269 optional bool show_tabs = 10 [default = true];
270 optional bool show_whitespace_errors = 11 [default = true];
271 optional bool syntax_highlighting = 12 [default = true];
272 optional bool hide_top_menu = 13;
273 optional bool auto_hide_diff_table_header = 14 [default = true];
274 optional bool hide_line_numbers = 15;
275 optional bool render_entire_file = 16;
276 optional bool hide_empty_pane = 17;
277 optional bool match_brackets = 18;
278 optional bool line_wrapping = 19;
279
280 enum Whitespace {
281 IGNORE_NONE = 0;
282 IGNORE_TRAILING = 1;
283 IGNORE_LEADING_AND_TRAILING = 2;
284 IGNORE_ALL = 3;
285 }
286 optional Whitespace ignore_whitespace = 20;
287
288 optional bool retain_header = 21;
289 optional bool skip_deleted = 22;
290 optional bool skip_unchanged = 23;
291 optional bool skip_uncommented = 24;
292 }
293 optional DiffPreferencesInfo diff_preferences_info = 2;
294
295 // Next ID: 15
296 message EditPreferencesInfo {
297 optional int32 tab_size = 1 [default = 8];
298 optional int32 line_length = 2 [default = 100];
299 optional int32 indent_unit = 3 [default = 2];
300 optional int32 cursor_blink_rate = 4;
301 optional bool hide_top_menu = 5;
302 optional bool show_tabs = 6 [default = true];
303 optional bool show_whitespace_errors = 7;
304 optional bool syntax_highlighting = 8 [default = true];
305 optional bool hide_line_numbers = 9;
306 optional bool match_brackets = 10 [default = true];
307 optional bool line_wrapping = 11;
308 optional bool indent_with_tabs = 12;
309 optional bool auto_close_brackets = 13;
310 optional bool show_base = 14;
311 }
312 optional EditPreferencesInfo edit_preferences_info = 3;
313}
Nitzan Gur-Furman31c53012023-11-20 23:02:59 +0100314
315// Next Id: 13
316message HumanComment {
317 // Required. Note that the equivalent Java struct does not contain the change
318 // ID, so we keep the same format here.
319 optional int32 patchset_id = 1;
320 optional ObjectId dest_commit_id = 2;
321 // Required.
322 optional Account_Id account_id = 3;
323 optional Account_Id real_author = 4;
324
325 // Next Id: 5
326 message InFilePosition {
327 optional string file_path = 1;
328 enum Side {
329 // Should match the logic in
330 // http://google3/third_party/java_src/gerritcodereview/gerrit/java/com/google/gerrit/extensions/client/Side.java?rcl=579772037&l=24
331 PARENT = 0;
332 REVISION = 1;
333 }
334 // Default should match
335 // http://google3/third_party/java_src/gerritcodereview/gerrit/Documentation/rest-api-changes.txt?l=7423
336 optional Side side = 2 [default = REVISION];
337 message Range {
338 // 1-based
339 optional int32 start_line = 1;
340 // 0-based
341 optional int32 start_char = 2;
342 // 1-based
343 optional int32 end_line = 3;
344 // 0-based
345 optional int32 end_char = 4;
346 }
347 // If neither range nor line number set, the comment is on the file level. It is possible
348 // (though not required) for both values to be set. in this case, it is expected that the line
349 // number is identical to the range's end line.
350 optional Range position_range = 3;
351 // 1-based
352 optional int32 line_number = 4;
353 }
354
355 // If not set, the comment is on the patchset level.
356 optional InFilePosition in_file_position = 5;
357
358 // Required.
359 optional string comment_text = 6;
360 // Might be set by the user while creating the draft.
361 // See http://go/gerrit-rest-api-change#comment-info.
362 optional string tag = 7;
363 optional bool unresolved = 8 [default = false];
364
365 // Required.
366 optional string comment_uuid = 9;
367 // Required.
368 optional string parent_comment_uuid = 10;
369
370 // Required. Epoch millis.
371 optional fixed64 written_on_millis = 11;
372 // Required.
373 optional string server_id = 12;
374}