From 2cc335450ce123d7f3da06c816b84a932908c8eb Mon Sep 17 00:00:00 2001 From: Ben Rohlfs Date: Fri, 28 Feb 2020 12:44:09 +0100 Subject: [PATCH] Add configs for enabling attention set and assignee Change-Id: Ie1d5757150726df145be9d64677d785abf845ea0 --- Documentation/config-gerrit.txt | 14 ++++++++++++++ Documentation/rest-api-config.txt | 4 ++++ .../gerrit/extensions/common/ChangeConfigInfo.java | 2 ++ .../server/restapi/config/GetServerInfo.java | 3 +++ .../acceptance/rest/config/ServerInfoIT.java | 4 ++++ 5 files changed, 27 insertions(+) diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt index 0e77e2065e..b2c8a35ffc 100644 --- a/Documentation/config-gerrit.txt +++ b/Documentation/config-gerrit.txt @@ -1222,6 +1222,20 @@ If set to true, users are not allowed to create private changes. + The default is false. +[[change.enableAttentionSet]]change.enableAttentionSet:: ++ +If set to true, then all UI features for using and interacting with the +attention set are enabled. ++ +The default is false for now, but will be changed to true in Q2 2020. + +[[change.enableAssignee]]change.enableAssignee:: ++ +If set to true, then all UI features for using and interacting with the +assignee are enabled. ++ +The default is true for now, but will be changed to false in Q2 2020. + [[change.largeChange]]change.largeChange:: + Number of changed lines from which on a change is considered as a large diff --git a/Documentation/rest-api-config.txt b/Documentation/rest-api-config.txt index 2f723403fa..f76e0b8090 100644 --- a/Documentation/rest-api-config.txt +++ b/Documentation/rest-api-config.txt @@ -1574,6 +1574,10 @@ Value of the link:config-gerrit.html#change.mergeabilityComputationBehavior[ configuration parameter] that controls whether the mergeability bit in link:rest-api-changes.html#change-info[ChangeInfo] will never be set and if the bit is indexed. +|`enable_attention_set` |defaults to `false`| +Returns true if attention set UI features are enabled. +|`enable_assignee` |defaults to `true`| +Returns true if assignee related UI features are enabled. |============================= [[change-index-config-info]] diff --git a/java/com/google/gerrit/extensions/common/ChangeConfigInfo.java b/java/com/google/gerrit/extensions/common/ChangeConfigInfo.java index 66a2dd5e1b..a441bfdd24 100644 --- a/java/com/google/gerrit/extensions/common/ChangeConfigInfo.java +++ b/java/com/google/gerrit/extensions/common/ChangeConfigInfo.java @@ -25,4 +25,6 @@ public class ChangeConfigInfo { public int updateDelay; public Boolean submitWholeTopic; public String mergeabilityComputationBehavior; + public Boolean enableAttentionSet; + public Boolean enableAssignee; } diff --git a/java/com/google/gerrit/server/restapi/config/GetServerInfo.java b/java/com/google/gerrit/server/restapi/config/GetServerInfo.java index 0f1369cb6a..4ddc3e83ee 100644 --- a/java/com/google/gerrit/server/restapi/config/GetServerInfo.java +++ b/java/com/google/gerrit/server/restapi/config/GetServerInfo.java @@ -237,6 +237,9 @@ public class GetServerInfo implements RestReadView { toBoolean(this.config.getBoolean("change", null, "disablePrivateChanges", false)); info.mergeabilityComputationBehavior = MergeabilityComputationBehavior.fromConfig(config).name(); + info.enableAttentionSet = + toBoolean(this.config.getBoolean("change", null, "enableAttentionSet", false)); + info.enableAssignee = toBoolean(this.config.getBoolean("change", null, "enableAssignee", true)); return info; } diff --git a/javatests/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java b/javatests/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java index 802c5b35b8..cef66654b5 100644 --- a/javatests/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java @@ -63,6 +63,8 @@ public class ServerInfoIT extends AbstractDaemonTest { @GerritConfig(name = "change.replyLabel", value = "Vote") @GerritConfig(name = "change.updateDelay", value = "50s") @GerritConfig(name = "change.disablePrivateChanges", value = "true") + @GerritConfig(name = "change.enableAttentionSet", value = "true") + @GerritConfig(name = "change.enableAssignee", value = "true") // download @GerritConfig( @@ -105,6 +107,8 @@ public class ServerInfoIT extends AbstractDaemonTest { assertThat(i.change.replyLabel).isEqualTo("Vote\u2026"); assertThat(i.change.updateDelay).isEqualTo(50); assertThat(i.change.disablePrivateChanges).isTrue(); + assertThat(i.change.enableAttentionSet).isTrue(); + assertThat(i.change.enableAssignee).isTrue(); // download assertThat(i.download.archives).containsExactly("tar", "tbz2", "tgz", "txz");