blob: 7924cbdcf808ab2a788aed36221c360d617c38f8 [file] [log] [blame]
Dave Borowitz11f0c642018-04-21 12:04:24 -04001// 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 = "proto3";
16
17package gerrit.cache;
18
19option java_package = "com.google.gerrit.server.cache.proto";
20
21// Serialized form of com.google.gerrit.server.change.CHangeKindCacheImpl.Key.
22// Next ID: 4
23message ChangeKindKeyProto {
24 bytes prior = 1;
25 bytes next = 2;
26 string strategy_name = 3;
27}
Dave Borowitze62a1112018-05-01 09:27:46 -040028
29// Serialized form of
30// com.google.gerrit.server.change.MergeabilityCacheImpl.EntryKey.
31// Next ID: 5
32message MergeabilityKeyProto {
33 bytes commit = 1;
34 bytes into = 2;
35 string submit_type = 3;
36 string merge_strategy = 4;
37}
Dave Borowitze6930d72018-05-01 10:22:02 -040038
39// Serialized form of com.google.gerrit.extensions.auth.oauth.OAuthToken.
40// Next ID: 6
41message OAuthTokenProto {
42 string token = 1;
43 string secret = 2;
44 string raw = 3;
Joerg Zierend5fb7432020-03-02 13:51:04 +010045 // Epoch millis.
46 int64 expires_at_millis = 4;
Dave Borowitz12df29f2018-05-15 16:37:02 -070047 string provider_id = 5;
Dave Borowitze6930d72018-05-01 10:22:02 -040048}
Dave Borowitzbab45862018-05-01 12:31:48 -040049
50
51// Serialized form of com.google.gerrit.server.notedb.ChangeNotesCache.Key.
52// Next ID: 4
53message ChangeNotesKeyProto {
54 string project = 1;
55 int32 change_id = 2;
56 bytes id = 3;
57}
58
59// Serialized from of com.google.gerrit.server.notedb.ChangeNotesState.
60//
61// Note on embedded protos: this is just for storing in a cache, so some formats
62// were chosen ease of coding the initial implementation. In particular, where
63// there already exists another serialization mechanism in Gerrit for
64// serializing a particular field, we use that rather than defining a new proto
Alice Kober-Sotzek14db5312018-12-14 16:06:41 +010065// type. This includes types that can be serialized to proto using
66// ProtoConverters as well as NoteDb and indexed types that are serialized using
67// JSON. We can always revisit this decision later; it just requires bumping the
68// cache version.
Dave Borowitzbab45862018-05-01 12:31:48 -040069//
70// Note on nullability: there are a lot of nullable fields in ChangeNotesState
71// and its dependencies. It's likely we could make some of them non-nullable,
72// but each one of those would be a potentially significant amount of cleanup,
73// and there's no guarantee we'd be able to eliminate all of them. (For a less
74// complex class, it's likely the cleanup would be more feasible.)
75//
76// Instead, we just take the tedious yet simple approach of having a "has_foo"
77// field for each nullable field "foo", indicating whether or not foo is null.
78//
Joerg Zieren361ea4b2020-02-17 16:25:43 +010079// Next ID: 24
Dave Borowitzbab45862018-05-01 12:31:48 -040080message ChangeNotesStateProto {
81 // Effectively required, even though the corresponding ChangeNotesState field
82 // is optional, since the field is only absent when NoteDb is disabled, in
83 // which case attempting to use the ChangeNotesCache is programmer error.
84 bytes meta_id = 1;
85
86 int32 change_id = 2;
87
Kaushik Lingarkar4a711ed2019-11-12 13:53:29 -080088 // Next ID: 26
Dave Borowitzbab45862018-05-01 12:31:48 -040089 message ChangeColumnsProto {
90 string change_key = 1;
91
Joerg Zierend5fb7432020-03-02 13:51:04 +010092 // Epoch millis.
93 int64 created_on_millis = 2;
Dave Borowitzbab45862018-05-01 12:31:48 -040094
Joerg Zierend5fb7432020-03-02 13:51:04 +010095 // Epoch millis.
96 int64 last_updated_on_millis = 3;
Dave Borowitzbab45862018-05-01 12:31:48 -040097
98 int32 owner = 4;
99
100 string branch = 5;
101
102 int32 current_patch_set_id = 6;
103 bool has_current_patch_set_id = 7;
104
105 string subject = 8;
106
107 string topic = 9;
108 bool has_topic = 10;
109
110 string original_subject = 11;
111 bool has_original_subject = 12;
112
113 string submission_id = 13;
114 bool has_submission_id = 14;
115
Gal Paikin23457032019-10-16 15:09:56 +0200116 reserved 15; // assignee
117 reserved 16; // has_assignee
Dave Borowitzbab45862018-05-01 12:31:48 -0400118
119 string status = 17;
120 bool has_status = 18;
121
122 bool is_private = 19;
123
124 bool work_in_progress = 20;
125
126 bool review_started = 21;
127
128 int32 revert_of = 22;
129 bool has_revert_of = 23;
Kaushik Lingarkar4a711ed2019-11-12 13:53:29 -0800130
131 string cherry_pick_of = 24;
132 bool has_cherry_pick_of = 25;
Dave Borowitzbab45862018-05-01 12:31:48 -0400133 }
134 // Effectively required, even though the corresponding ChangeNotesState field
135 // is optional, since the field is only absent when NoteDb is disabled, in
136 // which case attempting to use the ChangeNotesCache is programmer error.
137 ChangeColumnsProto columns = 3;
138
Joerg Zieren361ea4b2020-02-17 16:25:43 +0100139 reserved 4; // past_assignee
Dave Borowitzbab45862018-05-01 12:31:48 -0400140
141 repeated string hashtag = 5;
142
Alice Kober-Sotzek14db5312018-12-14 16:06:41 +0100143 // Raw PatchSet proto as produced by PatchSetProtoConverter.
Dave Borowitzbab45862018-05-01 12:31:48 -0400144 repeated bytes patch_set = 6;
145
Alice Kober-Sotzek14db5312018-12-14 16:06:41 +0100146 // Raw PatchSetApproval proto as produced by PatchSetApprovalProtoConverter.
Dave Borowitzbab45862018-05-01 12:31:48 -0400147 repeated bytes approval = 7;
148
149 // Next ID: 4
150 message ReviewerSetEntryProto {
151 string state = 1;
152 int32 account_id = 2;
Joerg Zierend5fb7432020-03-02 13:51:04 +0100153 // Epoch millis.
154 int64 timestamp_millis = 3;
Dave Borowitzbab45862018-05-01 12:31:48 -0400155 }
156 repeated ReviewerSetEntryProto reviewer = 8;
157
158 // Next ID: 4
159 message ReviewerByEmailSetEntryProto {
160 string state = 1;
161 string address = 2;
Joerg Zierend5fb7432020-03-02 13:51:04 +0100162 // Epoch millis.
163 int64 timestamp_millis = 3;
Dave Borowitzbab45862018-05-01 12:31:48 -0400164 }
165 repeated ReviewerByEmailSetEntryProto reviewer_by_email = 9;
166
167 repeated ReviewerSetEntryProto pending_reviewer = 10;
168
169 repeated ReviewerByEmailSetEntryProto pending_reviewer_by_email = 11;
170
171 repeated int32 past_reviewer = 12;
172
173 // Next ID: 5
174 message ReviewerStatusUpdateProto {
Joerg Zieren361ea4b2020-02-17 16:25:43 +0100175 // Epoch millis.
Joerg Zierend5fb7432020-03-02 13:51:04 +0100176 int64 timestamp_millis = 1;
Dave Borowitzbab45862018-05-01 12:31:48 -0400177 int32 updated_by = 2;
178 int32 reviewer = 3;
179 string state = 4;
180 }
181 repeated ReviewerStatusUpdateProto reviewer_update = 13;
182
183 // JSON produced from
184 // com.google.gerrit.server.index.change.ChangeField.StoredSubmitRecord.
185 repeated string submit_record = 14;
186
Alice Kober-Sotzek14db5312018-12-14 16:06:41 +0100187 // Raw ChangeMessage proto as produced by ChangeMessageProtoConverter.
Dave Borowitzbab45862018-05-01 12:31:48 -0400188 repeated bytes change_message = 15;
189
David Ostrovskyb03a6e92019-05-26 14:11:47 +0200190 // JSON produced from com.google.gerrit.entities.Comment.
Dave Borowitzbab45862018-05-01 12:31:48 -0400191 repeated string published_comment = 16;
192
Dave Borowitzfb2b3232018-12-13 14:30:48 -0800193 reserved 17; // read_only_until
194 reserved 18; // has_read_only_until
Dave Borowitz10edb7c2019-04-15 14:33:22 -0700195
196 // Number of updates to the change's meta ref.
197 int32 update_count = 19;
David Ostrovskyf8367a82019-08-03 17:05:19 +0200198
199 string server_id = 20;
200 bool has_server_id = 21;
Gal Paikin23457032019-10-16 15:09:56 +0200201
202 message AssigneeStatusUpdateProto {
Joerg Zieren361ea4b2020-02-17 16:25:43 +0100203 // Epoch millis.
Joerg Zierend5fb7432020-03-02 13:51:04 +0100204 int64 timestamp_millis = 1;
Gal Paikin23457032019-10-16 15:09:56 +0200205 int32 updated_by = 2;
206 int32 current_assignee = 3;
207 bool has_current_assignee = 4;
208 }
209 repeated AssigneeStatusUpdateProto assignee_update = 22;
Dave Borowitzc15b8ef2018-05-18 08:11:22 -0400210
Joerg Zierenfdbea382020-03-06 13:44:25 +0100211 // An update to the attention set of the change. See class AttentionSetUpdate
212 // for context.
213 message AttentionSetUpdateProto {
Joerg Zieren361ea4b2020-02-17 16:25:43 +0100214 // Epoch millis.
Joerg Zierend5fb7432020-03-02 13:51:04 +0100215 int64 timestamp_millis = 1;
Joerg Zieren361ea4b2020-02-17 16:25:43 +0100216 int32 account = 2;
Joerg Zierenfdbea382020-03-06 13:44:25 +0100217 // Maps to enum AttentionSetUpdate.Operation
Joerg Zieren361ea4b2020-02-17 16:25:43 +0100218 string operation = 3;
219 string reason = 4;
220 }
Joerg Zierenfdbea382020-03-06 13:44:25 +0100221 repeated AttentionSetUpdateProto attention_set_update = 23;
Joerg Zieren361ea4b2020-02-17 16:25:43 +0100222}
Dave Borowitzc15b8ef2018-05-18 08:11:22 -0400223
224// Serialized form of com.google.gerrit.server.query.change.ConflictKey
225message ConflictKeyProto {
226 bytes commit = 1;
227 bytes other_commit = 2;
228 string submit_type = 3;
229 bool content_merge = 4;
230}
Dave Borowitzb30a4142018-07-23 15:28:22 -0700231
232// Serialized form of com.google.gerrit.server.query.git.TagSetHolder.
233// Next ID: 3
234message TagSetHolderProto {
235 string project_name = 1;
236
237 // Next ID: 4
238 message TagSetProto {
239 string project_name = 1;
240
241 // Next ID: 3
242 message CachedRefProto {
243 bytes id = 1;
244 int32 flag = 2;
245 }
246 map<string, CachedRefProto> ref = 2;
247
248 // Next ID: 3
249 message TagProto {
250 bytes id = 1;
251 bytes flags = 2;
252 }
253 repeated TagProto tag = 3;
254 }
255 TagSetProto tags = 2;
256}
Dave Borowitzb20d23a82018-08-21 13:43:10 -0700257
258// Serialized form of
259// com.google.gerrit.server.account.externalids.AllExternalIds.
260// Next ID: 2
261message AllExternalIdsProto {
262 // Next ID: 6
263 message ExternalIdProto {
264 string key = 1;
265 int32 accountId = 2;
266 string email = 3;
267 string password = 4;
268 bytes blobId = 5;
269 }
270 repeated ExternalIdProto external_id = 1;
271}
Patrick Hiesela57c0d62019-02-19 09:09:22 +0100272
Youssef Elghareeb25297242020-03-19 00:13:26 +0100273// Serialized form of a list of com.google.gerrit.entities.AccountGroup.UUID
274// Next ID: 2
275message AllExternalGroupsProto {
276 message ExternalGroupProto {
277 string groupUuid = 1;
278 }
279 repeated ExternalGroupProto external_group = 1;
280}
281
Patrick Hiesela57c0d62019-02-19 09:09:22 +0100282// Key for com.google.gerrit.server.git.PureRevertCache.
283// Next ID: 4
284message PureRevertKeyProto {
285 string project = 1;
286 bytes claimed_original = 2;
287 bytes claimed_revert = 3;
288}
Patrick Hiesel4836e572020-03-05 15:23:29 +0100289
Patrick Hiesele945da32020-03-26 17:22:23 +0100290// Key for com.google.gerrit.server.account.ProjectWatches.
291// Next ID: 4
292message ProjectWatchProto {
Patrick Hiesel4836e572020-03-05 15:23:29 +0100293 string project = 1;
294 string filter = 2;
Patrick Hiesele945da32020-03-26 17:22:23 +0100295 repeated string notify_type = 3;
Patrick Hiesel4836e572020-03-05 15:23:29 +0100296}
Patrick Hiesel58d51292020-03-05 16:24:07 +0100297
298// Serialized form of
299// com.google.gerrit.entities.Account.
300// Next ID: 9
301message AccountProto {
302 int32 id = 1;
303 int64 registered_on = 2;
304 string full_name = 3;
305 string display_name = 4;
306 string preferred_email = 5;
307 bool inactive = 6;
308 string status = 7;
309 string meta_id = 8;
310}
Patrick Hiesele945da32020-03-26 17:22:23 +0100311
312// Serialized form of com.google.gerrit.server.account.CachedAccountDetails.Key.
313// Next ID: 3
314message AccountKeyProto {
315 int32 account_id = 1;
316 bytes id = 2;
317}
318
319// Serialized form of com.google.gerrit.server.account.CachedAccountDetails.
320// Next ID: 4
321message AccountDetailsProto {
322 AccountProto account = 1;
323 repeated ProjectWatchProto project_watch_proto = 2;
324 string user_preferences = 3;
325}
Patrick Hieselffd88ef2020-07-07 10:30:45 +0200326
327// Serialized form of com.google.gerrit.entities.Project.
328// Next ID: 11
329message ProjectProto {
330 string name = 1;
331 string description = 2;
332 map<string, string> boolean_configs = 3;
333 string submit_type = 4; // ENUM as String
334 string state = 5; // ENUM as String
335 string parent = 6;
336 string max_object_size_limit = 7;
337 string default_dashboard = 8;
338 string local_default_dashboard = 9;
339 string config_ref_state = 10;
340}
Patrick Hieseld80bf5a2020-07-10 13:55:39 +0200341
342// Serialized form of com.google.gerrit.common.data.GroupReference.
343// Next ID: 3
344message GroupReferenceProto {
345 string uuid = 1;
346 string name = 2;
347}
Patrick Hieself5575442020-07-10 14:25:51 +0200348
349// Serialized form of com.google.gerrit.common.data.PermissionRule.
350// Next ID: 6
351message PermissionRuleProto {
352 string action = 1; // ENUM as String
353 bool force = 2;
354 int32 min = 3;
355 int32 max = 4;
356 GroupReferenceProto group = 5;
357}
Patrick Hieseld2761e12020-07-13 09:10:11 +0200358
359// Serialized form of com.google.gerrit.common.data.Permission.
360// Next ID: 4
361message PermissionProto {
362 string name = 1;
363 bool exclusive_group = 2;
364 repeated PermissionRuleProto rules = 3;
365}
Patrick Hiesel4c74f002020-07-13 09:22:34 +0200366
367// Serialized form of com.google.gerrit.common.data.AccessSection.
368// Next ID: 3
369message AccessSectionProto {
370 string name = 1;
371 repeated PermissionProto permissions = 2;
372}
Patrick Hiesel9f8e23d2020-07-13 09:35:17 +0200373
374// Serialized form of com.google.gerrit.server.git.BranchOrderSection.
375// Next ID: 2
376message BranchOrderSectionProto {
377 repeated string branches_in_order = 1;
378}
Patrick Hiesel48434b12020-07-13 10:07:49 +0200379
380// Serialized form of com.google.gerrit.common.data.ContributorAgreement.
381// Next ID: 8
382message ContributorAgreementProto {
383 string name = 1;
384 string description = 2;
385 repeated PermissionRuleProto accepted = 3;
386 GroupReferenceProto auto_verify = 4;
387 string url = 5;
388 repeated string exclude_regular_expressions = 6;
389 repeated string match_regular_expressions = 7;
390}
Patrick Hiesel27ab5bd2020-07-13 13:34:39 +0200391
392// Serialized form of com.google.gerrit.entities.Address.
393// Next ID: 3
394message AddressProto {
395 string name = 1;
396 string email = 2;
397}
Patrick Hiesel9b15b9c2020-07-13 14:23:39 +0200398
399// Serialized form of com.google.gerrit.entities.NotifyConfig.
400// Next ID: 7
401message NotifyConfigProto {
402 string name = 1;
403 repeated string type = 2; // ENUM as String
404 string filter = 3;
405 string header = 4; // ENUM as String
406 repeated GroupReferenceProto groups = 5;
407 repeated AddressProto addresses = 6;
408}
Patrick Hiesel58d03c92020-07-14 16:27:17 +0200409
410// Serialized form of com.google.gerrit.entities.LabelValue.
411// Next ID: 3
412message LabelValueProto {
413 string text = 1;
414 int32 value = 2;
415}
Patrick Hiesel4938bda2020-07-15 14:44:23 +0200416
417// Serialized form of com.google.gerrit.common.data.LabelType.
418// Next ID: 19
419message LabelTypeProto {
420 string name = 1;
421 string function = 2; // ENUM as String
422 bool copy_any_score = 3;
423 bool copy_min_score = 4;
424 bool copy_max_score = 5;
425 bool copy_all_scores_on_merge_first_parent_update = 6;
426 bool copy_all_scores_on_trivial_rebase = 7;
427 bool copy_all_scores_if_no_code_change = 8;
428 bool copy_all_scores_if_no_change = 9;
429 repeated int32 copy_values = 10;
430 bool allow_post_submit = 11;
431 bool ignore_self_approval = 12;
432 int32 default_value = 13;
433 repeated LabelValueProto values = 14;
434 int32 max_negative = 15;
435 int32 max_positive = 16;
436 bool can_override = 17;
437 repeated string ref_patterns = 18;
438}
Patrick Hiesel7e579e32020-07-16 10:17:59 +0200439
440// Serialized form of com.google.gerrit.server.project.ConfiguredMimeTypes.
441// Next ID: 4
442message ConfiguredMimeTypeProto {
443 string type = 1;
444 string pattern = 2;
445 bool is_regular_expression = 3;
446}
Patrick Hiesel1c684052020-07-16 10:52:51 +0200447
448// Serialized form of com.google.gerrit.common.data.SubscribeSection.
449// Next ID: 4
450message SubscribeSectionProto {
451 string project_name = 1;
452 repeated string multi_match_ref_specs = 2;
453 repeated string matching_ref_specs = 3;
454}
Patrick Hiesel0a9b9db2020-07-16 12:49:49 +0200455
456// Serialized form of com.google.gerrit.entities.StoredCommentLinkInfo.
457// Next ID: 7
458message StoredCommentLinkInfoProto {
459 string name = 1;
460 string match = 2;
461 string link = 3;
462 string html = 4;
463 bool enabled = 5;
464 bool override_only = 6;
465}
Patrick Hiesel4ba64ae2020-07-16 16:48:50 +0200466
467// Serialized form of com.google.gerrit.entities.CachedProjectConfigProto.
Patrick Hieself9035cc2020-07-23 16:16:21 +0200468// Next ID: 19
Patrick Hiesel4ba64ae2020-07-16 16:48:50 +0200469message CachedProjectConfigProto {
470 ProjectProto project = 1;
471 repeated GroupReferenceProto group_list = 2;
472 repeated PermissionRuleProto accounts_section = 3;
473 repeated AccessSectionProto access_sections = 4;
474 BranchOrderSectionProto branch_order_section = 5;
475 repeated ContributorAgreementProto contributor_agreements = 6;
476 repeated NotifyConfigProto notify_configs = 7;
477 repeated LabelTypeProto label_sections = 8;
478 repeated ConfiguredMimeTypeProto mime_types = 9;
479 repeated SubscribeSectionProto subscribe_sections = 10;
480 repeated StoredCommentLinkInfoProto comment_links = 11;
481 bytes rules_id = 12;
482 bytes revision = 13;
483 int64 max_object_size_limit = 14;
484 bool check_received_objects = 15;
485 map<string, ExtensionPanelSectionProto> extension_panels = 16;
Patrick Hieself9035cc2020-07-23 16:16:21 +0200486 map<string, string> plugin_configs = 17;
487 map<string, string> project_level_configs = 18;
Patrick Hiesel4ba64ae2020-07-16 16:48:50 +0200488
489 // Next ID: 2
490 message ExtensionPanelSectionProto {
491 repeated string section = 1;
492 }
493}
Patrick Hieselc2c108c2020-07-23 09:54:22 +0200494
495// Serialized key for com.google.gerrit.server.project.ProjectCacheImpl.
496// Next ID: 4
497message ProjectCacheKeyProto {
498 string project = 1;
499 bytes revision = 2;
500 bytes global_config_revision = 3; // Hash of All-Projects-projects.config. This
501 // will only be populated for All-Projects.
502}