diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2023-05-08 15:51:23 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2023-05-09 00:22:47 +0200 |
commit | 5acbeb888e2cb4778ae012bfba0241bf53ee816f (patch) | |
tree | 48d74684bd9d7d3edc62d44f32f95052c87c3a36 | |
parent | aabce4bf986df62145fd894e02442611e6a34a73 (diff) | |
parent | 7fdbbc90de1807da1bae8529b07068f96be3fb9b (diff) |
Merge branch 'stable-3.6' into stable-3.7
* stable-3.6:
Set version to 3.5.7-SNAPSHOT
Set version to 3.5.6
Move creation of PerThreadCache to SshCommand
Update bouncycastle to 1.72
Align commons-compress and tukaani-xz versions with jgit
Bump JGit to 74fa245b3
Bump JGit to 45de4fa
Log external ID differential cache loader failure
ProjectState: simplify the 'getPluginConfig' method
Release-Notes: skip
Change-Id: I86100dc9c13f94e97c1d1dcc27bb95058a7ea256
-rw-r--r-- | java/com/google/gerrit/acceptance/BUILD | 1 | ||||
-rw-r--r-- | java/com/google/gerrit/server/account/externalids/ExternalIdCacheLoader.java | 15 | ||||
-rw-r--r-- | java/com/google/gerrit/server/project/ProjectState.java | 10 | ||||
-rw-r--r-- | java/com/google/gerrit/server/query/change/OutputStreamQuery.java | 3 | ||||
-rw-r--r-- | java/com/google/gerrit/sshd/SshCommand.java | 4 | ||||
-rw-r--r-- | lib/bouncycastle/BUILD | 15 | ||||
-rw-r--r-- | polygerrit-ui/app/BUILD | 2 | ||||
-rw-r--r-- | tools/deps.bzl | 24 |
8 files changed, 54 insertions, 20 deletions
diff --git a/java/com/google/gerrit/acceptance/BUILD b/java/com/google/gerrit/acceptance/BUILD index 633081e571..2cf279f725 100644 --- a/java/com/google/gerrit/acceptance/BUILD +++ b/java/com/google/gerrit/acceptance/BUILD @@ -53,6 +53,7 @@ DEPLOY_ENV = [ "//lib/bouncycastle:bcpg", "//lib/bouncycastle:bcpkix", "//lib/bouncycastle:bcprov", + "//lib/bouncycastle:bcutil", "//prolog:gerrit-prolog-common", ] diff --git a/java/com/google/gerrit/server/account/externalids/ExternalIdCacheLoader.java b/java/com/google/gerrit/server/account/externalids/ExternalIdCacheLoader.java index 27672bdcf6..43e316a978 100644 --- a/java/com/google/gerrit/server/account/externalids/ExternalIdCacheLoader.java +++ b/java/com/google/gerrit/server/account/externalids/ExternalIdCacheLoader.java @@ -43,7 +43,9 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; import org.eclipse.jgit.errors.ConfigInvalidException; +import org.eclipse.jgit.lib.AnyObjectId; import org.eclipse.jgit.lib.Config; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectReader; @@ -184,8 +186,17 @@ public class ExternalIdCacheLoader { } } - AllExternalIds allExternalIds = - buildAllExternalIds(repo, oldExternalIds, additions, removals); + AllExternalIds allExternalIds; + try { + allExternalIds = buildAllExternalIds(repo, oldExternalIds, additions, removals); + } catch (IllegalArgumentException e) { + Set<String> additionKeys = + additions.keySet().stream().map(AnyObjectId::getName).collect(Collectors.toSet()); + logger.atSevere().withCause(e).log( + "Failed to load external ID cache. Repository ref is %s, cache ref is %s, additions are %s", + extIdRef.getObjectId().getName(), parentWithCacheValue.getId().getName(), additionKeys); + throw e; + } reloadCounter.increment(true); reloadDifferential.record(System.nanoTime() - start, TimeUnit.NANOSECONDS); return allExternalIds; diff --git a/java/com/google/gerrit/server/project/ProjectState.java b/java/com/google/gerrit/server/project/ProjectState.java index 6352f669f7..b350f3c7e0 100644 --- a/java/com/google/gerrit/server/project/ProjectState.java +++ b/java/com/google/gerrit/server/project/ProjectState.java @@ -475,19 +475,19 @@ public class ProjectState { * {@code PluginConfig#withInheritance(ProjectState.Factory)} */ public PluginConfig getPluginConfig(String pluginName) { - if (getConfig().getPluginConfigs().containsKey(pluginName)) { - Config config = new Config(); + Config config = new Config(); + String cachedPluginConfig = getConfig().getPluginConfigs().get(pluginName); + if (cachedPluginConfig != null) { try { - config.fromText(getConfig().getPluginConfigs().get(pluginName)); + config.fromText(cachedPluginConfig); } catch (ConfigInvalidException e) { // This is OK to propagate as IllegalStateException because it's a programmer error. // The config was converted to a String using Config#toText. So #fromText must not // throw a ConfigInvalidException throw new IllegalStateException("invalid plugin config for " + pluginName, e); } - return PluginConfig.create(pluginName, config, getConfig()); } - return PluginConfig.create(pluginName, new Config(), getConfig()); + return PluginConfig.create(pluginName, config, getConfig()); } public Optional<BranchOrderSection> getBranchOrderSection() { diff --git a/java/com/google/gerrit/server/query/change/OutputStreamQuery.java b/java/com/google/gerrit/server/query/change/OutputStreamQuery.java index 716cf106d2..961404adb7 100644 --- a/java/com/google/gerrit/server/query/change/OutputStreamQuery.java +++ b/java/com/google/gerrit/server/query/change/OutputStreamQuery.java @@ -30,7 +30,6 @@ import com.google.gerrit.index.query.QueryParseException; import com.google.gerrit.index.query.QueryResult; import com.google.gerrit.server.DynamicOptions; import com.google.gerrit.server.account.AccountAttributeLoader; -import com.google.gerrit.server.cache.PerThreadCache; import com.google.gerrit.server.config.TrackingFooters; import com.google.gerrit.server.data.ChangeAttribute; import com.google.gerrit.server.data.PatchSetAttribute; @@ -211,7 +210,7 @@ public class OutputStreamQuery { return; } - try (PerThreadCache ignored = PerThreadCache.create()) { + try { final QueryStatsAttribute stats = new QueryStatsAttribute(); stats.runTimeMilliseconds = TimeUtil.nowMs(); diff --git a/java/com/google/gerrit/sshd/SshCommand.java b/java/com/google/gerrit/sshd/SshCommand.java index 9df263b860..a4e427d1eb 100644 --- a/java/com/google/gerrit/sshd/SshCommand.java +++ b/java/com/google/gerrit/sshd/SshCommand.java @@ -23,6 +23,7 @@ import com.google.gerrit.server.DynamicOptions; import com.google.gerrit.server.InvalidDeadlineException; import com.google.gerrit.server.RequestInfo; import com.google.gerrit.server.RequestListener; +import com.google.gerrit.server.cache.PerThreadCache; import com.google.gerrit.server.cancellation.RequestCancelledException; import com.google.gerrit.server.cancellation.RequestStateContext; import com.google.gerrit.server.config.GerritServerConfig; @@ -62,7 +63,8 @@ public abstract class SshCommand extends BaseCommand { public void start(ChannelSession channel, Environment env) throws IOException { startThread( () -> { - try (DynamicOptions pluginOptions = new DynamicOptions(injector, dynamicBeans)) { + try (PerThreadCache ignored = PerThreadCache.create(); + DynamicOptions pluginOptions = new DynamicOptions(injector, dynamicBeans)) { parseCommandLine(pluginOptions); stdout = toPrintWriter(out); stderr = toPrintWriter(err); diff --git a/lib/bouncycastle/BUILD b/lib/bouncycastle/BUILD index 43ba6e1cec..6a87d73c1b 100644 --- a/lib/bouncycastle/BUILD +++ b/lib/bouncycastle/BUILD @@ -22,6 +22,13 @@ java_library( ) java_library( + name = "bcutil", + data = ["//lib:LICENSE-bouncycastle"], + visibility = ["//visibility:public"], + exports = ["@bcutil//jar"], +) + +java_library( name = "bcprov-neverlink", data = ["//lib:LICENSE-bouncycastle"], neverlink = 1, @@ -44,3 +51,11 @@ java_library( visibility = ["//visibility:public"], exports = ["@bcpkix//jar"], ) + +java_library( + name = "bcutil-neverlink", + data = ["//lib:LICENSE-bouncycastle"], + neverlink = 1, + visibility = ["//visibility:public"], + exports = ["@bcutil//jar"], +) diff --git a/polygerrit-ui/app/BUILD b/polygerrit-ui/app/BUILD index 330e616c15..2807a6d163 100644 --- a/polygerrit-ui/app/BUILD +++ b/polygerrit-ui/app/BUILD @@ -180,9 +180,9 @@ filegroup( "**/*_test.ts", ], ) + [ + "@npm//typescript", "@ui_dev_npm//:node_modules", "@ui_npm//:node_modules", - "@npm//typescript", ], ) diff --git a/tools/deps.bzl b/tools/deps.bzl index 3138d15c7f..3156e1a209 100644 --- a/tools/deps.bzl +++ b/tools/deps.bzl @@ -19,7 +19,7 @@ GITILES_VERS = "1.0.0" GITILES_REPO = GERRIT # When updating Bouncy Castle, also update it in bazlets. -BC_VERS = "1.64" +BC_VERS = "1.72" HTTPCOMP_VERS = "4.5.2" JETTY_VERS = "9.4.36.v20210114" BYTE_BUDDY_VERSION = "1.10.7" @@ -122,8 +122,8 @@ def java_dependencies(): # When upgrading commons-compress, also upgrade tukaani-xz maven_jar( name = "commons-compress", - artifact = "org.apache.commons:commons-compress:1.20", - sha1 = "b8df472b31e1f17c232d2ad78ceb1c84e00c641b", + artifact = "org.apache.commons:commons-compress:1.22", + sha1 = "691a8b4e6cf4248c3bc72c8b719337d5cb7359fa", ) maven_jar( @@ -559,20 +559,26 @@ def java_dependencies(): maven_jar( name = "bcprov", - artifact = "org.bouncycastle:bcprov-jdk15on:" + BC_VERS, - sha1 = "1467dac1b787b5ad2a18201c0c281df69882259e", + artifact = "org.bouncycastle:bcprov-jdk18on:" + BC_VERS, + sha1 = "d8dc62c28a3497d29c93fee3e71c00b27dff41b4", ) maven_jar( name = "bcpg", - artifact = "org.bouncycastle:bcpg-jdk15on:" + BC_VERS, - sha1 = "56956a8c63ccadf62e7c678571cf86f30bd84441", + artifact = "org.bouncycastle:bcpg-jdk18on:" + BC_VERS, + sha1 = "1a36a1740d07869161f6f0d01fae8d72dd1d8320", ) maven_jar( name = "bcpkix", - artifact = "org.bouncycastle:bcpkix-jdk15on:" + BC_VERS, - sha1 = "3dac163e20110817d850d17e0444852a6d7d0bd7", + artifact = "org.bouncycastle:bcpkix-jdk18on:" + BC_VERS, + sha1 = "bb3fdb5162ccd5085e8d7e57fada4d8eaa571f5a", + ) + + maven_jar( + name = "bcutil", + artifact = "org.bouncycastle:bcutil-jdk18on:" + BC_VERS, + sha1 = "41f19a69ada3b06fa48781120d8bebe1ba955c77", ) maven_jar( |