CodeOwnerResolver: Improve message for inactive accounts
Currently the message only says that the account is inactive:
account <account-id> for email <email> is inactive
Inactive accounts are ignored, but it's not clear from this message.
Hence change it to:
ignoring inactive account <account-id> for email <email>
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I706b7c7ff24bb936735649c83ad530215b62cf0c
diff --git a/java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolver.java b/java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolver.java
index e19bb36..1bb01fc 100644
--- a/java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolver.java
+++ b/java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolver.java
@@ -440,7 +440,7 @@
} else {
messages.add(
String.format(
- "account %s for email %s is inactive", accountState.account().id(), email));
+ "ignoring inactive account %s for email %s", accountState.account().id(), email));
}
}
return activeAccounts.build();
diff --git a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CheckCodeOwnerIT.java b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CheckCodeOwnerIT.java
index d1fa577..0f12736 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CheckCodeOwnerIT.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CheckCodeOwnerIT.java
@@ -440,7 +440,8 @@
"found email %s as code owner in %s",
inactiveUser.email(), getCodeOwnerConfigFilePath(ROOT_PATH)),
String.format(
- "account %s for email %s is inactive", inactiveUser.id(), inactiveUser.email()));
+ "ignoring inactive account %s for email %s",
+ inactiveUser.id(), inactiveUser.email()));
}
@Test
diff --git a/javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolverTest.java b/javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolverTest.java
index 0787e9a..c2cd1dc 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolverTest.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/backend/CodeOwnerResolverTest.java
@@ -198,7 +198,8 @@
assertThat(result).isEmpty();
assertThat(result)
.hasMessagesThat()
- .contains(String.format("account %s for email %s is inactive", user.id(), user.email()));
+ .contains(
+ String.format("ignoring inactive account %s for email %s", user.id(), user.email()));
}
@Test