Merge branch 'stable-3.0' into stable-3.1
* stable-3.0:
Bump Bazel version to 3.5.0
Change-Id: I82fa34af8c4167951c50c9b3d1db3eae156b6981
diff --git a/.gitignore b/.gitignore
index 9a6a3fa..045b49d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
/.primary_build_tool
/bazel-*
/eclipse-out/
+/.apt_generated/
diff --git a/WORKSPACE b/WORKSPACE
index 04dccd2..d3a9d8d 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,7 +3,7 @@
load("//:bazlets.bzl", "load_bazlets")
load_bazlets(
- commit = "6d2b8f41ed34dad925b767399d1e4be378abb029",
+ commit = "3f9dadc615dc4053369a42d9ada37dafd8d4763c",
#local_path = "/home/<user>/projects/bazlets",
)
diff --git a/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/Configuration.java b/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/Configuration.java
index c05a01b..bb6db02 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/Configuration.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/Configuration.java
@@ -18,8 +18,8 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Table;
import com.google.gerrit.common.data.GroupDescription.Basic;
+import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.extensions.annotations.PluginName;
-import com.google.gerrit.reviewdb.client.AccountGroup;
import com.google.gerrit.server.config.PluginConfigFactory;
import com.google.gerrit.server.group.GroupResolver;
import com.google.inject.Inject;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimitFinder.java b/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimitFinder.java
index 173d1fc..4375f1a 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimitFinder.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimitFinder.java
@@ -16,7 +16,7 @@
import static com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS;
-import com.google.gerrit.reviewdb.client.AccountGroup;
+import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.account.GroupMembership;
import com.google.gerrit.server.group.SystemGroupBackend;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimitUploadPack.java b/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimitUploadPack.java
index 3af4f5b..fddb2ec 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimitUploadPack.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimitUploadPack.java
@@ -18,7 +18,7 @@
import static com.googlesource.gerrit.plugins.ratelimiter.Module.UPLOAD_PACK_PER_HOUR;
import com.google.common.cache.LoadingCache;
-import com.google.gerrit.reviewdb.client.Project;
+import com.google.gerrit.entities.Project;
import com.google.gerrit.server.CurrentUser;
import com.google.gerrit.server.git.validators.UploadValidationListener;
import com.google.gerrit.server.validators.ValidationException;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/ReplenishCommand.java b/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/ReplenishCommand.java
index f86784f..a4646d5 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/ReplenishCommand.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/ReplenishCommand.java
@@ -19,9 +19,9 @@
import com.google.common.cache.LoadingCache;
import com.google.gerrit.common.data.GlobalCapability;
+import com.google.gerrit.entities.Account;
import com.google.gerrit.extensions.annotations.CapabilityScope;
import com.google.gerrit.extensions.annotations.RequiresCapability;
-import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.sshd.CommandMetaData;
import com.google.gerrit.sshd.SshCommand;
import com.google.inject.Inject;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/UserResolver.java b/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/UserResolver.java
index 11dffed..0e79529 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/UserResolver.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/ratelimiter/UserResolver.java
@@ -14,7 +14,7 @@
package com.googlesource.gerrit.plugins.ratelimiter;
-import com.google.gerrit.reviewdb.client.Account;
+import com.google.gerrit.entities.Account;
import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.IdentifiedUser.GenericFactory;
import com.google.inject.Inject;
@@ -33,7 +33,7 @@
Optional<IdentifiedUser> getIdentifiedUser(String key) {
return isNumeric(key)
- ? Optional.ofNullable(userFactory.create(new Account.Id(Integer.parseInt(key))))
+ ? Optional.ofNullable(userFactory.create(Account.id(Integer.parseInt(key))))
: Optional.empty();
}
diff --git a/src/test/java/com/googlesource/gerrit/plugins/ratelimiter/ConfigurationTest.java b/src/test/java/com/googlesource/gerrit/plugins/ratelimiter/ConfigurationTest.java
index 4f8d1a1..cc353a5 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/ratelimiter/ConfigurationTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/ratelimiter/ConfigurationTest.java
@@ -19,7 +19,7 @@
import static org.mockito.Mockito.when;
import com.google.gerrit.common.data.GroupDescription;
-import com.google.gerrit.reviewdb.client.AccountGroup;
+import com.google.gerrit.entities.AccountGroup;
import com.google.gerrit.server.config.PluginConfigFactory;
import com.google.gerrit.server.group.GroupResolver;
import com.google.inject.ProvisionException;
@@ -51,12 +51,11 @@
when(pluginConfigFactoryMock.getGlobalPluginConfig(PLUGIN_NAME)).thenReturn(globalPluginConfig);
- when(administratorsGroupDescMock.getGroupUUID())
- .thenReturn(new AccountGroup.UUID("admin_uuid"));
+ when(administratorsGroupDescMock.getGroupUUID()).thenReturn(AccountGroup.uuid("admin_uuid"));
when(groupsCollectionMock.parseId("Administrators")).thenReturn(administratorsGroupDescMock);
when(someGroupDescMock.getName()).thenReturn("someGroup");
- when(someGroupDescMock.getGroupUUID()).thenReturn(new AccountGroup.UUID("some_uuid"));
+ when(someGroupDescMock.getGroupUUID()).thenReturn(AccountGroup.uuid("some_uuid"));
when(groupsCollectionMock.parseId("someGroup")).thenReturn(someGroupDescMock);
}
diff --git a/src/test/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimitUploadPackIT.java b/src/test/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimitUploadPackIT.java
index 352389b..b324a2a 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimitUploadPackIT.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/ratelimiter/RateLimitUploadPackIT.java
@@ -14,14 +14,16 @@
package com.googlesource.gerrit.plugins.ratelimiter;
+import static com.google.gerrit.testing.GerritJUnit.assertThrows;
+
import com.google.gerrit.acceptance.GlobalPluginConfig;
import com.google.gerrit.acceptance.LightweightPluginDaemonTest;
import com.google.gerrit.acceptance.TestPlugin;
import com.google.gerrit.acceptance.UseLocalDisk;
+import com.google.gerrit.entities.Project;
import com.google.gerrit.extensions.api.groups.GroupInput;
import com.google.gerrit.extensions.api.projects.ProjectInput;
import com.google.gerrit.extensions.restapi.RestApiException;
-import com.google.gerrit.reviewdb.client.Project;
import org.eclipse.jgit.api.errors.TransportException;
import org.junit.Test;
@@ -55,9 +57,8 @@
createProjectWithChange(projectA);
createProjectWithChange(projectB);
- cloneProject(new Project.NameKey(projectA), user);
- exception.expect(TransportException.class);
- cloneProject(new Project.NameKey(projectB), user);
+ cloneProject(Project.nameKey(projectA), user);
+ assertThrows(TransportException.class, () -> cloneProject(Project.nameKey(projectB), user));
}
private void addUserToNewGroup() throws RestApiException {