Update bazlets to latest stable-2.14 and adjust to 2.14.12 API
Username validity is now checked with ExternalId.isValidUsername
rather than pattern match on Account.USER_NAME_PATTERN.
Change-Id: I927fcffd9f2f1dc2d6e059f1722d84732180efa4
diff --git a/WORKSPACE b/WORKSPACE
index 9347aa2..03e715d 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,7 +3,7 @@
load("//:bazlets.bzl", "load_bazlets")
load_bazlets(
- commit = "11ce7521051ca73598d099aa8a396c9ffe932a74",
+ commit = "cbbab83e99c3fa44b6ff37863cbd7bb3e9f84f47",
# local_path = "/home/<user>/projects/bazlets",
)
diff --git a/src/main/java/com/googlesource/gerrit/plugins/importer/AccountUtil.java b/src/main/java/com/googlesource/gerrit/plugins/importer/AccountUtil.java
index b3f62de..c4e3e65 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/importer/AccountUtil.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/importer/AccountUtil.java
@@ -32,6 +32,7 @@
import com.google.gerrit.server.account.AccountState;
import com.google.gerrit.server.account.AuthRequest;
import com.google.gerrit.server.account.CreateAccount;
+import com.google.gerrit.server.account.ExternalId;
import com.google.gerrit.server.account.VersionedAuthorizedKeys;
import com.google.gerrit.server.config.AuthConfig;
import com.google.gwtorm.server.OrmException;
@@ -113,7 +114,7 @@
private Account.Id createAccountByLdapAndAddSshKeys(GerritApi api, AccountInfo acc)
throws NoSuchAccountException, IOException, OrmException, RestApiException,
ConfigInvalidException {
- if (!acc.username.matches(Account.USER_NAME_PATTERN)) {
+ if (!ExternalId.isValidUsername(acc.username)) {
throw new NoSuchAccountException(String.format("User %s not found", acc.username));
}