Merge "Add lots of reporting events for checks interactions"
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt
index 5418555..ad110df 100644
--- a/Documentation/config-gerrit.txt
+++ b/Documentation/config-gerrit.txt
@@ -2028,6 +2028,14 @@
+
Default is 1 hour.
+[[dashboard]]
+=== Section dashboard
+
+[[dashboard.submitRequirementColumns]]dashboard.submitRequirementColumns::
++
+The list of submit requirement names that should be displayed as separate
+columns in the dashboard.
+
[[download]]
=== Section download
diff --git a/Documentation/rest-api-config.txt b/Documentation/rest-api-config.txt
index bd93b8b..86d7f58 100644
--- a/Documentation/rest-api-config.txt
+++ b/Documentation/rest-api-config.txt
@@ -2008,6 +2008,10 @@
|`default_theme` |optional|
URL to a default Gerrit UI theme plugin, if available.
Located in `/static/gerrit-theme.js` by default.
+|`submit_requirement_dashboard_columns` ||
+The list of submit requirement names that should be displayed as separate
+columns in the dashboard. If empty, the default is to display all submit
+requirements that are applicable for changes appearing in the dashboard.
|=======================================
[[sshd-info]]
diff --git a/java/com/google/gerrit/extensions/common/ServerInfo.java b/java/com/google/gerrit/extensions/common/ServerInfo.java
index bc7fcfd..ce65240 100644
--- a/java/com/google/gerrit/extensions/common/ServerInfo.java
+++ b/java/com/google/gerrit/extensions/common/ServerInfo.java
@@ -14,6 +14,8 @@
package com.google.gerrit.extensions.common;
+import java.util.List;
+
/** API response containing values from {@code gerrit.config} as nested objects. */
public class ServerInfo {
public AccountsInfo accounts;
@@ -28,4 +30,5 @@
public UserConfigInfo user;
public ReceiveInfo receive;
public String defaultTheme;
+ public List<String> submitRequirementDashboardColumns;
}
diff --git a/java/com/google/gerrit/server/restapi/config/GetServerInfo.java b/java/com/google/gerrit/server/restapi/config/GetServerInfo.java
index ae11d71..09052a6 100644
--- a/java/com/google/gerrit/server/restapi/config/GetServerInfo.java
+++ b/java/com/google/gerrit/server/restapi/config/GetServerInfo.java
@@ -66,8 +66,10 @@
import com.google.inject.Inject;
import java.nio.file.Files;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
+import java.util.List;
import java.util.concurrent.TimeUnit;
import org.eclipse.jgit.lib.Config;
@@ -153,6 +155,7 @@
info.user = getUserInfo();
info.receive = getReceiveInfo();
+ info.submitRequirementDashboardColumns = getSubmitRequirementDashboardColumns();
return Response.ok(info);
}
@@ -373,6 +376,10 @@
return info;
}
+ private List<String> getSubmitRequirementDashboardColumns() {
+ return Arrays.asList(config.getStringList("dashboard", null, "submitRequirementColumns"));
+ }
+
private static Boolean toBoolean(boolean v) {
return v ? v : null;
}
diff --git a/javatests/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java b/javatests/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java
index 97288a8..8131352 100644
--- a/javatests/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java
+++ b/javatests/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java
@@ -192,6 +192,9 @@
// user
assertThat(i.user.anonymousCowardName).isEqualTo(AnonymousCowardNameProvider.DEFAULT);
+
+ // submit requirement columns in dashboard
+ assertThat(i.submitRequirementDashboardColumns).isEmpty();
}
@Test
@@ -202,6 +205,15 @@
}
@Test
+ @GerritConfig(
+ name = "dashboard.submitRequirementColumns",
+ values = {"Code-Review", "Verified"})
+ public void serverConfigWithMultipleSubmitRequirementColumn() throws Exception {
+ ServerInfo i = gApi.config().server().getInfo();
+ assertThat(i.submitRequirementDashboardColumns).containsExactly("Code-Review", "Verified");
+ }
+
+ @Test
@GerritConfig(name = "change.mergeabilityComputationBehavior", value = "NEVER")
public void mergeabilityComputationBehavior_neverCompute() throws Exception {
ServerInfo i = gApi.config().server().getInfo();