Add configs for enabling attention set and assignee
Change-Id: Ie1d5757150726df145be9d64677d785abf845ea0
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt
index 0e77e20..b2c8a35 100644
--- a/Documentation/config-gerrit.txt
+++ b/Documentation/config-gerrit.txt
@@ -1222,6 +1222,20 @@
+
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 2f72340..f76e0b8 100644
--- a/Documentation/rest-api-config.txt
+++ b/Documentation/rest-api-config.txt
@@ -1574,6 +1574,10 @@
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 66a2dd5..a441bfd 100644
--- a/java/com/google/gerrit/extensions/common/ChangeConfigInfo.java
+++ b/java/com/google/gerrit/extensions/common/ChangeConfigInfo.java
@@ -25,4 +25,6 @@
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 0f1369c..4ddc3e8 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 @@
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 802c5b3..cef66654 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 @@
@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 @@
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");