Serialize CachedProjectConfig

This commit is the final piece of a series that allows us to
serialize CachedProjectConfig. After this commit, we can make
ProjectCache a serialized cache, which speeds up cold-starts.

Entities are moved to com.gerrit.entities where needed.

Change-Id: I501e68ae44d4bdfe0ecc6d000c4eb5644d0bec4c
This commit is contained in:
Patrick Hiesel
2020-07-16 16:48:50 +02:00
parent 535321f497
commit 4ba64aee31
242 changed files with 815 additions and 533 deletions

View File

@@ -49,12 +49,7 @@ import com.google.gerrit.acceptance.testsuite.account.TestSshKeys;
import com.google.gerrit.acceptance.testsuite.project.ProjectOperations; import com.google.gerrit.acceptance.testsuite.project.ProjectOperations;
import com.google.gerrit.acceptance.testsuite.request.RequestScopeOperations; import com.google.gerrit.acceptance.testsuite.request.RequestScopeOperations;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.AccessSection; import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.common.data.LabelFunction;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.Permission;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.common.data.PermissionRule.Action;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.Address; import com.google.gerrit.entities.Address;
@@ -64,8 +59,13 @@ import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.EmailHeader; import com.google.gerrit.entities.EmailHeader;
import com.google.gerrit.entities.GroupDescription; import com.google.gerrit.entities.GroupDescription;
import com.google.gerrit.entities.GroupReference; import com.google.gerrit.entities.GroupReference;
import com.google.gerrit.entities.LabelFunction;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelValue; import com.google.gerrit.entities.LabelValue;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.Permission;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.entities.PermissionRule.Action;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.RefNames; import com.google.gerrit.entities.RefNames;
import com.google.gerrit.extensions.api.GerritApi; import com.google.gerrit.extensions.api.GerritApi;

View File

@@ -26,11 +26,11 @@ import com.google.gerrit.acceptance.testsuite.project.TestProjectCreation.Builde
import com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.TestCapability; import com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.TestCapability;
import com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.TestLabelPermission; import com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.TestLabelPermission;
import com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.TestPermission; import com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.TestPermission;
import com.google.gerrit.common.data.AccessSection; import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.common.data.Permission;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.GroupReference; import com.google.gerrit.entities.GroupReference;
import com.google.gerrit.entities.Permission;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.RefNames; import com.google.gerrit.entities.RefNames;
import com.google.gerrit.server.config.AllProjectsName; import com.google.gerrit.server.config.AllProjectsName;

View File

@@ -15,7 +15,7 @@
package com.google.gerrit.acceptance.testsuite.project; package com.google.gerrit.acceptance.testsuite.project;
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkArgument;
import static com.google.gerrit.common.data.AccessSection.GLOBAL_CAPABILITIES; import static com.google.gerrit.entities.AccessSection.GLOBAL_CAPABILITIES;
import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNull;
import com.google.auto.value.AutoValue; import com.google.auto.value.AutoValue;
@@ -23,11 +23,11 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.gerrit.acceptance.testsuite.ThrowingConsumer; import com.google.gerrit.acceptance.testsuite.ThrowingConsumer;
import com.google.gerrit.common.data.GlobalCapability; import com.google.gerrit.common.data.GlobalCapability;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.Permission;
import com.google.gerrit.common.data.PermissionRange;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.Permission;
import com.google.gerrit.entities.PermissionRange;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.server.config.AllProjectsName; import com.google.gerrit.server.config.AllProjectsName;
import java.util.Optional; import java.util.Optional;

View File

@@ -14,6 +14,8 @@
package com.google.gerrit.common.data; package com.google.gerrit.common.data;
import com.google.gerrit.entities.Permission;
import com.google.gerrit.entities.PermissionRange;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.common.data; package com.google.gerrit.entities;
import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.collect.ImmutableList.toImmutableList;
import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNull;
@@ -20,7 +20,6 @@ import static java.util.Objects.requireNonNull;
import com.google.auto.value.AutoValue; import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.entities.Project;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;

View File

@@ -12,11 +12,10 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.server.project; package com.google.gerrit.entities;
import com.google.auto.value.AutoValue; import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.gerrit.common.data.PermissionRule;
import java.util.List; import java.util.List;
@AutoValue @AutoValue

View File

@@ -12,24 +12,12 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.server.project; package com.google.gerrit.entities;
import com.google.auto.value.AutoValue; import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.gerrit.common.data.AccessSection;
import com.google.gerrit.common.data.ContributorAgreement;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.SubscribeSection;
import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.BranchOrderSection;
import com.google.gerrit.entities.ConfiguredMimeTypes;
import com.google.gerrit.entities.GroupReference;
import com.google.gerrit.entities.NotifyConfig;
import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.StoredCommentLinkInfo;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -37,7 +25,8 @@ import java.util.Optional;
import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectId;
/** /**
* Cached representation of values parsed from {@link ProjectConfig}. * Cached representation of values parsed from {@link
* com.google.gerrit.server.project.ProjectConfig}.
* *
* <p>This class is immutable and thread-safe. * <p>This class is immutable and thread-safe.
*/ */
@@ -53,8 +42,8 @@ public abstract class CachedProjectConfig {
} }
/** /**
* Returns the group reference for a {@link com.google.gerrit.entities.AccountGroup.UUID}, if the * Returns the group reference for a {@link AccountGroup.UUID}, if the group is used by at least
* group is used by at least one rule. * one rule.
*/ */
public Optional<GroupReference> getGroup(AccountGroup.UUID uuid) { public Optional<GroupReference> getGroup(AccountGroup.UUID uuid) {
return Optional.ofNullable(getGroups().get(uuid)); return Optional.ofNullable(getGroups().get(uuid));
@@ -93,10 +82,7 @@ public abstract class CachedProjectConfig {
/** Returns configured {@link ConfiguredMimeTypes}s. */ /** Returns configured {@link ConfiguredMimeTypes}s. */
public abstract ConfiguredMimeTypes getMimeTypes(); public abstract ConfiguredMimeTypes getMimeTypes();
/** /** Returns {@link SubscribeSection} keyed by the {@link Project.NameKey} they reference. */
* Returns {@link SubscribeSection} keyed by the {@link
* com.google.gerrit.entities.Project.NameKey} they reference.
*/
public abstract ImmutableMap<Project.NameKey, SubscribeSection> getSubscribeSections(); public abstract ImmutableMap<Project.NameKey, SubscribeSection> getSubscribeSections();
/** Returns {@link StoredCommentLinkInfo} keyed by their name. */ /** Returns {@link StoredCommentLinkInfo} keyed by their name. */
@@ -126,32 +112,52 @@ public abstract class CachedProjectConfig {
return new AutoValue_CachedProjectConfig.Builder(); return new AutoValue_CachedProjectConfig.Builder();
} }
public abstract Builder toBuilder();
@AutoValue.Builder @AutoValue.Builder
public abstract static class Builder { public abstract static class Builder {
public abstract Builder setProject(Project value); public abstract Builder setProject(Project value);
public abstract Builder setGroups(ImmutableMap<AccountGroup.UUID, GroupReference> value);
public abstract Builder setAccountsSection(AccountsSection value); public abstract Builder setAccountsSection(AccountsSection value);
public abstract Builder setAccessSections(ImmutableMap<String, AccessSection> value);
public abstract Builder setBranchOrderSection(Optional<BranchOrderSection> value); public abstract Builder setBranchOrderSection(Optional<BranchOrderSection> value);
public abstract Builder setContributorAgreements( public Builder addGroup(GroupReference groupReference) {
ImmutableMap<String, ContributorAgreement> value); groupsBuilder().put(groupReference.getUUID(), groupReference);
return this;
}
public abstract Builder setNotifySections(ImmutableMap<String, NotifyConfig> value); public Builder addAccessSection(AccessSection accessSection) {
accessSectionsBuilder().put(accessSection.getName(), accessSection);
return this;
}
public abstract Builder setLabelSections(ImmutableMap<String, LabelType> value); public Builder addContributorAgreement(ContributorAgreement contributorAgreement) {
contributorAgreementsBuilder().put(contributorAgreement.getName(), contributorAgreement);
return this;
}
public Builder addNotifySection(NotifyConfig notifyConfig) {
notifySectionsBuilder().put(notifyConfig.getName(), notifyConfig);
return this;
}
public Builder addLabelSection(LabelType labelType) {
labelSectionsBuilder().put(labelType.getName(), labelType);
return this;
}
public abstract Builder setMimeTypes(ConfiguredMimeTypes value); public abstract Builder setMimeTypes(ConfiguredMimeTypes value);
public abstract Builder setSubscribeSections( public Builder addSubscribeSection(SubscribeSection subscribeSection) {
ImmutableMap<Project.NameKey, SubscribeSection> value); subscribeSectionsBuilder().put(subscribeSection.project(), subscribeSection);
return this;
}
public abstract Builder setCommentLinkSections( public Builder addCommentLinkSection(StoredCommentLinkInfo storedCommentLinkInfo) {
ImmutableMap<String, StoredCommentLinkInfo> value); commentLinkSectionsBuilder().put(storedCommentLinkInfo.getName(), storedCommentLinkInfo);
return this;
}
public abstract Builder setRulesId(Optional<ObjectId> value); public abstract Builder setRulesId(Optional<ObjectId> value);
@@ -161,16 +167,37 @@ public abstract class CachedProjectConfig {
public abstract Builder setCheckReceivedObjects(boolean value); public abstract Builder setCheckReceivedObjects(boolean value);
public abstract Builder setExtensionPanelSections( public abstract ImmutableMap.Builder<String, ImmutableList<String>>
ImmutableMap<String, ImmutableList<String>> value); extensionPanelSectionsBuilder();
public Builder setExtensionPanelSections(Map<String, List<String>> value) { public Builder setExtensionPanelSections(Map<String, List<String>> value) {
ImmutableMap.Builder<String, ImmutableList<String>> b = ImmutableMap.builder(); value
value.entrySet().forEach(e -> b.put(e.getKey(), ImmutableList.copyOf(e.getValue()))); .entrySet()
return setExtensionPanelSections(b.build()); .forEach(
e ->
extensionPanelSectionsBuilder()
.put(e.getKey(), ImmutableList.copyOf(e.getValue())));
return this;
} }
public abstract CachedProjectConfig build(); public abstract CachedProjectConfig build();
protected abstract ImmutableMap.Builder<AccountGroup.UUID, GroupReference> groupsBuilder();
protected abstract ImmutableMap.Builder<String, AccessSection> accessSectionsBuilder();
protected abstract ImmutableMap.Builder<String, ContributorAgreement>
contributorAgreementsBuilder();
protected abstract ImmutableMap.Builder<String, NotifyConfig> notifySectionsBuilder();
protected abstract ImmutableMap.Builder<String, LabelType> labelSectionsBuilder();
protected abstract ImmutableMap.Builder<Project.NameKey, SubscribeSection>
subscribeSectionsBuilder();
protected abstract ImmutableMap.Builder<String, StoredCommentLinkInfo>
commentLinkSectionsBuilder();
} }
private static ImmutableList<SubscribeSection> filterSubscribeSectionsByBranch( private static ImmutableList<SubscribeSection> filterSubscribeSectionsByBranch(

View File

@@ -33,7 +33,7 @@ public abstract class ConfiguredMimeTypes {
private static final String MIMETYPE = "mimetype"; private static final String MIMETYPE = "mimetype";
private static final String KEY_PATH = "path"; private static final String KEY_PATH = "path";
protected abstract ImmutableList<TypeMatcher> matchers(); public abstract ImmutableList<TypeMatcher> matchers();
public static ConfiguredMimeTypes create(String projectName, Config rc) { public static ConfiguredMimeTypes create(String projectName, Config rc) {
Set<String> types = rc.getSubsections(MIMETYPE); Set<String> types = rc.getSubsections(MIMETYPE);
@@ -58,6 +58,10 @@ public abstract class ConfiguredMimeTypes {
return new AutoValue_ConfiguredMimeTypes(matchers.build()); return new AutoValue_ConfiguredMimeTypes(matchers.build());
} }
public static ConfiguredMimeTypes create(ImmutableList<TypeMatcher> matchers) {
return new AutoValue_ConfiguredMimeTypes(matchers);
}
@Nullable @Nullable
public String getMimeType(String path) { public String getMimeType(String path) {
for (TypeMatcher m : matchers()) { for (TypeMatcher m : matchers()) {

View File

@@ -12,13 +12,11 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.common.data; package com.google.gerrit.entities;
import com.google.auto.value.AutoValue; import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.entities.GroupReference;
import com.google.gerrit.entities.Project;
import java.util.List; import java.util.List;
/** Portion of a {@link Project} describing a single contributor agreement. */ /** Portion of a {@link Project} describing a single contributor agreement. */

View File

@@ -19,7 +19,7 @@ import static java.util.Objects.requireNonNull;
import com.google.auto.value.AutoValue; import com.google.auto.value.AutoValue;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
/** Describes a group within a projects {@link com.google.gerrit.common.data.AccessSection}s. */ /** Describes a group within a projects {@link AccessSection}s. */
@AutoValue @AutoValue
public abstract class GroupReference implements Comparable<GroupReference> { public abstract class GroupReference implements Comparable<GroupReference> {

View File

@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.common.data; package com.google.gerrit.entities;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.SubmitRecord.Label;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
@@ -88,8 +88,8 @@ public enum LabelFunction {
return requiresMaxValue; return requiresMaxValue;
} }
public SubmitRecord.Label check(LabelType labelType, Iterable<PatchSetApproval> approvals) { public Label check(LabelType labelType, Iterable<PatchSetApproval> approvals) {
SubmitRecord.Label submitRecordLabel = new SubmitRecord.Label(); Label submitRecordLabel = new Label();
submitRecordLabel.label = labelType.getName(); submitRecordLabel.label = labelType.getName();
submitRecordLabel.status = SubmitRecord.Label.Status.MAY; submitRecordLabel.status = SubmitRecord.Label.Status.MAY;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.common.data; package com.google.gerrit.entities;
import static java.util.Comparator.comparing; import static java.util.Comparator.comparing;
import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toList;
@@ -21,9 +21,6 @@ import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.entities.LabelId;
import com.google.gerrit.entities.LabelValue;
import com.google.gerrit.entities.PatchSetApproval;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;

View File

@@ -12,9 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.common.data; package com.google.gerrit.entities;
import com.google.gerrit.entities.LabelId;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;

View File

@@ -12,14 +12,13 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.common.data; package com.google.gerrit.entities;
import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.collect.ImmutableList.toImmutableList;
import com.google.auto.value.AutoValue; import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.entities.GroupReference;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.common.data; package com.google.gerrit.entities;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@@ -12,10 +12,9 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.common.data; package com.google.gerrit.entities;
import com.google.auto.value.AutoValue; import com.google.auto.value.AutoValue;
import com.google.gerrit.entities.GroupReference;
@AutoValue @AutoValue
public abstract class PermissionRule implements Comparable<PermissionRule> { public abstract class PermissionRule implements Comparable<PermissionRule> {

View File

@@ -12,9 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.common.data; package com.google.gerrit.entities;
import com.google.gerrit.entities.Account;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.common.data; package com.google.gerrit.entities;
import static com.google.common.base.Preconditions.checkState; import static com.google.common.base.Preconditions.checkState;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.common.data; package com.google.gerrit.entities;
import com.google.gerrit.extensions.client.SubmitType; import com.google.gerrit.extensions.client.SubmitType;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
package com.google.gerrit.common.data; package com.google.gerrit.entities;
import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.collect.ImmutableList.toImmutableList;
@@ -20,8 +20,6 @@ import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.Project;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;

View File

@@ -19,7 +19,7 @@ import java.util.Map;
import java.util.Objects; import java.util.Objects;
public class TestSubmitRuleInfo { public class TestSubmitRuleInfo {
/** @see com.google.gerrit.common.data.SubmitRecord.Status */ /** @see com.google.gerrit.entities.SubmitRecord.Status */
public String status; public String status;
public String errorMessage; public String errorMessage;

View File

@@ -14,7 +14,7 @@
package com.google.gerrit.pgm.init; package com.google.gerrit.pgm.init;
import static com.google.gerrit.common.data.LabelFunction.MAX_WITH_BLOCK; import static com.google.gerrit.entities.LabelFunction.MAX_WITH_BLOCK;
import com.google.gerrit.pgm.init.api.AllProjectsConfig; import com.google.gerrit.pgm.init.api.AllProjectsConfig;
import com.google.gerrit.pgm.init.api.ConsoleUI; import com.google.gerrit.pgm.init.api.ConsoleUI;

View File

@@ -23,8 +23,8 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.Table; import com.google.common.collect.Table;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.extensions.client.ChangeKind; import com.google.gerrit.extensions.client.ChangeKind;

View File

@@ -27,11 +27,11 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.LabelId; import com.google.gerrit.entities.LabelId;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.PatchSetInfo; import com.google.gerrit.entities.PatchSetInfo;

View File

@@ -16,9 +16,9 @@ package com.google.gerrit.server;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.AccessSection; import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.common.data.Permission; import com.google.gerrit.entities.Permission;
import com.google.gerrit.common.data.PermissionRule; import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.entities.RefNames; import com.google.gerrit.entities.RefNames;
import com.google.gerrit.extensions.events.ChangeMergedListener; import com.google.gerrit.extensions.events.ChangeMergedListener;
import com.google.gerrit.server.config.AllProjectsName; import com.google.gerrit.server.config.AllProjectsName;

View File

@@ -22,9 +22,9 @@ import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.LabelFunction;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.LabelFunction;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;

View File

@@ -17,9 +17,10 @@ package com.google.gerrit.server.account;
import static java.util.stream.Collectors.toSet; import static java.util.stream.Collectors.toSet;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.AccountsSection;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.exceptions.NoSuchGroupException; import com.google.gerrit.exceptions.NoSuchGroupException;
import com.google.gerrit.extensions.common.AccountVisibility; import com.google.gerrit.extensions.common.AccountVisibility;
import com.google.gerrit.extensions.restapi.AuthException; import com.google.gerrit.extensions.restapi.AuthException;
@@ -29,7 +30,6 @@ import com.google.gerrit.server.group.SystemGroupBackend;
import com.google.gerrit.server.permissions.GlobalPermission; import com.google.gerrit.server.permissions.GlobalPermission;
import com.google.gerrit.server.permissions.PermissionBackend; import com.google.gerrit.server.permissions.PermissionBackend;
import com.google.gerrit.server.permissions.PermissionBackendException; import com.google.gerrit.server.permissions.PermissionBackendException;
import com.google.gerrit.server.project.AccountsSection;
import com.google.gerrit.server.project.ProjectCache; import com.google.gerrit.server.project.ProjectCache;
import com.google.inject.Inject; import com.google.inject.Inject;
import com.google.inject.Provider; import com.google.inject.Provider;

View File

@@ -15,8 +15,8 @@
package com.google.gerrit.server.account; package com.google.gerrit.server.account;
import com.google.gerrit.common.data.GlobalCapability; import com.google.gerrit.common.data.GlobalCapability;
import com.google.gerrit.common.data.PermissionRange; import com.google.gerrit.entities.PermissionRange;
import com.google.gerrit.common.data.PermissionRule; import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.index.query.QueryProcessor; import com.google.gerrit.index.query.QueryProcessor;
import com.google.gerrit.server.CurrentUser; import com.google.gerrit.server.CurrentUser;
import com.google.gerrit.server.git.QueueProvider; import com.google.gerrit.server.git.QueueProvider;

View File

@@ -24,11 +24,11 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.AccessSection;
import com.google.gerrit.common.data.GlobalCapability; import com.google.gerrit.common.data.GlobalCapability;
import com.google.gerrit.common.data.Permission; import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.Permission;
import com.google.gerrit.exceptions.NoSuchGroupException; import com.google.gerrit.exceptions.NoSuchGroupException;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;
import com.google.gerrit.extensions.client.AccountFieldName; import com.google.gerrit.extensions.client.AccountFieldName;

View File

@@ -18,12 +18,12 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.AccessSection;
import com.google.gerrit.common.data.GlobalCapability; import com.google.gerrit.common.data.GlobalCapability;
import com.google.gerrit.common.data.Permission; import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.common.data.PermissionRange;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.entities.GroupReference; import com.google.gerrit.entities.GroupReference;
import com.google.gerrit.entities.Permission;
import com.google.gerrit.entities.PermissionRange;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.server.config.AdministrateServerGroups; import com.google.gerrit.server.config.AdministrateServerGroups;
import com.google.gerrit.server.group.SystemGroupBackend; import com.google.gerrit.server.group.SystemGroupBackend;
import com.google.inject.Inject; import com.google.inject.Inject;

View File

@@ -16,8 +16,8 @@ package com.google.gerrit.server.cache.serialize.entities;
import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.collect.ImmutableList.toImmutableList;
import com.google.gerrit.common.data.AccessSection; import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.common.data.Permission; import com.google.gerrit.entities.Permission;
import com.google.gerrit.server.cache.proto.Cache; import com.google.gerrit.server.cache.proto.Cache;
/** Helper to (de)serialize values for caches. */ /** Helper to (de)serialize values for caches. */

View File

@@ -11,6 +11,7 @@ java_library(
"//java/com/google/gerrit/extensions:api", "//java/com/google/gerrit/extensions:api",
"//java/com/google/gerrit/git", "//java/com/google/gerrit/git",
"//java/com/google/gerrit/proto", "//java/com/google/gerrit/proto",
"//java/com/google/gerrit/server/cache/serialize",
"//lib:guava", "//lib:guava",
"//lib:jgit", "//lib:jgit",
"//lib:protobuf", "//lib:protobuf",

View File

@@ -0,0 +1,157 @@
// Copyright (C) 2020 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.cache.serialize.entities;
import static com.google.common.collect.ImmutableList.toImmutableList;
import com.google.common.collect.ImmutableList;
import com.google.gerrit.entities.AccountsSection;
import com.google.gerrit.entities.CachedProjectConfig;
import com.google.gerrit.entities.ConfiguredMimeTypes;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.server.cache.proto.Cache;
import com.google.gerrit.server.cache.serialize.ObjectIdConverter;
import java.util.Optional;
/** Helper to (de)serialize values for caches. */
public class CachedProjectConfigSerializer {
public static CachedProjectConfig deserialize(Cache.CachedProjectConfigProto proto) {
CachedProjectConfig.Builder builder =
CachedProjectConfig.builder()
.setProject(ProjectSerializer.deserialize(proto.getProject()))
.setMaxObjectSizeLimit(proto.getMaxObjectSizeLimit())
.setCheckReceivedObjects(proto.getCheckReceivedObjects());
if (proto.hasBranchOrderSection()) {
builder.setBranchOrderSection(
Optional.of(BranchOrderSectionSerializer.deserialize(proto.getBranchOrderSection())));
}
ImmutableList<ConfiguredMimeTypes.TypeMatcher> matchers =
proto.getMimeTypesList().stream()
.map(ConfiguredMimeTypeSerializer::deserialize)
.collect(toImmutableList());
builder.setMimeTypes(ConfiguredMimeTypes.create(matchers));
if (!proto.getRulesId().isEmpty()) {
builder.setRulesId(
Optional.of(ObjectIdConverter.create().fromByteString(proto.getRulesId())));
}
if (!proto.getRevision().isEmpty()) {
builder.setRevision(
Optional.of(ObjectIdConverter.create().fromByteString(proto.getRevision())));
}
proto
.getExtensionPanelsMap()
.entrySet()
.forEach(
panelSection -> {
builder
.extensionPanelSectionsBuilder()
.put(
panelSection.getKey(),
panelSection.getValue().getSectionList().stream().collect(toImmutableList()));
});
ImmutableList<PermissionRule> accounts =
proto.getAccountsSectionList().stream()
.map(PermissionRuleSerializer::deserialize)
.collect(toImmutableList());
builder.setAccountsSection(AccountsSection.create(accounts));
proto.getGroupListList().stream()
.map(GroupReferenceSerializer::deserialize)
.forEach(builder::addGroup);
proto.getAccessSectionsList().stream()
.map(AccessSectionSerializer::deserialize)
.forEach(builder::addAccessSection);
proto.getContributorAgreementsList().stream()
.map(ContributorAgreementSerializer::deserialize)
.forEach(builder::addContributorAgreement);
proto.getNotifyConfigsList().stream()
.map(NotifyConfigSerializer::deserialize)
.forEach(builder::addNotifySection);
proto.getLabelSectionsList().stream()
.map(LabelTypeSerializer::deserialize)
.forEach(builder::addLabelSection);
proto.getSubscribeSectionsList().stream()
.map(SubscribeSectionSerializer::deserialize)
.forEach(builder::addSubscribeSection);
proto.getCommentLinksList().stream()
.map(StoredCommentLinkInfoSerializer::deserialize)
.forEach(builder::addCommentLinkSection);
return builder.build();
}
public static Cache.CachedProjectConfigProto serialize(CachedProjectConfig autoValue) {
Cache.CachedProjectConfigProto.Builder builder =
Cache.CachedProjectConfigProto.newBuilder()
.setProject(ProjectSerializer.serialize(autoValue.getProject()))
.setMaxObjectSizeLimit(autoValue.getMaxObjectSizeLimit())
.setCheckReceivedObjects(autoValue.getCheckReceivedObjects());
if (autoValue.getBranchOrderSection().isPresent()) {
builder.setBranchOrderSection(
BranchOrderSectionSerializer.serialize(autoValue.getBranchOrderSection().get()));
}
autoValue.getMimeTypes().matchers().stream()
.map(ConfiguredMimeTypeSerializer::serialize)
.forEach(builder::addMimeTypes);
if (autoValue.getRulesId().isPresent()) {
builder.setRulesId(ObjectIdConverter.create().toByteString(autoValue.getRulesId().get()));
}
if (autoValue.getRevision().isPresent()) {
builder.setRevision(ObjectIdConverter.create().toByteString(autoValue.getRevision().get()));
}
autoValue
.getExtensionPanelSections()
.entrySet()
.forEach(
panelSection -> {
builder.putExtensionPanels(
panelSection.getKey(),
Cache.CachedProjectConfigProto.ExtensionPanelSectionProto.newBuilder()
.addAllSection(panelSection.getValue())
.build());
});
autoValue.getAccountsSection().getSameGroupVisibility().stream()
.map(PermissionRuleSerializer::serialize)
.forEach(builder::addAccountsSection);
autoValue.getGroups().values().stream()
.map(GroupReferenceSerializer::serialize)
.forEach(builder::addGroupList);
autoValue.getAccessSections().values().stream()
.map(AccessSectionSerializer::serialize)
.forEach(builder::addAccessSections);
autoValue.getContributorAgreements().values().stream()
.map(ContributorAgreementSerializer::serialize)
.forEach(builder::addContributorAgreements);
autoValue.getNotifySections().values().stream()
.map(NotifyConfigSerializer::serialize)
.forEach(builder::addNotifyConfigs);
autoValue.getLabelSections().values().stream()
.map(LabelTypeSerializer::serialize)
.forEach(builder::addLabelSections);
autoValue.getSubscribeSections().values().stream()
.map(SubscribeSectionSerializer::serialize)
.forEach(builder::addSubscribeSections);
autoValue.getCommentLinkSections().values().stream()
.map(StoredCommentLinkInfoSerializer::serialize)
.forEach(builder::addCommentLinks);
return builder.build();
}
private CachedProjectConfigSerializer() {}
}

View File

@@ -18,7 +18,7 @@ import static com.google.common.base.Strings.emptyToNull;
import static com.google.common.base.Strings.nullToEmpty; import static com.google.common.base.Strings.nullToEmpty;
import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.collect.ImmutableList.toImmutableList;
import com.google.gerrit.common.data.ContributorAgreement; import com.google.gerrit.entities.ContributorAgreement;
import com.google.gerrit.server.cache.proto.Cache; import com.google.gerrit.server.cache.proto.Cache;
/** Helper to (de)serialize values for caches. */ /** Helper to (de)serialize values for caches. */

View File

@@ -20,8 +20,8 @@ import com.google.common.base.Converter;
import com.google.common.base.Enums; import com.google.common.base.Enums;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.primitives.Shorts; import com.google.common.primitives.Shorts;
import com.google.gerrit.common.data.LabelFunction; import com.google.gerrit.entities.LabelFunction;
import com.google.gerrit.common.data.LabelType; import com.google.gerrit.entities.LabelType;
import com.google.gerrit.server.cache.proto.Cache; import com.google.gerrit.server.cache.proto.Cache;
/** Helper to (de)serialize values for caches. */ /** Helper to (de)serialize values for caches. */

View File

@@ -16,7 +16,7 @@ package com.google.gerrit.server.cache.serialize.entities;
import com.google.common.base.Converter; import com.google.common.base.Converter;
import com.google.common.base.Enums; import com.google.common.base.Enums;
import com.google.gerrit.common.data.PermissionRule; import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.server.cache.proto.Cache; import com.google.gerrit.server.cache.proto.Cache;
/** Helper to (de)serialize values for caches. */ /** Helper to (de)serialize values for caches. */

View File

@@ -16,8 +16,8 @@ package com.google.gerrit.server.cache.serialize.entities;
import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.collect.ImmutableList.toImmutableList;
import com.google.gerrit.common.data.Permission; import com.google.gerrit.entities.Permission;
import com.google.gerrit.common.data.PermissionRule; import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.server.cache.proto.Cache; import com.google.gerrit.server.cache.proto.Cache;
/** Helper to (de)serialize values for caches. */ /** Helper to (de)serialize values for caches. */

View File

@@ -14,8 +14,8 @@
package com.google.gerrit.server.cache.serialize.entities; package com.google.gerrit.server.cache.serialize.entities;
import com.google.gerrit.common.data.SubscribeSection;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.SubscribeSection;
import com.google.gerrit.server.cache.proto.Cache; import com.google.gerrit.server.cache.proto.Cache;
/** Helper to (de)serialize values for caches. */ /** Helper to (de)serialize values for caches. */

View File

@@ -29,12 +29,12 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.Streams; import com.google.common.collect.Streams;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.FooterConstants; import com.google.gerrit.common.FooterConstants;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.BranchNameKey; import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.ChangeMessage; import com.google.gerrit.entities.ChangeMessage;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.PatchSetInfo; import com.google.gerrit.entities.PatchSetInfo;

View File

@@ -46,10 +46,6 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.SubmitRecord;
import com.google.gerrit.common.data.SubmitRecord.Status;
import com.google.gerrit.common.data.SubmitRequirement;
import com.google.gerrit.common.data.SubmitTypeRecord;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.Address; import com.google.gerrit.entities.Address;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
@@ -57,6 +53,10 @@ import com.google.gerrit.entities.ChangeMessage;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.entities.SubmitRecord.Status;
import com.google.gerrit.entities.SubmitRequirement;
import com.google.gerrit.entities.SubmitTypeRecord;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;
import com.google.gerrit.extensions.api.changes.FixInput; import com.google.gerrit.extensions.api.changes.FixInput;
import com.google.gerrit.extensions.client.ListChangesOption; import com.google.gerrit.extensions.client.ListChangesOption;

View File

@@ -18,11 +18,11 @@ import static com.google.gerrit.server.project.ProjectCache.illegalState;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.ChangeMessage; import com.google.gerrit.entities.ChangeMessage;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;

View File

@@ -22,9 +22,9 @@ import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.LabelValue; import com.google.gerrit.entities.LabelValue;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.server.notedb.ChangeNotes; import com.google.gerrit.server.notedb.ChangeNotes;

View File

@@ -32,12 +32,12 @@ import com.google.common.collect.Table;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.common.primitives.Ints; import com.google.common.primitives.Ints;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.common.data.SubmitRecord;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.LabelValue; import com.google.gerrit.entities.LabelValue;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.extensions.client.ListChangesOption; import com.google.gerrit.extensions.client.ListChangesOption;
import com.google.gerrit.extensions.common.ApprovalInfo; import com.google.gerrit.extensions.common.ApprovalInfo;
import com.google.gerrit.extensions.common.LabelInfo; import com.google.gerrit.extensions.common.LabelInfo;

View File

@@ -18,13 +18,13 @@ import static com.google.gerrit.entities.LabelValue.formatValue;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.common.data.SubmitRecord;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.Address; import com.google.gerrit.entities.Address;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.extensions.api.changes.ReviewerInfo; import com.google.gerrit.extensions.api.changes.ReviewerInfo;
import com.google.gerrit.extensions.restapi.AuthException; import com.google.gerrit.extensions.restapi.AuthException;
import com.google.gerrit.server.ApprovalsUtil; import com.google.gerrit.server.ApprovalsUtil;

View File

@@ -16,8 +16,8 @@ package com.google.gerrit.server.config;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.entities.GroupReference; import com.google.gerrit.entities.GroupReference;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.server.account.GroupBackend; import com.google.gerrit.server.account.GroupBackend;
import com.google.gerrit.server.account.GroupBackends; import com.google.gerrit.server.account.GroupBackends;
import com.google.gerrit.server.util.RequestContext; import com.google.gerrit.server.util.RequestContext;

View File

@@ -14,9 +14,11 @@
package com.google.gerrit.server.data; package com.google.gerrit.server.data;
import com.google.gerrit.entities.SubmitRecord;
/** /**
* Represents a {@link com.google.gerrit.common.data.SubmitRecord.Label} that does not depend on * Represents a {@link SubmitRecord.Label} that does not depend on Gerrit internal classes, to be
* Gerrit internal classes, to be serialized. * serialized.
*/ */
public class SubmitLabelAttribute { public class SubmitLabelAttribute {
public String label; public String label;

View File

@@ -14,11 +14,12 @@
package com.google.gerrit.server.data; package com.google.gerrit.server.data;
import com.google.gerrit.entities.SubmitRecord;
import java.util.List; import java.util.List;
/** /**
* Represents a {@link com.google.gerrit.common.data.SubmitRecord} that does not depend on Gerrit * Represents a {@link SubmitRecord} that does not depend on Gerrit internal classes, to be
* internal classes, to be serialized. * serialized.
*/ */
public class SubmitRecordAttribute { public class SubmitRecordAttribute {
public String status; public String status;

View File

@@ -14,9 +14,11 @@
package com.google.gerrit.server.data; package com.google.gerrit.server.data;
import com.google.gerrit.entities.SubmitRequirement;
/** /**
* Represents a {@link com.google.gerrit.common.data.SubmitRequirement} that does not depend on * Represents a {@link SubmitRequirement} that does not depend on Gerrit internal classes, to be
* Gerrit internal classes, to be serialized * serialized
*/ */
public class SubmitRequirementAttribute { public class SubmitRequirementAttribute {
public String type; public String type;

View File

@@ -20,17 +20,17 @@ import static java.util.Objects.requireNonNull;
import com.google.common.collect.ListMultimap; import com.google.common.collect.ListMultimap;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.common.data.SubmitRecord;
import com.google.gerrit.common.data.SubmitRequirement;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.BranchNameKey; import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.ChangeMessage; import com.google.gerrit.entities.ChangeMessage;
import com.google.gerrit.entities.HumanComment; import com.google.gerrit.entities.HumanComment;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.entities.SubmitRequirement;
import com.google.gerrit.entities.UserIdentity; import com.google.gerrit.entities.UserIdentity;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;
import com.google.gerrit.extensions.registration.DynamicItem; import com.google.gerrit.extensions.registration.DynamicItem;

View File

@@ -20,11 +20,11 @@ import com.google.common.base.Supplier;
import com.google.common.base.Suppliers; import com.google.common.base.Suppliers;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.BranchNameKey; import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;

View File

@@ -31,12 +31,12 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.FooterConstants; import com.google.gerrit.common.FooterConstants;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.BooleanProjectConfig; import com.google.gerrit.entities.BooleanProjectConfig;
import com.google.gerrit.entities.BranchNameKey; import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.LabelId; import com.google.gerrit.entities.LabelId;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.exceptions.InvalidMergeStrategyException; import com.google.gerrit.exceptions.InvalidMergeStrategyException;

View File

@@ -63,13 +63,13 @@ import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.FooterConstants; import com.google.gerrit.common.FooterConstants;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.UsedAt; import com.google.gerrit.common.UsedAt;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.BooleanProjectConfig; import com.google.gerrit.entities.BooleanProjectConfig;
import com.google.gerrit.entities.BranchNameKey; import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.HumanComment; import com.google.gerrit.entities.HumanComment;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetInfo; import com.google.gerrit.entities.PatchSetInfo;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;

View File

@@ -29,10 +29,10 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.Streams; import com.google.common.collect.Streams;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.entities.BranchNameKey; import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.ChangeMessage; import com.google.gerrit.entities.ChangeMessage;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.PatchSetInfo; import com.google.gerrit.entities.PatchSetInfo;

View File

@@ -18,12 +18,12 @@ import static com.google.gerrit.server.project.ProjectCache.illegalState;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.CachedProjectConfig;
import com.google.gerrit.entities.GroupReference; import com.google.gerrit.entities.GroupReference;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.server.git.DefaultQueueOp; import com.google.gerrit.server.git.DefaultQueueOp;
import com.google.gerrit.server.git.WorkQueue; import com.google.gerrit.server.git.WorkQueue;
import com.google.gerrit.server.git.meta.MetaDataUpdate; import com.google.gerrit.server.git.meta.MetaDataUpdate;
import com.google.gerrit.server.project.CachedProjectConfig;
import com.google.gerrit.server.project.ProjectCache; import com.google.gerrit.server.project.ProjectCache;
import com.google.gerrit.server.project.ProjectConfig; import com.google.gerrit.server.project.ProjectConfig;
import com.google.inject.Inject; import com.google.inject.Inject;

View File

@@ -42,8 +42,6 @@ import com.google.common.collect.Table;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.common.io.Files; import com.google.common.io.Files;
import com.google.common.primitives.Longs; import com.google.common.primitives.Longs;
import com.google.gerrit.common.data.SubmitRecord;
import com.google.gerrit.common.data.SubmitRequirement;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.Address; import com.google.gerrit.entities.Address;
import com.google.gerrit.entities.AttentionSetUpdate; import com.google.gerrit.entities.AttentionSetUpdate;
@@ -52,6 +50,8 @@ import com.google.gerrit.entities.ChangeMessage;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.RefNames; import com.google.gerrit.entities.RefNames;
import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.entities.SubmitRequirement;
import com.google.gerrit.entities.converter.ChangeProtoConverter; import com.google.gerrit.entities.converter.ChangeProtoConverter;
import com.google.gerrit.entities.converter.PatchSetApprovalProtoConverter; import com.google.gerrit.entities.converter.PatchSetApprovalProtoConverter;
import com.google.gerrit.entities.converter.PatchSetProtoConverter; import com.google.gerrit.entities.converter.PatchSetProtoConverter;

View File

@@ -16,10 +16,10 @@ package com.google.gerrit.server.mail.send;
import com.google.common.collect.HashBasedTable; import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Table; import com.google.common.collect.Table;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.LabelValue; import com.google.gerrit.entities.LabelValue;
import com.google.gerrit.entities.NotifyConfig.NotifyType; import com.google.gerrit.entities.NotifyConfig.NotifyType;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;

View File

@@ -38,7 +38,6 @@ import com.google.common.collect.Sets;
import com.google.common.collect.Sets.SetView; import com.google.common.collect.Sets.SetView;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.SubmitRecord;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.AttentionSetUpdate; import com.google.gerrit.entities.AttentionSetUpdate;
import com.google.gerrit.entities.BranchNameKey; import com.google.gerrit.entities.BranchNameKey;
@@ -51,6 +50,7 @@ import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.RefNames; import com.google.gerrit.entities.RefNames;
import com.google.gerrit.entities.RobotComment; import com.google.gerrit.entities.RobotComment;
import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;
import com.google.gerrit.server.AssigneeStatusUpdate; import com.google.gerrit.server.AssigneeStatusUpdate;
import com.google.gerrit.server.ReviewerByEmailSet; import com.google.gerrit.server.ReviewerByEmailSet;

View File

@@ -55,8 +55,6 @@ import com.google.common.collect.Table;
import com.google.common.collect.Tables; import com.google.common.collect.Tables;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.common.primitives.Ints; import com.google.common.primitives.Ints;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.SubmitRecord;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.Address; import com.google.gerrit.entities.Address;
import com.google.gerrit.entities.AttentionSetUpdate; import com.google.gerrit.entities.AttentionSetUpdate;
@@ -64,9 +62,11 @@ import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.ChangeMessage; import com.google.gerrit.entities.ChangeMessage;
import com.google.gerrit.entities.HumanComment; import com.google.gerrit.entities.HumanComment;
import com.google.gerrit.entities.LabelId; import com.google.gerrit.entities.LabelId;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.RefNames; import com.google.gerrit.entities.RefNames;
import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.metrics.Timer0; import com.google.gerrit.metrics.Timer0;
import com.google.gerrit.server.AssigneeStatusUpdate; import com.google.gerrit.server.AssigneeStatusUpdate;
import com.google.gerrit.server.ReviewerByEmailSet; import com.google.gerrit.server.ReviewerByEmailSet;

View File

@@ -33,7 +33,6 @@ import com.google.common.collect.ListMultimap;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Table; import com.google.common.collect.Table;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.SubmitRecord;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.Address; import com.google.gerrit.entities.Address;
import com.google.gerrit.entities.AttentionSetUpdate; import com.google.gerrit.entities.AttentionSetUpdate;
@@ -44,6 +43,7 @@ import com.google.gerrit.entities.HumanComment;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.entities.converter.ChangeMessageProtoConverter; import com.google.gerrit.entities.converter.ChangeMessageProtoConverter;
import com.google.gerrit.entities.converter.PatchSetApprovalProtoConverter; import com.google.gerrit.entities.converter.PatchSetApprovalProtoConverter;
import com.google.gerrit.entities.converter.PatchSetProtoConverter; import com.google.gerrit.entities.converter.PatchSetProtoConverter;

View File

@@ -53,7 +53,6 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Table; import com.google.common.collect.Table;
import com.google.common.collect.TreeBasedTable; import com.google.common.collect.TreeBasedTable;
import com.google.gerrit.common.data.SubmitRecord;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.Address; import com.google.gerrit.entities.Address;
import com.google.gerrit.entities.AttentionSetUpdate; import com.google.gerrit.entities.AttentionSetUpdate;
@@ -63,6 +62,7 @@ import com.google.gerrit.entities.HumanComment;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.RobotComment; import com.google.gerrit.entities.RobotComment;
import com.google.gerrit.entities.SubmissionId; import com.google.gerrit.entities.SubmissionId;
import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;
import com.google.gerrit.server.CurrentUser; import com.google.gerrit.server.CurrentUser;
import com.google.gerrit.server.GerritPersonIdent; import com.google.gerrit.server.GerritPersonIdent;

View File

@@ -19,10 +19,10 @@ import static com.google.gerrit.server.permissions.LabelPermission.ForUser.ON_BE
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.google.gerrit.common.data.Permission;
import com.google.gerrit.common.data.PermissionRange;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.Permission;
import com.google.gerrit.entities.PermissionRange;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;
import com.google.gerrit.extensions.conditions.BooleanCondition; import com.google.gerrit.extensions.conditions.BooleanCondition;
import com.google.gerrit.extensions.restapi.AuthException; import com.google.gerrit.extensions.restapi.AuthException;

View File

@@ -21,10 +21,10 @@ import static java.util.stream.Collectors.toSet;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.common.data.PermissionRule.Action;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.entities.PermissionRule.Action;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.extensions.api.access.GlobalOrPluginPermission; import com.google.gerrit.extensions.api.access.GlobalOrPluginPermission;
import com.google.gerrit.extensions.api.access.PluginPermission; import com.google.gerrit.extensions.api.access.PluginPermission;

View File

@@ -20,7 +20,7 @@ import static java.util.Objects.requireNonNull;
import com.google.common.collect.ImmutableBiMap; import com.google.common.collect.ImmutableBiMap;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.gerrit.common.data.GlobalCapability; import com.google.gerrit.common.data.GlobalCapability;
import com.google.gerrit.common.data.Permission; import com.google.gerrit.entities.Permission;
import com.google.gerrit.extensions.api.access.GlobalOrPluginPermission; import com.google.gerrit.extensions.api.access.GlobalOrPluginPermission;
import com.google.gerrit.extensions.api.access.PluginPermission; import com.google.gerrit.extensions.api.access.PluginPermission;
import com.google.gerrit.extensions.api.access.PluginProjectPermission; import com.google.gerrit.extensions.api.access.PluginProjectPermission;

View File

@@ -18,7 +18,7 @@ import static com.google.gerrit.server.permissions.LabelPermission.ForUser.ON_BE
import static com.google.gerrit.server.permissions.LabelPermission.ForUser.SELF; import static com.google.gerrit.server.permissions.LabelPermission.ForUser.SELF;
import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNull;
import com.google.gerrit.common.data.LabelType; import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelValue; import com.google.gerrit.entities.LabelValue;
import com.google.gerrit.server.util.LabelVote; import com.google.gerrit.server.util.LabelVote;

View File

@@ -21,9 +21,9 @@ import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.BranchNameKey; import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;
import com.google.gerrit.extensions.api.access.CoreOrPluginProjectPermission; import com.google.gerrit.extensions.api.access.CoreOrPluginProjectPermission;

View File

@@ -14,7 +14,7 @@
package com.google.gerrit.server.permissions; package com.google.gerrit.server.permissions;
import static com.google.gerrit.common.data.PermissionRule.Action.BLOCK; import static com.google.gerrit.entities.PermissionRule.Action.BLOCK;
import static com.google.gerrit.server.project.RefPattern.containsParameters; import static com.google.gerrit.server.project.RefPattern.containsParameters;
import static com.google.gerrit.server.project.RefPattern.isRE; import static com.google.gerrit.server.project.RefPattern.isRE;
import static java.util.stream.Collectors.mapping; import static java.util.stream.Collectors.mapping;
@@ -23,11 +23,11 @@ import static java.util.stream.Collectors.toList;
import com.google.auto.value.AutoValue; import com.google.auto.value.AutoValue;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.AccessSection; import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.common.data.Permission;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.common.data.PermissionRule.Action;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.Permission;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.entities.PermissionRule.Action;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.metrics.Description; import com.google.gerrit.metrics.Description;
import com.google.gerrit.metrics.Description.Units; import com.google.gerrit.metrics.Description.Units;

View File

@@ -15,18 +15,18 @@
package com.google.gerrit.server.permissions; package com.google.gerrit.server.permissions;
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkArgument;
import static com.google.gerrit.common.data.AccessSection.ALL; import static com.google.gerrit.entities.AccessSection.ALL;
import static com.google.gerrit.common.data.AccessSection.REGEX_PREFIX; import static com.google.gerrit.entities.AccessSection.REGEX_PREFIX;
import static com.google.gerrit.entities.RefNames.REFS_TAGS; import static com.google.gerrit.entities.RefNames.REFS_TAGS;
import static com.google.gerrit.server.util.MagicBranch.NEW_CHANGE; import static com.google.gerrit.server.util.MagicBranch.NEW_CHANGE;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.google.gerrit.common.data.AccessSection; import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.common.data.Permission;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.BranchNameKey; import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.Permission;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.RefNames; import com.google.gerrit.entities.RefNames;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;

View File

@@ -17,11 +17,11 @@ package com.google.gerrit.server.permissions;
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkArgument;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.Permission;
import com.google.gerrit.common.data.PermissionRange;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.common.data.PermissionRule.Action;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.Permission;
import com.google.gerrit.entities.PermissionRange;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.entities.PermissionRule.Action;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.RefNames; import com.google.gerrit.entities.RefNames;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;

View File

@@ -18,7 +18,7 @@ import com.google.auto.value.AutoValue;
import com.google.common.cache.Cache; import com.google.common.cache.Cache;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.AccessSection; import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.server.cache.CacheModule; import com.google.gerrit.server.cache.CacheModule;
import com.google.gerrit.server.util.MostSpecificComparator; import com.google.gerrit.server.util.MostSpecificComparator;
import com.google.inject.Inject; import com.google.inject.Inject;

View File

@@ -17,12 +17,12 @@ package com.google.gerrit.server.project;
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNull;
import com.google.gerrit.common.data.ContributorAgreement;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.common.data.PermissionRule.Action;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.AccountGroup.UUID; import com.google.gerrit.entities.AccountGroup.UUID;
import com.google.gerrit.entities.BooleanProjectConfig; import com.google.gerrit.entities.BooleanProjectConfig;
import com.google.gerrit.entities.ContributorAgreement;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.entities.PermissionRule.Action;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.extensions.registration.DynamicItem; import com.google.gerrit.extensions.registration.DynamicItem;
import com.google.gerrit.extensions.restapi.AuthException; import com.google.gerrit.extensions.restapi.AuthException;

View File

@@ -16,7 +16,7 @@ package com.google.gerrit.server.project;
import static java.util.stream.Collectors.toMap; import static java.util.stream.Collectors.toMap;
import com.google.gerrit.common.data.LabelType; import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelValue; import com.google.gerrit.entities.LabelValue;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.extensions.common.LabelDefinitionInfo; import com.google.gerrit.extensions.common.LabelDefinitionInfo;

View File

@@ -14,7 +14,7 @@
package com.google.gerrit.server.project; package com.google.gerrit.server.project;
import com.google.gerrit.common.data.LabelType; import com.google.gerrit.entities.LabelType;
import com.google.gerrit.extensions.restapi.RestResource; import com.google.gerrit.extensions.restapi.RestResource;
import com.google.gerrit.extensions.restapi.RestView; import com.google.gerrit.extensions.restapi.RestView;
import com.google.inject.TypeLiteral; import com.google.inject.TypeLiteral;

View File

@@ -17,7 +17,7 @@ package com.google.gerrit.server.project;
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState; import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.gerrit.common.data.Permission.isPermission; import static com.google.gerrit.entities.Permission.isPermission;
import static com.google.gerrit.entities.Project.DEFAULT_SUBMIT_TYPE; import static com.google.gerrit.entities.Project.DEFAULT_SUBMIT_TYPE;
import static com.google.gerrit.server.permissions.PluginPermissionsUtil.isValidPluginPermission; import static com.google.gerrit.server.permissions.PluginPermissionsUtil.isValidPluginPermission;
import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNull;
@@ -28,34 +28,35 @@ import com.google.common.base.Joiner;
import com.google.common.base.Splitter; import com.google.common.base.Splitter;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.google.common.primitives.Shorts; import com.google.common.primitives.Shorts;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.UsedAt; import com.google.gerrit.common.UsedAt;
import com.google.gerrit.common.data.AccessSection;
import com.google.gerrit.common.data.ContributorAgreement;
import com.google.gerrit.common.data.GlobalCapability; import com.google.gerrit.common.data.GlobalCapability;
import com.google.gerrit.common.data.LabelFunction; import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.Permission;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.common.data.PermissionRule.Action;
import com.google.gerrit.common.data.SubscribeSection;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.AccountsSection;
import com.google.gerrit.entities.Address; import com.google.gerrit.entities.Address;
import com.google.gerrit.entities.BooleanProjectConfig; import com.google.gerrit.entities.BooleanProjectConfig;
import com.google.gerrit.entities.BranchOrderSection; import com.google.gerrit.entities.BranchOrderSection;
import com.google.gerrit.entities.CachedProjectConfig;
import com.google.gerrit.entities.ConfiguredMimeTypes; import com.google.gerrit.entities.ConfiguredMimeTypes;
import com.google.gerrit.entities.ContributorAgreement;
import com.google.gerrit.entities.GroupDescription; import com.google.gerrit.entities.GroupDescription;
import com.google.gerrit.entities.GroupReference; import com.google.gerrit.entities.GroupReference;
import com.google.gerrit.entities.LabelFunction;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelValue; import com.google.gerrit.entities.LabelValue;
import com.google.gerrit.entities.NotifyConfig; import com.google.gerrit.entities.NotifyConfig;
import com.google.gerrit.entities.NotifyConfig.NotifyType; import com.google.gerrit.entities.NotifyConfig.NotifyType;
import com.google.gerrit.entities.Permission;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.entities.PermissionRule.Action;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.RefNames; import com.google.gerrit.entities.RefNames;
import com.google.gerrit.entities.StoredCommentLinkInfo; import com.google.gerrit.entities.StoredCommentLinkInfo;
import com.google.gerrit.entities.SubscribeSection;
import com.google.gerrit.exceptions.InvalidNameException; import com.google.gerrit.exceptions.InvalidNameException;
import com.google.gerrit.extensions.client.InheritableBoolean; import com.google.gerrit.extensions.client.InheritableBoolean;
import com.google.gerrit.extensions.client.ProjectState; import com.google.gerrit.extensions.client.ProjectState;
@@ -256,24 +257,27 @@ public class ProjectConfig extends VersionedMetaData implements ValidationError.
/** Returns an immutable, thread-safe representation of this object that can be cached. */ /** Returns an immutable, thread-safe representation of this object that can be cached. */
public CachedProjectConfig getCacheable() { public CachedProjectConfig getCacheable() {
return CachedProjectConfig.builder() CachedProjectConfig.Builder builder =
CachedProjectConfig.builder()
.setProject(project) .setProject(project)
.setAccountsSection(accountsSection) .setAccountsSection(accountsSection)
.setGroups(ImmutableMap.copyOf(groupList.byUUID()))
.setAccessSections(ImmutableMap.copyOf(accessSections))
.setBranchOrderSection(Optional.ofNullable(branchOrderSection)) .setBranchOrderSection(Optional.ofNullable(branchOrderSection))
.setContributorAgreements(ImmutableMap.copyOf(contributorAgreements))
.setNotifySections(ImmutableMap.copyOf(notifySections))
.setLabelSections(ImmutableMap.copyOf(labelSections))
.setMimeTypes(mimeTypes) .setMimeTypes(mimeTypes)
.setSubscribeSections(ImmutableMap.copyOf(subscribeSections))
.setCommentLinkSections(ImmutableMap.copyOf(commentLinkSections))
.setRulesId(Optional.ofNullable(rulesId)) .setRulesId(Optional.ofNullable(rulesId))
.setRevision(Optional.ofNullable(getRevision())) .setRevision(Optional.ofNullable(getRevision()))
.setMaxObjectSizeLimit(maxObjectSizeLimit) .setMaxObjectSizeLimit(maxObjectSizeLimit)
.setCheckReceivedObjects(checkReceivedObjects) .setCheckReceivedObjects(checkReceivedObjects)
.setExtensionPanelSections(extensionPanelSections) .setExtensionPanelSections(extensionPanelSections);
.build();
groupList.byUUID().values().forEach(g -> builder.addGroup(g));
accessSections.values().forEach(a -> builder.addAccessSection(a));
contributorAgreements.values().forEach(c -> builder.addContributorAgreement(c));
notifySections.values().forEach(n -> builder.addNotifySection(n));
subscribeSections.values().forEach(s -> builder.addSubscribeSection(s));
commentLinkSections.values().forEach(c -> builder.addCommentLinkSection(c));
labelSections.values().forEach(l -> builder.addLabelSection(l));
return builder.build();
} }
public static StoredCommentLinkInfo buildCommentLink(Config cfg, String name, boolean allowRaw) public static StoredCommentLinkInfo buildCommentLink(Config cfg, String name, boolean allowRaw)

View File

@@ -19,13 +19,13 @@ import static com.google.gerrit.server.project.ProjectCache.illegalState;
import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.AccessSection; import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.common.data.Permission;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.BooleanProjectConfig; import com.google.gerrit.entities.BooleanProjectConfig;
import com.google.gerrit.entities.GroupDescription; import com.google.gerrit.entities.GroupDescription;
import com.google.gerrit.entities.GroupReference; import com.google.gerrit.entities.GroupReference;
import com.google.gerrit.entities.Permission;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.RefNames; import com.google.gerrit.entities.RefNames;
import com.google.gerrit.extensions.events.NewProjectCreatedListener; import com.google.gerrit.extensions.events.NewProjectCreatedListener;

View File

@@ -19,7 +19,7 @@ import static java.util.stream.Collectors.toMap;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.LabelType; import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelValue; import com.google.gerrit.entities.LabelValue;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.extensions.common.LabelTypeInfo; import com.google.gerrit.extensions.common.LabelTypeInfo;

View File

@@ -14,26 +14,27 @@
package com.google.gerrit.server.project; package com.google.gerrit.server.project;
import static com.google.gerrit.common.data.PermissionRule.Action.ALLOW; import static com.google.gerrit.entities.PermissionRule.Action.ALLOW;
import com.google.common.annotations.VisibleForTesting; import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.FluentIterable; import com.google.common.collect.FluentIterable;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.AccessSection; import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.common.data.Permission;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.common.data.SubscribeSection;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.BooleanProjectConfig; import com.google.gerrit.entities.BooleanProjectConfig;
import com.google.gerrit.entities.BranchNameKey; import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.BranchOrderSection; import com.google.gerrit.entities.BranchOrderSection;
import com.google.gerrit.entities.CachedProjectConfig;
import com.google.gerrit.entities.GroupReference; import com.google.gerrit.entities.GroupReference;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.Permission;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.StoredCommentLinkInfo; import com.google.gerrit.entities.StoredCommentLinkInfo;
import com.google.gerrit.entities.SubscribeSection;
import com.google.gerrit.extensions.api.projects.CommentLinkInfo; import com.google.gerrit.extensions.api.projects.CommentLinkInfo;
import com.google.gerrit.extensions.client.SubmitType; import com.google.gerrit.extensions.client.SubmitType;
import com.google.gerrit.extensions.restapi.ResourceConflictException; import com.google.gerrit.extensions.restapi.ResourceConflictException;

View File

@@ -19,8 +19,8 @@ import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader; import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache; import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.gerrit.common.data.AccessSection;
import com.google.gerrit.common.data.ParameterizedString; import com.google.gerrit.common.data.ParameterizedString;
import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.exceptions.InvalidNameException; import com.google.gerrit.exceptions.InvalidNameException;
import dk.brics.automaton.RegExp; import dk.brics.automaton.RegExp;
import java.util.Map; import java.util.Map;

View File

@@ -14,7 +14,7 @@
package com.google.gerrit.server.project; package com.google.gerrit.server.project;
import com.google.gerrit.common.data.AccessSection; import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.server.CurrentUser; import com.google.gerrit.server.CurrentUser;

View File

@@ -18,9 +18,9 @@ import static com.google.gerrit.server.project.ProjectCache.noSuchProject;
import com.google.common.collect.Streams; import com.google.common.collect.Streams;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.SubmitRecord;
import com.google.gerrit.common.data.SubmitTypeRecord;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.entities.SubmitTypeRecord;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;
import com.google.gerrit.metrics.Description; import com.google.gerrit.metrics.Description;
import com.google.gerrit.metrics.Description.Units; import com.google.gerrit.metrics.Description.Units;

View File

@@ -14,8 +14,8 @@
package com.google.gerrit.server.project.testing; package com.google.gerrit.server.project.testing;
import com.google.gerrit.common.data.LabelFunction; import com.google.gerrit.entities.LabelFunction;
import com.google.gerrit.common.data.LabelType; import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelValue; import com.google.gerrit.entities.LabelValue;
import java.util.Arrays; import java.util.Arrays;

View File

@@ -33,20 +33,20 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.primitives.Ints; import com.google.common.primitives.Ints;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.common.data.SubmitRecord;
import com.google.gerrit.common.data.SubmitTypeRecord;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.AttentionSetUpdate; import com.google.gerrit.entities.AttentionSetUpdate;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.ChangeMessage; import com.google.gerrit.entities.ChangeMessage;
import com.google.gerrit.entities.Comment; import com.google.gerrit.entities.Comment;
import com.google.gerrit.entities.HumanComment; import com.google.gerrit.entities.HumanComment;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.RefNames; import com.google.gerrit.entities.RefNames;
import com.google.gerrit.entities.RobotComment; import com.google.gerrit.entities.RobotComment;
import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.entities.SubmitTypeRecord;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;
import com.google.gerrit.extensions.restapi.BadRequestException; import com.google.gerrit.extensions.restapi.BadRequestException;
import com.google.gerrit.extensions.restapi.ResourceConflictException; import com.google.gerrit.extensions.restapi.ResourceConflictException;

View File

@@ -28,7 +28,6 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.common.primitives.Ints; import com.google.common.primitives.Ints;
import com.google.gerrit.common.data.SubmitRecord;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.Address; import com.google.gerrit.entities.Address;
@@ -38,6 +37,7 @@ import com.google.gerrit.entities.GroupDescription;
import com.google.gerrit.entities.GroupReference; import com.google.gerrit.entities.GroupReference;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.RefNames; import com.google.gerrit.entities.RefNames;
import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.exceptions.NotSignedInException; import com.google.gerrit.exceptions.NotSignedInException;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;
import com.google.gerrit.extensions.registration.DynamicMap; import com.google.gerrit.extensions.registration.DynamicMap;

View File

@@ -20,11 +20,11 @@ import static com.google.gerrit.server.project.ProjectCache.noSuchProject;
import static java.util.concurrent.TimeUnit.MINUTES; import static java.util.concurrent.TimeUnit.MINUTES;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.SubmitTypeRecord;
import com.google.gerrit.entities.BooleanProjectConfig; import com.google.gerrit.entities.BooleanProjectConfig;
import com.google.gerrit.entities.BranchNameKey; import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.SubmitTypeRecord;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;
import com.google.gerrit.index.query.PostFilterPredicate; import com.google.gerrit.index.query.PostFilterPredicate;
import com.google.gerrit.index.query.Predicate; import com.google.gerrit.index.query.Predicate;

View File

@@ -14,11 +14,11 @@
package com.google.gerrit.server.query.change; package com.google.gerrit.server.query.change;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.extensions.restapi.AuthException; import com.google.gerrit.extensions.restapi.AuthException;
import com.google.gerrit.server.IdentifiedUser; import com.google.gerrit.server.IdentifiedUser;

View File

@@ -18,7 +18,7 @@ import static com.google.common.base.Preconditions.checkState;
import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.LabelTypes; import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;

View File

@@ -16,8 +16,8 @@ package com.google.gerrit.server.query.change;
import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toList;
import com.google.gerrit.common.data.SubmitRecord;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.index.query.Predicate; import com.google.gerrit.index.query.Predicate;
import com.google.gerrit.server.index.change.ChangeField; import com.google.gerrit.server.index.change.ChangeField;
import java.util.Set; import java.util.Set;

View File

@@ -14,7 +14,7 @@
package com.google.gerrit.server.query.change; package com.google.gerrit.server.query.change;
import com.google.gerrit.common.data.SubmitRecord; import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.server.index.change.ChangeField; import com.google.gerrit.server.index.change.ChangeField;
public class SubmittablePredicate extends ChangeIndexPredicate { public class SubmittablePredicate extends ChangeIndexPredicate {

View File

@@ -15,10 +15,10 @@
package com.google.gerrit.server.restapi.account; package com.google.gerrit.server.restapi.account;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.ContributorAgreement;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.common.data.PermissionRule.Action;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.ContributorAgreement;
import com.google.gerrit.entities.PermissionRule;
import com.google.gerrit.entities.PermissionRule.Action;
import com.google.gerrit.extensions.common.AgreementInfo; import com.google.gerrit.extensions.common.AgreementInfo;
import com.google.gerrit.extensions.restapi.AuthException; import com.google.gerrit.extensions.restapi.AuthException;
import com.google.gerrit.extensions.restapi.MethodNotAllowedException; import com.google.gerrit.extensions.restapi.MethodNotAllowedException;

View File

@@ -21,7 +21,7 @@ import static com.google.gerrit.server.permissions.DefaultPermissionMappings.plu
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.gerrit.common.data.GlobalCapability; import com.google.gerrit.common.data.GlobalCapability;
import com.google.gerrit.common.data.PermissionRange; import com.google.gerrit.entities.PermissionRange;
import com.google.gerrit.extensions.api.access.GlobalOrPluginPermission; import com.google.gerrit.extensions.api.access.GlobalOrPluginPermission;
import com.google.gerrit.extensions.api.access.PluginPermission; import com.google.gerrit.extensions.api.access.PluginPermission;
import com.google.gerrit.extensions.config.CapabilityDefinition; import com.google.gerrit.extensions.config.CapabilityDefinition;

View File

@@ -16,8 +16,8 @@ package com.google.gerrit.server.restapi.account;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.gerrit.common.data.ContributorAgreement;
import com.google.gerrit.entities.AccountGroup; import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.entities.ContributorAgreement;
import com.google.gerrit.exceptions.NoSuchGroupException; import com.google.gerrit.exceptions.NoSuchGroupException;
import com.google.gerrit.extensions.api.accounts.AgreementInput; import com.google.gerrit.extensions.api.accounts.AgreementInput;
import com.google.gerrit.extensions.restapi.AuthException; import com.google.gerrit.extensions.restapi.AuthException;

View File

@@ -19,10 +19,10 @@ import static com.google.gerrit.server.project.ProjectCache.illegalState;
import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNull;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.ChangeMessage; import com.google.gerrit.entities.ChangeMessage;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.extensions.api.changes.DeleteVoteInput; import com.google.gerrit.extensions.api.changes.DeleteVoteInput;

View File

@@ -16,10 +16,10 @@ package com.google.gerrit.server.restapi.change;
import static com.google.gerrit.server.project.ProjectCache.illegalState; import static com.google.gerrit.server.project.ProjectCache.illegalState;
import com.google.gerrit.common.data.SubmitTypeRecord;
import com.google.gerrit.entities.BranchOrderSection; import com.google.gerrit.entities.BranchOrderSection;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.SubmitTypeRecord;
import com.google.gerrit.extensions.client.SubmitType; import com.google.gerrit.extensions.client.SubmitType;
import com.google.gerrit.extensions.common.MergeableInfo; import com.google.gerrit.extensions.common.MergeableInfo;
import com.google.gerrit.extensions.restapi.AuthException; import com.google.gerrit.extensions.restapi.AuthException;

View File

@@ -23,10 +23,10 @@ import static com.google.gerrit.server.query.change.ChangeData.asChanges;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.entities.BranchNameKey; import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.ChangeMessage; import com.google.gerrit.entities.ChangeMessage;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;

View File

@@ -41,8 +41,6 @@ import com.google.common.flogger.FluentLogger;
import com.google.common.hash.HashCode; import com.google.common.hash.HashCode;
import com.google.common.hash.Hashing; import com.google.common.hash.Hashing;
import com.google.gerrit.common.Nullable; import com.google.gerrit.common.Nullable;
import com.google.gerrit.common.data.LabelType;
import com.google.gerrit.common.data.LabelTypes;
import com.google.gerrit.entities.Account; import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.Address; import com.google.gerrit.entities.Address;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
@@ -51,6 +49,8 @@ import com.google.gerrit.entities.Comment;
import com.google.gerrit.entities.FixReplacement; import com.google.gerrit.entities.FixReplacement;
import com.google.gerrit.entities.FixSuggestion; import com.google.gerrit.entities.FixSuggestion;
import com.google.gerrit.entities.HumanComment; import com.google.gerrit.entities.HumanComment;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelTypes;
import com.google.gerrit.entities.Patch; import com.google.gerrit.entities.Patch;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.PatchSetApproval; import com.google.gerrit.entities.PatchSetApproval;

View File

@@ -15,7 +15,7 @@
package com.google.gerrit.server.restapi.change; package com.google.gerrit.server.restapi.change;
import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects;
import com.google.gerrit.common.data.SubmitRecord; import com.google.gerrit.entities.SubmitRecord;
import com.google.gerrit.extensions.common.AccountInfo; import com.google.gerrit.extensions.common.AccountInfo;
import com.google.gerrit.extensions.common.TestSubmitRuleInfo; import com.google.gerrit.extensions.common.TestSubmitRuleInfo;
import com.google.gerrit.extensions.common.TestSubmitRuleInput; import com.google.gerrit.extensions.common.TestSubmitRuleInput;

View File

@@ -15,7 +15,7 @@
package com.google.gerrit.server.restapi.change; package com.google.gerrit.server.restapi.change;
import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects;
import com.google.gerrit.common.data.SubmitTypeRecord; import com.google.gerrit.entities.SubmitTypeRecord;
import com.google.gerrit.extensions.client.SubmitType; import com.google.gerrit.extensions.client.SubmitType;
import com.google.gerrit.extensions.common.TestSubmitRuleInput; import com.google.gerrit.extensions.common.TestSubmitRuleInput;
import com.google.gerrit.extensions.common.TestSubmitRuleInput.Filters; import com.google.gerrit.extensions.common.TestSubmitRuleInput.Filters;

View File

@@ -15,7 +15,7 @@
package com.google.gerrit.server.restapi.config; package com.google.gerrit.server.restapi.config;
import com.google.common.flogger.FluentLogger; import com.google.common.flogger.FluentLogger;
import com.google.gerrit.common.data.ContributorAgreement; import com.google.gerrit.entities.ContributorAgreement;
import com.google.gerrit.entities.GroupReference; import com.google.gerrit.entities.GroupReference;
import com.google.gerrit.exceptions.NoSuchGroupException; import com.google.gerrit.exceptions.NoSuchGroupException;
import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.exceptions.StorageException;

View File

@@ -19,7 +19,7 @@ import static java.util.stream.Collectors.toList;
import com.google.common.base.CharMatcher; import com.google.common.base.CharMatcher;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.gerrit.common.data.ContributorAgreement; import com.google.gerrit.entities.ContributorAgreement;
import com.google.gerrit.extensions.common.AccountDefaultDisplayName; import com.google.gerrit.extensions.common.AccountDefaultDisplayName;
import com.google.gerrit.extensions.common.AccountsInfo; import com.google.gerrit.extensions.common.AccountsInfo;
import com.google.gerrit.extensions.common.AuthInfo; import com.google.gerrit.extensions.common.AuthInfo;

View File

@@ -17,7 +17,7 @@ package com.google.gerrit.server.restapi.project;
import static com.google.gerrit.server.project.ProjectCache.illegalState; import static com.google.gerrit.server.project.ProjectCache.illegalState;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.gerrit.common.data.AccessSection; import com.google.gerrit.entities.AccessSection;
import com.google.gerrit.entities.Change; import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.PatchSet; import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.Project; import com.google.gerrit.entities.Project;

View File

@@ -15,8 +15,8 @@
package com.google.gerrit.server.restapi.project; package com.google.gerrit.server.restapi.project;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.gerrit.common.data.LabelFunction; import com.google.gerrit.entities.LabelFunction;
import com.google.gerrit.common.data.LabelType; import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.LabelValue; import com.google.gerrit.entities.LabelValue;
import com.google.gerrit.extensions.common.LabelDefinitionInfo; import com.google.gerrit.extensions.common.LabelDefinitionInfo;
import com.google.gerrit.extensions.common.LabelDefinitionInput; import com.google.gerrit.extensions.common.LabelDefinitionInput;

Some files were not shown because too many files have changed in this diff Show More