Merge branch 'stable-3.0'
* stable-3.0:
Remove leftovers of unsupported urlAlias configuration settings
Documentation: add note urlAlias only supports GWT UI pages
Update git submodules
Improve the UX with colors in dark theme
Update git submodules
Update git submodules
Change-Id: I77719dbdd14fe3aadba585b79c10175ef1fc88a4
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt
index d899b97..a0e7b3e 100644
--- a/Documentation/config-gerrit.txt
+++ b/Documentation/config-gerrit.txt
@@ -4783,47 +4783,6 @@
link:#schedule-configuration-examples[Schedule examples] can be found
in the link:#schedule-configuration[Schedule Configuration] section.
-[[urlAlias]]
-=== Section urlAlias
-
-URL aliases define regular expressions for URL tokens that are mapped
-to target URL tokens.
-
-Each URL alias must be specified in its own subsection. The subsection
-name should be a descriptive name. It must be unique, but is not
-interpreted in any way.
-
-The URL aliases are applied in no particular order. The first matching
-URL alias is used and further matches are ignored.
-
-URL aliases can be used to map plugin screens into the Gerrit URL
-namespace, or to replace Gerrit screens by plugin screens.
-
-Example:
-
-----
-[urlAlias "MyPluginScreen"]
- match = /myscreen/(.*)
- token = /x/myplugin/myscreen/$1
-[urlAlias "MyChangeScreen"]
- match = /c/(.*)
- token = /x/myplugin/c/$1
-----
-
-[[urlAlias.match]]urlAlias.match::
-+
-A regular expression for a URL token.
-+
-The matched URL token is replaced by `urlAlias.token`.
-
-[[urlAlias.token]]urlAlias.token::
-+
-The target URL token.
-+
-It can contain placeholders for the groups matched by the
-`urlAlias.match` regular expression: `$1` for the first matched group,
-`$2` for the second matched group, etc.
-
[[submodule]]
=== Section submodule
diff --git a/Documentation/rest-api-accounts.txt b/Documentation/rest-api-accounts.txt
index 6fb9220..7097a16 100644
--- a/Documentation/rest-api-accounts.txt
+++ b/Documentation/rest-api-accounts.txt
@@ -2764,9 +2764,6 @@
|`change_table` ||
The columns to display in the change table (PolyGerrit only). The default is
empty, which will default columns as determined by the frontend.
-|`url_aliases` |optional|
-A map of URL path pairs, where the first URL path is an alias for the
-second URL path.
|`email_strategy` ||
The type of email strategy to use. On `ENABLED`, the user will receive emails
from Gerrit. On `CC_ON_OWN_COMMENTS` the user will also receive emails for
@@ -2829,9 +2826,6 @@
|`change_table` ||
The columns to display in the change table (PolyGerrit only). The default is
empty, which will default columns as determined by the frontend.
-|`url_aliases` |optional|
-A map of URL path pairs, where the first URL path is an alias for the
-second URL path.
|`email_strategy` |optional|
The type of email strategy to use. On `ENABLED`, the user will receive emails
from Gerrit. On `CC_ON_OWN_COMMENTS` the user will also receive emails for
diff --git a/Documentation/rest-api-config.txt b/Documentation/rest-api-config.txt
index 2b10e33..021a1bb 100644
--- a/Documentation/rest-api-config.txt
+++ b/Documentation/rest-api-config.txt
@@ -1963,11 +1963,6 @@
Information about the configuration from the
link:config-gerrit.html#suggest[suggest] section as link:#suggest-info[
SuggestInfo] entity.
-|`url_aliases` |optional|
-A map of URL aliases, where a regular expression for an URL token is
-mapped to a target URL token. The target URL token can contain
-placeholders for the groups matched by the regular expression: `$1` for
-the first matched group, `$2` for the second matched group, etc.
|`user` ||
Information about the configuration from the
link:config-gerrit.html#user[user] section as link:#user-config-info[
diff --git a/java/com/google/gerrit/extensions/client/GeneralPreferencesInfo.java b/java/com/google/gerrit/extensions/client/GeneralPreferencesInfo.java
index f5a740e..458bcf5 100644
--- a/java/com/google/gerrit/extensions/client/GeneralPreferencesInfo.java
+++ b/java/com/google/gerrit/extensions/client/GeneralPreferencesInfo.java
@@ -15,7 +15,6 @@
package com.google.gerrit.extensions.client;
import java.util.List;
-import java.util.Map;
/** Preferences about a single user. */
public class GeneralPreferencesInfo {
@@ -145,7 +144,6 @@
public Boolean workInProgressByDefault;
public List<MenuItem> my;
public List<String> changeTable;
- public Map<String, String> urlAliases;
public DateFormat getDateFormat() {
if (dateFormat == null) {
diff --git a/java/com/google/gerrit/extensions/common/ServerInfo.java b/java/com/google/gerrit/extensions/common/ServerInfo.java
index 8904f0a..82d5bc8 100644
--- a/java/com/google/gerrit/extensions/common/ServerInfo.java
+++ b/java/com/google/gerrit/extensions/common/ServerInfo.java
@@ -14,8 +14,6 @@
package com.google.gerrit.extensions.common;
-import java.util.Map;
-
public class ServerInfo {
public AccountsInfo accounts;
public AuthInfo auth;
@@ -26,7 +24,6 @@
public PluginConfigInfo plugin;
public SshdInfo sshd;
public SuggestInfo suggest;
- public Map<String, String> urlAliases;
public UserConfigInfo user;
public ReceiveInfo receive;
public String defaultTheme;
diff --git a/java/com/google/gerrit/server/account/Preferences.java b/java/com/google/gerrit/server/account/Preferences.java
index 63ff9e3..c15e6b0 100644
--- a/java/com/google/gerrit/server/account/Preferences.java
+++ b/java/com/google/gerrit/server/account/Preferences.java
@@ -15,7 +15,6 @@
import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
import com.google.gerrit.common.Nullable;
import com.google.gerrit.extensions.client.DiffPreferencesInfo;
import com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace;
@@ -77,8 +76,6 @@
public abstract Optional<ImmutableList<String>> changeTable();
- public abstract Optional<ImmutableMap<String, String>> urlAliases();
-
@AutoValue.Builder
public abstract static class Builder {
abstract Builder changesPerPage(@Nullable Integer val);
@@ -121,8 +118,6 @@
abstract Builder changeTable(@Nullable ImmutableList<String> val);
- abstract Builder urlAliases(@Nullable ImmutableMap<String, String> val);
-
abstract General build();
}
@@ -148,7 +143,6 @@
.workInProgressByDefault(info.workInProgressByDefault)
.my(info.my == null ? null : ImmutableList.copyOf(info.my))
.changeTable(info.changeTable == null ? null : ImmutableList.copyOf(info.changeTable))
- .urlAliases(info.urlAliases == null ? null : ImmutableMap.copyOf(info.urlAliases))
.build();
}
@@ -174,7 +168,6 @@
info.workInProgressByDefault = workInProgressByDefault().orElse(null);
info.my = my().orElse(null);
info.changeTable = changeTable().orElse(null);
- info.urlAliases = urlAliases().orElse(null);
return info;
}
}
diff --git a/java/com/google/gerrit/server/account/StoredPreferences.java b/java/com/google/gerrit/server/account/StoredPreferences.java
index 31705db..05b8f41 100644
--- a/java/com/google/gerrit/server/account/StoredPreferences.java
+++ b/java/com/google/gerrit/server/account/StoredPreferences.java
@@ -21,11 +21,8 @@
import static com.google.gerrit.server.git.UserConfigSections.CHANGE_TABLE;
import static com.google.gerrit.server.git.UserConfigSections.CHANGE_TABLE_COLUMN;
import static com.google.gerrit.server.git.UserConfigSections.KEY_ID;
-import static com.google.gerrit.server.git.UserConfigSections.KEY_MATCH;
import static com.google.gerrit.server.git.UserConfigSections.KEY_TARGET;
-import static com.google.gerrit.server.git.UserConfigSections.KEY_TOKEN;
import static com.google.gerrit.server.git.UserConfigSections.KEY_URL;
-import static com.google.gerrit.server.git.UserConfigSections.URL_ALIAS;
import static java.util.Objects.requireNonNull;
import com.google.common.base.Strings;
@@ -47,9 +44,7 @@
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import java.util.Optional;
import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.lib.CommitBuilder;
@@ -151,7 +146,6 @@
parseDefaultGeneralPreferences(defaultCfg, null));
setChangeTable(cfg, mergedGeneralPreferencesInput.changeTable);
setMy(cfg, mergedGeneralPreferencesInput.my);
- setUrlAliases(cfg, mergedGeneralPreferencesInput.urlAliases);
// evict the cached general preferences
this.generalPreferences = null;
@@ -246,11 +240,9 @@
if (input != null) {
r.changeTable = input.changeTable;
r.my = input.my;
- r.urlAliases = input.urlAliases;
} else {
r.changeTable = parseChangeTableColumns(cfg, defaultCfg);
r.my = parseMyMenus(cfg, defaultCfg);
- r.urlAliases = parseUrlAliases(cfg, defaultCfg);
}
return r;
}
@@ -404,14 +396,6 @@
return my;
}
- private static Map<String, String> parseUrlAliases(Config cfg, @Nullable Config defaultCfg) {
- Map<String, String> urlAliases = urlAliases(cfg);
- if (urlAliases == null && defaultCfg != null) {
- urlAliases = urlAliases(defaultCfg);
- }
- return urlAliases;
- }
-
public static GeneralPreferencesInfo readDefaultGeneralPreferences(
AllUsersName allUsersName, Repository allUsersRepo)
throws IOException, ConfigInvalidException {
@@ -449,7 +433,6 @@
GeneralPreferencesInfo.defaults());
setMy(defaultPrefs.getConfig(), input.my);
setChangeTable(defaultPrefs.getConfig(), input.changeTable);
- setUrlAliases(defaultPrefs.getConfig(), input.urlAliases);
defaultPrefs.commit(md);
return parseGeneralPreferences(defaultPrefs.getConfig(), null, null);
@@ -554,31 +537,6 @@
}
}
- private static Map<String, String> urlAliases(Config cfg) {
- HashMap<String, String> urlAliases = new HashMap<>();
- for (String subsection : cfg.getSubsections(URL_ALIAS)) {
- urlAliases.put(
- cfg.getString(URL_ALIAS, subsection, KEY_MATCH),
- cfg.getString(URL_ALIAS, subsection, KEY_TOKEN));
- }
- return !urlAliases.isEmpty() ? urlAliases : null;
- }
-
- private static void setUrlAliases(Config cfg, Map<String, String> urlAliases) {
- if (urlAliases != null) {
- for (String subsection : cfg.getSubsections(URL_ALIAS)) {
- cfg.unsetSection(URL_ALIAS, subsection);
- }
-
- int i = 1;
- for (Map.Entry<String, String> e : urlAliases.entrySet()) {
- cfg.setString(URL_ALIAS, URL_ALIAS + i, KEY_MATCH, e.getKey());
- cfg.setString(URL_ALIAS, URL_ALIAS + i, KEY_TOKEN, e.getValue());
- i++;
- }
- }
- }
-
private static void unsetSection(Config cfg, String section) {
cfg.unsetSection(section, null);
for (String subsection : cfg.getSubsections(section)) {
diff --git a/java/com/google/gerrit/server/git/UserConfigSections.java b/java/com/google/gerrit/server/git/UserConfigSections.java
index 859e40d..0ef908c 100644
--- a/java/com/google/gerrit/server/git/UserConfigSections.java
+++ b/java/com/google/gerrit/server/git/UserConfigSections.java
@@ -25,9 +25,6 @@
public static final String KEY_URL = "url";
public static final String KEY_TARGET = "target";
public static final String KEY_ID = "id";
- public static final String URL_ALIAS = "urlAlias";
- public static final String KEY_MATCH = "match";
- public static final String KEY_TOKEN = "token";
/** The table column user preferences. */
public static final String CHANGE_TABLE = "changeTable";
diff --git a/java/com/google/gerrit/server/restapi/config/GetServerInfo.java b/java/com/google/gerrit/server/restapi/config/GetServerInfo.java
index a36e75c..2d504c7 100644
--- a/java/com/google/gerrit/server/restapi/config/GetServerInfo.java
+++ b/java/com/google/gerrit/server/restapi/config/GetServerInfo.java
@@ -66,16 +66,11 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
-import java.util.Map;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import org.eclipse.jgit.lib.Config;
public class GetServerInfo implements RestReadView<ConfigResource> {
- private static final String URL_ALIAS = "urlAlias";
- private static final String KEY_MATCH = "match";
- private static final String KEY_TOKEN = "token";
-
private final Config config;
private final AccountVisibilityProvider accountVisibilityProvider;
private final AuthConfig authConfig;
@@ -152,9 +147,6 @@
info.sshd = getSshdInfo();
info.suggest = getSuggestInfo();
- Map<String, String> urlAliases = getUrlAliasesInfo();
- info.urlAliases = !urlAliases.isEmpty() ? urlAliases : null;
-
info.user = getUserInfo();
info.receive = getReceiveInfo();
return Response.ok(info);
@@ -347,16 +339,6 @@
return null;
}
- private Map<String, String> getUrlAliasesInfo() {
- Map<String, String> urlAliases = new HashMap<>();
- for (String subsection : config.getSubsections(URL_ALIAS)) {
- urlAliases.put(
- config.getString(URL_ALIAS, subsection, KEY_MATCH),
- config.getString(URL_ALIAS, subsection, KEY_TOKEN));
- }
- return urlAliases;
- }
-
private SshdInfo getSshdInfo() {
String[] addr = config.getStringList("sshd", null, "listenAddress");
if (addr.length == 1 && isOff(addr[0])) {
diff --git a/javatests/com/google/gerrit/acceptance/api/accounts/GeneralPreferencesIT.java b/javatests/com/google/gerrit/acceptance/api/accounts/GeneralPreferencesIT.java
index f253533..76d8044 100644
--- a/javatests/com/google/gerrit/acceptance/api/accounts/GeneralPreferencesIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/accounts/GeneralPreferencesIT.java
@@ -38,7 +38,6 @@
import com.google.inject.Inject;
import com.google.inject.util.Providers;
import java.util.ArrayList;
-import java.util.HashMap;
import org.junit.Before;
import org.junit.Test;
@@ -90,8 +89,6 @@
i.my.add(new MenuItem("name", "url"));
i.changeTable = new ArrayList<>();
i.changeTable.add("Status");
- i.urlAliases = new HashMap<>();
- i.urlAliases.put("foo", "bar");
o = gApi.accounts().id(user42.id().toString()).setPreferences(i);
assertPrefs(o, i, "my");