Implement parsing submit requirements from project.config As per the new "Composable submit requirements" design (see I32e9863c8d), we define the new submit requirements and store them in the project's config file. In this change, submit requirements are loaded from project.config (if they exist) and cached as part of the CachedProjectConfig. Notes: 1) Later on, we should implement syntax validation of the applicability/blocking/override expressions while loading the submit requirements from the project config. 2) There is no need to increase the version of the persisted project cache. This cache is keyed by the SHA-1 of refs/mata/config making all cache entries immutable. When a new change updates refs/meta/config for a project, a reload of the CacheProjectConfig will be enforced with a new SHA-1 in the key. This change didn't document the new section definition in project.config. A follow up change should be added for the documentation after the logic for submittability is implemented. Change-Id: I9bb7d5a681aedf8ebb5361b1b5ecf2c73a4c0be3
diff --git a/proto/cache.proto b/proto/cache.proto index 292a225..b1722b4 100644 --- a/proto/cache.proto +++ b/proto/cache.proto
@@ -468,6 +468,17 @@ bool copy_all_scores_if_list_of_files_did_not_change = 19; } +// Serialized form of com.google.gerrit.entities.SubmitRequirement. +// Next ID: 7 +message SubmitRequirementProto { + string name = 1; + string description = 2; + string applicability_expression = 3; + string blocking_expression = 4; + string override_expression = 5; + bool allow_override_in_child_projects = 6; +} + // Serialized form of com.google.gerrit.server.project.ConfiguredMimeTypes. // Next ID: 4 message ConfiguredMimeTypeProto { @@ -496,7 +507,7 @@ } // Serialized form of com.google.gerrit.entities.CachedProjectConfigProto. -// Next ID: 19 +// Next ID: 20 message CachedProjectConfigProto { ProjectProto project = 1; repeated GroupReferenceProto group_list = 2; @@ -516,6 +527,7 @@ map<string, ExtensionPanelSectionProto> extension_panels = 16; map<string, string> plugin_configs = 17; map<string, string> project_level_configs = 18; + repeated SubmitRequirementProto submit_requirement_sections = 19; // Next ID: 2 message ExtensionPanelSectionProto {