diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt index d241b981c5..01eca78f01 100644 --- a/Documentation/config-gerrit.txt +++ b/Documentation/config-gerrit.txt @@ -1097,13 +1097,6 @@ Allow blame on side by side diff. If set to false, blame cannot be used. + Default is true. -[[change.allowDrafts]]change.allowDrafts:: -+ -Allow drafts workflow. If set to false, drafts cannot be created, -deleted or published. -+ -Default is true. - [[change.cacheAutomerge]]change.cacheAutomerge:: + When reviewing diff commits, the left-hand side shows the output of the diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java index 1c4d7e4a7c..5fdf8bc35c 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/config/ServerInfoIT.java @@ -54,7 +54,6 @@ public class ServerInfoIT extends AbstractDaemonTest { @GerritConfig(name = "auth.httpPasswordUrl", value = "https://example.com/password") // change - @GerritConfig(name = "change.allowDrafts", value = "false") @GerritConfig(name = "change.largeChange", value = "300") @GerritConfig(name = "change.replyTooltip", value = "Publish votes and draft comments") @GerritConfig(name = "change.replyLabel", value = "Vote") @@ -99,7 +98,6 @@ public class ServerInfoIT extends AbstractDaemonTest { assertThat(i.auth.httpPasswordUrl).isNull(); // change - assertThat(i.change.allowDrafts).isNull(); assertThat(i.change.largeChange).isEqualTo(300); assertThat(i.change.replyTooltip).startsWith("Publish votes and draft comments"); assertThat(i.change.replyLabel).isEqualTo("Vote\u2026"); @@ -173,7 +171,6 @@ public class ServerInfoIT extends AbstractDaemonTest { assertThat(i.auth.httpPasswordUrl).isNull(); // change - assertThat(i.change.allowDrafts).isTrue(); assertThat(i.change.largeChange).isEqualTo(500); assertThat(i.change.replyTooltip).startsWith("Reply and score"); assertThat(i.change.replyLabel).isEqualTo("Reply\u2026"); diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/common/ChangeConfigInfo.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/common/ChangeConfigInfo.java index 9e02ae51c6..1e822e37e6 100644 --- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/common/ChangeConfigInfo.java +++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/common/ChangeConfigInfo.java @@ -17,7 +17,6 @@ package com.google.gerrit.extensions.common; public class ChangeConfigInfo { public Boolean allowBlame; public Boolean showAssigneeInChangesTable; - public Boolean allowDrafts; public Boolean disablePrivateChanges; public int largeChange; public String replyLabel; diff --git a/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/info/ServerInfo.java b/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/info/ServerInfo.java index dcd1cf1e39..d3274e60fe 100644 --- a/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/info/ServerInfo.java +++ b/gerrit-gwtui-common/src/main/java/com/google/gerrit/client/info/ServerInfo.java @@ -60,8 +60,6 @@ public class ServerInfo extends JavaScriptObject { protected ServerInfo() {} public static class ChangeConfigInfo extends JavaScriptObject { - public final native boolean allowDrafts() /*-{ return this.allow_drafts || false; }-*/; - public final native boolean allowBlame() /*-{ return this.allow_blame || false; }-*/; public final native int largeChange() /*-{ return this.large_change || 0; }-*/; diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/DeleteChangeOp.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/DeleteChangeOp.java index 8df6e59ed1..e148b80363 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/DeleteChangeOp.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/DeleteChangeOp.java @@ -38,15 +38,10 @@ import java.io.IOException; import java.util.Collection; import java.util.Map; import java.util.Optional; -import org.eclipse.jgit.lib.Config; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.revwalk.RevWalk; class DeleteChangeOp implements BatchUpdateOp { - static boolean allowDrafts(Config cfg) { - return cfg.getBoolean("change", "allowDrafts", true); - } - static ReviewDb unwrap(ReviewDb db) { // This is special. We want to delete exactly the rows that are present in // the database, even when reading everything else from NoteDb, so we need diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/config/GetServerInfo.java b/gerrit-server/src/main/java/com/google/gerrit/server/config/GetServerInfo.java index 2f37aeb142..7a1031e966 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/config/GetServerInfo.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/config/GetServerInfo.java @@ -222,7 +222,6 @@ public class GetServerInfo implements RestReadView { private ChangeConfigInfo getChangeInfo(Config cfg) { ChangeConfigInfo info = new ChangeConfigInfo(); info.allowBlame = toBoolean(cfg.getBoolean("change", "allowBlame", true)); - info.allowDrafts = toBoolean(cfg.getBoolean("change", "allowDrafts", true)); boolean hasAssigneeInIndex = indexes.getSearchIndex().getSchema().hasField(ChangeField.ASSIGNEE); info.showAssigneeInChangesTable = diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/query/change/ChangeQueryBuilder.java b/gerrit-server/src/main/java/com/google/gerrit/server/query/change/ChangeQueryBuilder.java index 16d07d4a24..8205166687 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/query/change/ChangeQueryBuilder.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/query/change/ChangeQueryBuilder.java @@ -217,7 +217,6 @@ public class ChangeQueryBuilder extends QueryBuilder { final Provider db; final StarredChangesUtil starredChangesUtil; final SubmitDryRun submitDryRun; - final boolean allowsDrafts; private final Provider self; @@ -281,7 +280,6 @@ public class ChangeQueryBuilder extends QueryBuilder { listMembers, starredChangesUtil, accountCache, - cfg == null ? true : cfg.getBoolean("change", "allowDrafts", true), notesMigration); } @@ -313,7 +311,6 @@ public class ChangeQueryBuilder extends QueryBuilder { Provider listMembers, StarredChangesUtil starredChangesUtil, AccountCache accountCache, - boolean allowsDrafts, NotesMigration notesMigration) { this.db = db; this.queryProvider = queryProvider; @@ -341,7 +338,6 @@ public class ChangeQueryBuilder extends QueryBuilder { this.listMembers = listMembers; this.starredChangesUtil = starredChangesUtil; this.accountCache = accountCache; - this.allowsDrafts = allowsDrafts; this.hasOperands = hasOperands; this.notesMigration = notesMigration; } @@ -375,7 +371,6 @@ public class ChangeQueryBuilder extends QueryBuilder { listMembers, starredChangesUtil, accountCache, - allowsDrafts, notesMigration); }