Merge changes Ib8afe7ec,I22a6313a
* changes: Set submitWholeTopic field in ServerInfo only if it is not false Return value of change.api.excludeMergeableInChangeInfo in ServerInfo
This commit is contained in:
@@ -1539,11 +1539,15 @@ button].
|
||||
|`update_delay` ||
|
||||
link:config-gerrit.html#change.updateDelay[How often in seconds the web
|
||||
interface should poll for updates to the currently open change].
|
||||
|`submit_whole_topic` ||
|
||||
|`submit_whole_topic` |not set if `false`|
|
||||
link:config-gerrit.html#change.submitWholeTopic[A configuration if
|
||||
the whole topic is submitted].
|
||||
|`disable_private_changes` |not set if `false`|
|
||||
Returns true if private changes are disabled.
|
||||
|`exclude_mergeable_in_change_info` |not set if `false`|
|
||||
Value of the link:config-gerrit.html#change.api.excludeMergeableInChangeInfo[
|
||||
configuration parameter] that controls whether the mergeability bit in
|
||||
link:rest-api-changes.html#change-info[ChangeInfo] will never be set.
|
||||
|=============================
|
||||
|
||||
[[check-account-external-ids-input]]
|
||||
|
@@ -23,4 +23,5 @@ public class ChangeConfigInfo {
|
||||
public String replyTooltip;
|
||||
public int updateDelay;
|
||||
public Boolean submitWholeTopic;
|
||||
public Boolean excludeMergeableInChangeInfo;
|
||||
}
|
||||
|
@@ -234,7 +234,9 @@ public class GetServerInfo implements RestReadView<ConfigResource> {
|
||||
+ "\u2026";
|
||||
info.updateDelay =
|
||||
(int) ConfigUtil.getTimeUnit(config, "change", null, "updateDelay", 300, TimeUnit.SECONDS);
|
||||
info.submitWholeTopic = MergeSuperSet.wholeTopicEnabled(config);
|
||||
info.submitWholeTopic = toBoolean(MergeSuperSet.wholeTopicEnabled(config));
|
||||
info.excludeMergeableInChangeInfo =
|
||||
toBoolean(this.config.getBoolean("change", "api", "excludeMergeableInChangeInfo", false));
|
||||
info.disablePrivateChanges =
|
||||
toBoolean(this.config.getBoolean("change", null, "disablePrivateChanges", false));
|
||||
return info;
|
||||
|
@@ -168,6 +168,8 @@ public class ServerInfoIT extends AbstractDaemonTest {
|
||||
assertThat(i.change.replyLabel).isEqualTo("Reply\u2026");
|
||||
assertThat(i.change.updateDelay).isEqualTo(300);
|
||||
assertThat(i.change.disablePrivateChanges).isNull();
|
||||
assertThat(i.change.submitWholeTopic).isNull();
|
||||
assertThat(i.change.excludeMergeableInChangeInfo).isNull();
|
||||
|
||||
// download
|
||||
assertThat(i.download.archives).containsExactly("tar", "tbz2", "tgz", "txz");
|
||||
@@ -190,4 +192,18 @@ public class ServerInfoIT extends AbstractDaemonTest {
|
||||
// user
|
||||
assertThat(i.user.anonymousCowardName).isEqualTo(AnonymousCowardNameProvider.DEFAULT);
|
||||
}
|
||||
|
||||
@Test
|
||||
@GerritConfig(name = "change.submitWholeTopic", value = "true")
|
||||
public void serverConfigWithSubmitWholeTopic() throws Exception {
|
||||
ServerInfo i = gApi.config().server().getInfo();
|
||||
assertThat(i.change.submitWholeTopic).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
@GerritConfig(name = "change.api.excludeMergeableInChangeInfo", value = "true")
|
||||
public void serverConfigWithExcludeMergeableInChangeInfo() throws Exception {
|
||||
ServerInfo i = gApi.config().server().getInfo();
|
||||
assertThat(i.change.excludeMergeableInChangeInfo).isTrue();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user