blob: 3a59f09f0506d98e75f2613df8abdb6af993ac09 [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.
Luca Milanesioef806d32024-04-06 09:16:24 -070034// Next ID: 26
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;
Luca Milanesioef806d32024-04-06 09:16:24 -070053 optional string server_id = 25;
Alice Kober-Sotzek342b8362018-12-05 17:42:47 +010054
55 // Deleted fields, should not be reused:
Patrick Hieselbd700ed2021-05-25 09:03:59 +020056 reserved 3; // row_version
Dave Borowitz2839aa62018-12-13 14:46:03 -080057 reserved 6; // sortkey
58 reserved 9; // open
59 reserved 11; // nbrPatchSets
60 reserved 15; // lastSha1MergeTested
61 reserved 16; // mergeable
Kamil Musin2a9ff782023-02-06 13:54:07 +010062 reserved 19; // assignee
Dave Borowitz2839aa62018-12-13 14:46:03 -080063 reserved 101; // note_db_state
Alice Kober-Sotzek09cdbd92018-12-05 17:16:21 +010064}
65
Myriam Anisbeae81f2024-03-13 14:31:42 +000066// Serialized form of com.google.gerrit.extensions.common.ChangeInput.
67// Next ID: 19
68message ChangeInput {
69 optional string project = 1;
70 optional string branch = 2;
71 optional string subject = 3;
72 optional string topic = 4;
73 optional ChangeStatus status = 5;
74 optional bool is_private = 6;
75 optional bool work_in_progress = 7;
76 optional string base_change = 8;
77 optional string base_commit = 9;
78 optional bool new_branch = 10;
79 map<string, string> validation_options = 11;
80 map<string, string> custom_keyed_values = 12;
81 optional MergeInput merge = 13;
82 optional ApplyPatchInput patch = 14;
83 optional AccountInput author = 15;
84 repeated ListChangesOption response_format_options = 16;
85 optional NotifyHandling notify = 17 [default = ALL];
86 // The key is the string representation of the RecipientType enum.
87 // We use a string here because proto does not allow enum keys in maps.
88 map<string, NotifyInfo> notify_details = 18;
89}
90
David Ostrovskyb03a6e92019-05-26 14:11:47 +020091// Serialized form of com.google.gerrit.enities.ChangeMessage.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +010092// Next ID: 3
93message ChangeMessage_Key {
94 required Change_Id change_id = 1;
95 required string uuid = 2;
96}
97
David Ostrovskyb03a6e92019-05-26 14:11:47 +020098// Serialized form of com.google.gerrit.entities.ChangeMessage.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +010099// Next ID: 8
100message ChangeMessage {
101 required ChangeMessage_Key key = 1;
102 optional Account_Id author_id = 2;
103 optional fixed64 written_on = 3;
104 optional string message = 4;
105 optional PatchSet_Id patchset = 5;
106 optional string tag = 6;
107 optional Account_Id real_author = 7;
108}
109
Myriam Anisbeae81f2024-03-13 14:31:42 +0000110// Serialized form of com.google.gerrit.extensions.client.ChangeStatus.
111// Next ID: 3
112enum ChangeStatus {
113 NEW = 0;
114 MERGED = 1;
115 ABANDONED = 2;
116}
117
118// Serialized form of com.google.gerrit.extensions.common.MergeInput.
119// Next ID: 5
120message MergeInput {
121 optional string source = 1;
122 optional string source_branch = 2;
123 optional string strategy = 3;
124 optional bool allow_conflicts = 4;
125}
126
127// Serialized form of com.google.gerrit.extensions.api.changes.ApplyPatchInput.
Patrick Hieselace0e4c2024-05-16 16:37:29 +0200128// Next ID: 3
Myriam Anisbeae81f2024-03-13 14:31:42 +0000129message ApplyPatchInput {
130 optional string patch = 1;
Patrick Hieselace0e4c2024-05-16 16:37:29 +0200131 optional bool allow_conflicts = 2;
Myriam Anisbeae81f2024-03-13 14:31:42 +0000132}
133
134// Serialized form of com.google.gerrit.extensions.api.accounts.AccountInput.
135// Next ID: 8
136message AccountInput {
137 optional string username = 1;
138 optional string name = 2;
139 optional string display_name = 3;
140 optional string email = 4;
141 optional string ssh_key = 5;
142 optional string http_password = 6;
143 repeated string groups = 7;
144}
145
146// Serialized form of com.google.gerrit.extensions.client.ListChangesOption.
147// Next ID: 28
148enum ListChangesOption {
149 LABELS = 0;
150 CURRENT_REVISION = 1;
151 ALL_REVISIONS = 2;
152 CURRENT_COMMIT = 3;
153 ALL_COMMITS = 4;
154 CURRENT_FILES = 5;
155 ALL_FILES = 6;
156 DETAILED_ACCOUNTS = 7;
157 DETAILED_LABELS = 8;
158 MESSAGES = 9;
159 CURRENT_ACTIONS = 10;
160 REVIEWED = 11;
161 DRAFT_COMMENTS = 12;
162 DOWNLOAD_COMMANDS = 13;
163 WEB_LINKS = 14;
164 CHECK = 15;
165 CHANGE_ACTIONS = 16;
166 COMMIT_FOOTERS = 17;
167 PUSH_CERTIFICATES = 18;
168 REVIEWER_UPDATES = 19;
169 SUBMITTABLE = 20;
170 TRACKING_IDS = 21;
171 SKIP_MERGEABLE = 22;
172 SKIP_DIFFSTAT = 23;
173 SUBMIT_REQUIREMENTS = 24;
174 CUSTOM_KEYED_VALUES = 25;
175 STAR = 26;
176 PARENTS = 27;
177}
178
179// Serialized form of com.google.gerrit.extensions.api.changes.NotifyHandling.
180// Next ID: 4
181enum NotifyHandling {
182 NONE = 0;
183 OWNER = 1;
184 OWNER_REVIEWERS = 2;
185 ALL = 3;
186}
187
188// Serialized form of com.google.gerrit.extensions.api.changes.RecipientType.
189// Next ID: 3
190enum RecipientType {
191 TO = 0;
192 CC = 1;
193 BCC = 2;
194}
195
196// Serialized form of com.google.gerrit.extensions.api.changes.NotifyInfo.
197// Next ID: 2
198message NotifyInfo {
199 repeated string accounts = 1;
200}
201
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200202// Serialized form of com.google.gerrit.entities.PatchSet.Id.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100203// Next ID: 3
204message PatchSet_Id {
205 required Change_Id change_id = 1;
Dave Borowitz766a93d2019-04-19 08:44:05 -0700206 required int32 id = 2;
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100207}
208
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200209// Serialized form of com.google.gerrit.entities.PatchSet.
Youssef Elghareeb4c115442023-06-15 18:16:42 +0200210// Next ID: 12
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100211message PatchSet {
212 required PatchSet_Id id = 1;
Dave Borowitz20a984f2019-04-23 14:19:25 -0700213 optional ObjectId commitId = 2;
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100214 optional Account_Id uploader_account_id = 3;
215 optional fixed64 created_on = 4;
216 optional string groups = 6;
217 optional string push_certificate = 8;
218 optional string description = 9;
Edwin Kempinccc9da02023-01-23 17:57:15 +0100219 optional Account_Id real_uploader_account_id = 10;
Youssef Elghareeb4c115442023-06-15 18:16:42 +0200220 optional string branch = 11;
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100221
222 // Deleted fields, should not be reused:
223 reserved 5; // draft
224 reserved 7; // pushCertficate
225}
226
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200227// Serialized form of com.google.gerrit.entities.Account.Id.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100228// Next ID: 2
229message Account_Id {
230 required int32 id = 1;
231}
232
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200233// Serialized form of com.google.gerrit.entities.LabelId.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100234// Next ID: 2
235message LabelId {
236 required string id = 1;
237}
238
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200239// Serialized form of com.google.gerrit.entities.PatchSetApproval.Key.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100240// Next ID: 4
241message PatchSetApproval_Key {
242 required PatchSet_Id patch_set_id = 1;
243 required Account_Id account_id = 2;
Dave Borowitzc144e782019-04-17 12:53:07 -0700244 required LabelId label_id = 3;
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100245}
246
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200247// Serialized form of com.google.gerrit.entities.PatchSetApproval.
Marija Savtchoukd5283202021-11-26 12:14:04 +0000248// Next ID: 11
Alice Kober-Sotzek09cdbd92018-12-05 17:16:21 +0100249message PatchSetApproval {
Alice Kober-Sotzek342b8362018-12-05 17:42:47 +0100250 required PatchSetApproval_Key key = 1;
251 optional int32 value = 2;
252 optional fixed64 granted = 3;
253 optional string tag = 6;
254 optional Account_Id real_account_id = 7;
255 optional bool post_submit = 8;
Gal Paikin5381c5f2021-09-06 17:35:48 +0200256 optional bool copied = 9;
Marija Savtchoukd5283202021-11-26 12:14:04 +0000257 optional string uuid = 10;
Alice Kober-Sotzek342b8362018-12-05 17:42:47 +0100258
259 // Deleted fields, should not be reused:
260 reserved 4; // changeOpen
261 reserved 5; // changeSortKey
Alice Kober-Sotzek09cdbd92018-12-05 17:16:21 +0100262}
263
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200264// Serialized form of com.google.gerrit.entities.Project.NameKey.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100265// Next ID: 2
266message Project_NameKey {
267 optional string name = 1;
268}
269
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200270// Serialized form of com.google.gerrit.entities.Branch.NameKey.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100271// Next ID: 3
272message Branch_NameKey {
Dave Borowitzac3b3d62019-04-17 15:53:44 -0700273 optional Project_NameKey project = 1;
274 optional string branch = 2;
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100275}
276
Dave Borowitz20a984f2019-04-23 14:19:25 -0700277// Serialized form of org.eclipse.jgit.lib.ObjectId.
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100278// Next ID: 2
Dave Borowitz20a984f2019-04-23 14:19:25 -0700279message ObjectId {
280 // Hex string representation of the ID.
Nitzan Gur-Furman6ac80d52024-05-08 12:15:03 +0000281 optional string name = 1 [default="0000000000000000000000000000000000000000"];
Alice Kober-Sotzek97d3e422018-12-05 17:49:11 +0100282}
Youssef Elghareeb875bc6f2023-09-07 14:37:34 +0200283
284// Serialized form of a continuation token used for pagination.
285// Next ID: 2
286message PaginationToken {
287 optional string next_page_token = 1;
288}
Nitzan Gur-Furman61581322023-09-15 09:59:29 +0200289
290// Proto representation of the User preferences classes
291// Next ID: 4
292message UserPreferences {
Nitzan Gur-Furmanea2936d2024-05-15 11:43:42 +0000293 // Next ID: 26
Nitzan Gur-Furman61581322023-09-15 09:59:29 +0200294 message GeneralPreferencesInfo {
295 // Number of changes to show in a screen.
296 optional int32 changes_per_page = 1 [default = 25];
297
298 // Type of download URL the user prefers to use. */
299 optional string download_scheme = 2;
300
301 enum Theme {
302 AUTO = 0;
303 DARK = 1;
304 LIGHT = 2;
305 }
306 optional Theme theme = 3;
307
308 enum DateFormat {
309 STD = 0;
310 US = 1;
311 ISO = 2;
312 EURO = 3;
313 UK = 4;
314 }
315 optional DateFormat date_format = 4;
316
317 enum TimeFormat {
318 HHMM_12 = 0;
319 HHMM_24 = 1;
320 }
321 optional TimeFormat time_format = 5;
322
323 optional bool expand_inline_diffs = 6;
324 optional bool relative_date_in_change_table = 20;
325
326 enum DiffView {
327 SIDE_BY_SIDE = 0;
328 UNIFIED_DIFF = 1;
329 }
330 optional DiffView diff_view = 21;
331
332 optional bool size_bar_in_change_table = 22 [default = true];
333 optional bool legacycid_in_change_table = 7;
334 optional bool mute_common_path_prefixes = 8 [default = true];
335 optional bool signed_off_by = 9;
336
337 enum EmailStrategy {
338 ENABLED = 0;
339 CC_ON_OWN_COMMENTS = 1;
340 ATTENTION_SET_ONLY = 2;
341 DISABLED = 3;
342 }
343 optional EmailStrategy email_strategy = 10;
344
345 enum EmailFormat {
346 PLAINTEXT = 0;
347 HTML_PLAINTEXT = 1;
348 }
349 optional EmailFormat email_format = 11 [default = HTML_PLAINTEXT];
350
351 enum DefaultBase {
352 AUTO_MERGE = 0;
353 FIRST_PARENT = 1;
354 }
355 optional DefaultBase default_base_for_merges = 12 [default = FIRST_PARENT];
356
357 optional bool publish_comments_on_push = 13;
358 optional bool disable_keyboard_shortcuts = 14;
359 optional bool disable_token_highlighting = 15;
360 optional bool work_in_progress_by_default = 16;
361
362 message MenuItem {
363 optional string url = 1;
364 optional string name = 2;
365 optional string target = 3;
366 optional string id = 4;
367 }
368 repeated MenuItem my_menu_items = 17;
369
370 repeated string change_table = 18;
371 optional bool allow_browser_notifications = 19 [default = true];
Nitzan Gur-Furmanea2936d2024-05-15 11:43:42 +0000372 optional bool allow_suggest_code_while_commenting = 24 [default = true];
373 optional bool allow_autocompleting_comments = 25 [default = true];
Frank Bordena12b3d42023-10-17 14:55:17 +0200374 optional string diff_page_sidebar = 23 [default = "NONE"];
Nitzan Gur-Furman61581322023-09-15 09:59:29 +0200375 }
376 optional GeneralPreferencesInfo general_preferences_info = 1;
377
378 // Next ID: 25
379 message DiffPreferencesInfo {
380 optional int32 context = 1 [default = 10];
381 optional int32 tab_size = 2 [default = 8];
382 optional int32 font_size = 3 [default = 12];
383 optional int32 line_length = 4 [default = 100];
384 optional int32 cursor_blink_rate = 5;
385 optional bool expand_all_comments = 6;
386 optional bool intraline_difference = 7 [default = true];
387 optional bool manual_review = 8;
388 optional bool show_line_endings = 9 [default = true];
389 optional bool show_tabs = 10 [default = true];
390 optional bool show_whitespace_errors = 11 [default = true];
391 optional bool syntax_highlighting = 12 [default = true];
392 optional bool hide_top_menu = 13;
393 optional bool auto_hide_diff_table_header = 14 [default = true];
394 optional bool hide_line_numbers = 15;
395 optional bool render_entire_file = 16;
396 optional bool hide_empty_pane = 17;
397 optional bool match_brackets = 18;
398 optional bool line_wrapping = 19;
399
400 enum Whitespace {
401 IGNORE_NONE = 0;
402 IGNORE_TRAILING = 1;
403 IGNORE_LEADING_AND_TRAILING = 2;
404 IGNORE_ALL = 3;
405 }
406 optional Whitespace ignore_whitespace = 20;
407
408 optional bool retain_header = 21;
409 optional bool skip_deleted = 22;
410 optional bool skip_unchanged = 23;
411 optional bool skip_uncommented = 24;
412 }
413 optional DiffPreferencesInfo diff_preferences_info = 2;
414
415 // Next ID: 15
416 message EditPreferencesInfo {
417 optional int32 tab_size = 1 [default = 8];
418 optional int32 line_length = 2 [default = 100];
419 optional int32 indent_unit = 3 [default = 2];
420 optional int32 cursor_blink_rate = 4;
421 optional bool hide_top_menu = 5;
422 optional bool show_tabs = 6 [default = true];
423 optional bool show_whitespace_errors = 7;
424 optional bool syntax_highlighting = 8 [default = true];
425 optional bool hide_line_numbers = 9;
426 optional bool match_brackets = 10 [default = true];
427 optional bool line_wrapping = 11;
428 optional bool indent_with_tabs = 12;
429 optional bool auto_close_brackets = 13;
430 optional bool show_base = 14;
431 }
432 optional EditPreferencesInfo edit_preferences_info = 3;
433}
Nitzan Gur-Furman31c53012023-11-20 23:02:59 +0100434
435// Next Id: 13
436message HumanComment {
437 // Required. Note that the equivalent Java struct does not contain the change
438 // ID, so we keep the same format here.
439 optional int32 patchset_id = 1;
440 optional ObjectId dest_commit_id = 2;
441 // Required.
442 optional Account_Id account_id = 3;
443 optional Account_Id real_author = 4;
444
445 // Next Id: 5
446 message InFilePosition {
447 optional string file_path = 1;
448 enum Side {
449 // Should match the logic in
450 // http://google3/third_party/java_src/gerritcodereview/gerrit/java/com/google/gerrit/extensions/client/Side.java?rcl=579772037&l=24
451 PARENT = 0;
452 REVISION = 1;
453 }
454 // Default should match
455 // http://google3/third_party/java_src/gerritcodereview/gerrit/Documentation/rest-api-changes.txt?l=7423
456 optional Side side = 2 [default = REVISION];
457 message Range {
458 // 1-based
Nitzan Gur-Furman6ac80d52024-05-08 12:15:03 +0000459 optional int32 start_line = 1 [default = 1];
Nitzan Gur-Furman31c53012023-11-20 23:02:59 +0100460 // 0-based
461 optional int32 start_char = 2;
462 // 1-based
Nitzan Gur-Furman6ac80d52024-05-08 12:15:03 +0000463 optional int32 end_line = 3 [default = 1];
Nitzan Gur-Furman31c53012023-11-20 23:02:59 +0100464 // 0-based
465 optional int32 end_char = 4;
466 }
467 // If neither range nor line number set, the comment is on the file level. It is possible
468 // (though not required) for both values to be set. in this case, it is expected that the line
469 // number is identical to the range's end line.
470 optional Range position_range = 3;
471 // 1-based
Nitzan Gur-Furman6ac80d52024-05-08 12:15:03 +0000472 optional int32 line_number = 4 [default = 1];
Nitzan Gur-Furman31c53012023-11-20 23:02:59 +0100473 }
474
475 // If not set, the comment is on the patchset level.
476 optional InFilePosition in_file_position = 5;
477
478 // Required.
479 optional string comment_text = 6;
480 // Might be set by the user while creating the draft.
481 // See http://go/gerrit-rest-api-change#comment-info.
482 optional string tag = 7;
483 optional bool unresolved = 8 [default = false];
484
485 // Required.
486 optional string comment_uuid = 9;
487 // Required.
488 optional string parent_comment_uuid = 10;
489
490 // Required. Epoch millis.
491 optional fixed64 written_on_millis = 11;
492 // Required.
493 optional string server_id = 12;
Nitzan Gur-Furman6ac80d52024-05-08 12:15:03 +0000494}