diff options
author | Luke Granger-Brown <git@lukegb.com> | 2022-11-05T02·18+0000 |
---|---|---|
committer | lukegb <lukegb@tvl.fyi> | 2022-11-06T16·46+0000 |
commit | d92ca1099035590566dbb5790284bc2f3d68a84c (patch) | |
tree | a5b307528501fb44080cf44722ac5f1a29ed113c /third_party/gerrit | |
parent | 8669bd0ee6cebe75e885e7899cdef21cc4a0c999 (diff) |
chore(gerrit): bump to 3.7.0-rc4 r/5257
Change-Id: Ib6f4fd5817fb5415cff5ea1d8c75c8c9a08d56b4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7185 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'third_party/gerrit')
-rw-r--r-- | third_party/gerrit/0001-Syntax-highlight-nix.patch | 8 | ||||
-rw-r--r-- | third_party/gerrit/0002-Syntax-highlight-rules.pl.patch | 8 | ||||
-rw-r--r-- | third_party/gerrit/0003-Add-titles-to-CLs-over-HTTP.patch | 38 | ||||
-rw-r--r-- | third_party/gerrit/default.nix | 19 |
4 files changed, 41 insertions, 32 deletions
diff --git a/third_party/gerrit/0001-Syntax-highlight-nix.patch b/third_party/gerrit/0001-Syntax-highlight-nix.patch index 64eb38343225..bdc3fd3b5510 100644 --- a/third_party/gerrit/0001-Syntax-highlight-nix.patch +++ b/third_party/gerrit/0001-Syntax-highlight-nix.patch @@ -1,4 +1,4 @@ -From fea4416001e5dd097d70166778fa55c6b20fae39 Mon Sep 17 00:00:00 2001 +From 084e4f92fb58f7cd85303ba602fb3c40133c8fcc Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown <git@lukegb.com> Date: Thu, 2 Jul 2020 23:02:32 +0100 Subject: [PATCH 1/3] Syntax highlight nix @@ -9,7 +9,7 @@ Subject: [PATCH 1/3] Syntax highlight nix 2 files changed, 2 insertions(+) diff --git a/polygerrit-ui/app/embed/diff/gr-syntax-layer/gr-syntax-layer-worker.ts b/polygerrit-ui/app/embed/diff/gr-syntax-layer/gr-syntax-layer-worker.ts -index 9938d3408d..f6f634ad31 100644 +index a9f88bdd81..385249f280 100644 --- a/polygerrit-ui/app/embed/diff/gr-syntax-layer/gr-syntax-layer-worker.ts +++ b/polygerrit-ui/app/embed/diff/gr-syntax-layer/gr-syntax-layer-worker.ts @@ -93,6 +93,7 @@ const LANGUAGE_MAP = new Map<string, string>([ @@ -21,7 +21,7 @@ index 9938d3408d..f6f634ad31 100644 const CLASS_PREFIX = 'gr-diff gr-syntax gr-syntax-'; diff --git a/resources/com/google/gerrit/server/mime/mime-types.properties b/resources/com/google/gerrit/server/mime/mime-types.properties -index 5a08e66067..c0c092c712 100644 +index 2f9561ba2e..739818ec05 100644 --- a/resources/com/google/gerrit/server/mime/mime-types.properties +++ b/resources/com/google/gerrit/server/mime/mime-types.properties @@ -149,6 +149,7 @@ mscin = text/x-mscgen @@ -33,5 +33,5 @@ index 5a08e66067..c0c092c712 100644 nsi = text/x-nsis nt = text/n-triples -- -2.36.0 +2.37.3 diff --git a/third_party/gerrit/0002-Syntax-highlight-rules.pl.patch b/third_party/gerrit/0002-Syntax-highlight-rules.pl.patch index 4cb859d1bd33..4b91e2c3541f 100644 --- a/third_party/gerrit/0002-Syntax-highlight-rules.pl.patch +++ b/third_party/gerrit/0002-Syntax-highlight-rules.pl.patch @@ -1,4 +1,4 @@ -From ad3f389c20815f21ad932c0b295e861c6a21011c Mon Sep 17 00:00:00 2001 +From aedf8ac8fa5113843bcd83ff85e2d9f3bffdb16c Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown <git@lukegb.com> Date: Thu, 2 Jul 2020 23:02:43 +0100 Subject: [PATCH 2/3] Syntax highlight rules.pl @@ -9,7 +9,7 @@ Subject: [PATCH 2/3] Syntax highlight rules.pl 2 files changed, 2 insertions(+) diff --git a/polygerrit-ui/app/embed/diff/gr-syntax-layer/gr-syntax-layer-worker.ts b/polygerrit-ui/app/embed/diff/gr-syntax-layer/gr-syntax-layer-worker.ts -index f6f634ad31..36fd6090b4 100644 +index 385249f280..7cb3068494 100644 --- a/polygerrit-ui/app/embed/diff/gr-syntax-layer/gr-syntax-layer-worker.ts +++ b/polygerrit-ui/app/embed/diff/gr-syntax-layer/gr-syntax-layer-worker.ts @@ -68,6 +68,7 @@ const LANGUAGE_MAP = new Map<string, string>([ @@ -21,7 +21,7 @@ index f6f634ad31..36fd6090b4 100644 ['text/x-protobuf', 'protobuf'], ['text/x-puppet', 'puppet'], diff --git a/resources/com/google/gerrit/server/mime/mime-types.properties b/resources/com/google/gerrit/server/mime/mime-types.properties -index c0c092c712..ee815b689d 100644 +index 739818ec05..58eb727bf9 100644 --- a/resources/com/google/gerrit/server/mime/mime-types.properties +++ b/resources/com/google/gerrit/server/mime/mime-types.properties @@ -200,6 +200,7 @@ rq = application/sparql-query @@ -33,5 +33,5 @@ index c0c092c712..ee815b689d 100644 s = text/x-gas sas = text/x-sas -- -2.36.0 +2.37.3 diff --git a/third_party/gerrit/0003-Add-titles-to-CLs-over-HTTP.patch b/third_party/gerrit/0003-Add-titles-to-CLs-over-HTTP.patch index d2b3e3541f5e..c4edee3a40c3 100644 --- a/third_party/gerrit/0003-Add-titles-to-CLs-over-HTTP.patch +++ b/third_party/gerrit/0003-Add-titles-to-CLs-over-HTTP.patch @@ -1,4 +1,4 @@ -From 585077e751107729b7a2dd495a3b17c677a3f528 Mon Sep 17 00:00:00 2001 +From f49c50ca9a84ca374b7bd91c171bbea0457f2c7a Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown <git@lukegb.com> Date: Thu, 2 Jul 2020 23:03:02 +0100 Subject: [PATCH 3/3] Add titles to CLs over HTTP @@ -13,18 +13,18 @@ Subject: [PATCH 3/3] Add titles to CLs over HTTP create mode 100644 java/com/google/gerrit/httpd/raw/TitleComputer.java diff --git a/java/com/google/gerrit/httpd/raw/IndexHtmlUtil.java b/java/com/google/gerrit/httpd/raw/IndexHtmlUtil.java -index ce22ae8e59..952ba1fef4 100644 +index 72bfe40c3b..439bd73b44 100644 --- a/java/com/google/gerrit/httpd/raw/IndexHtmlUtil.java +++ b/java/com/google/gerrit/httpd/raw/IndexHtmlUtil.java -@@ -40,6 +40,7 @@ import java.util.Arrays; - import java.util.Collections; +@@ -41,6 +41,7 @@ import java.util.Collections; import java.util.HashMap; + import java.util.HashSet; import java.util.Map; +import java.util.Optional; import java.util.Set; import java.util.function.Function; -@@ -61,13 +62,14 @@ public class IndexHtmlUtil { +@@ -62,13 +63,14 @@ public class IndexHtmlUtil { String faviconPath, Map<String, String[]> urlParameterMap, Function<String, SanitizedContent> urlInScriptTagOrdainer, @@ -38,20 +38,20 @@ index ce22ae8e59..952ba1fef4 100644 canonicalURL, cdnPath, faviconPath, urlParameterMap, urlInScriptTagOrdainer)) - .putAll(dynamicTemplateData(gerritApi, requestedURL)); + .putAll(dynamicTemplateData(gerritApi, requestedURL, titleComputer)); - Set<String> enabledExperiments = experimentFeatures.getEnabledExperimentFeatures(); - - if (!enabledExperiments.isEmpty()) { -@@ -78,7 +80,8 @@ public class IndexHtmlUtil { + Set<String> enabledExperiments = new HashSet<>(); + enabledExperiments.addAll(experimentFeatures.getEnabledExperimentFeatures()); + // Add all experiments enabled through url +@@ -81,7 +83,8 @@ public class IndexHtmlUtil { /** Returns dynamic parameters of {@code index.html}. */ public static ImmutableMap<String, Object> dynamicTemplateData( - GerritApi gerritApi, String requestedURL) throws RestApiException, URISyntaxException { + GerritApi gerritApi, String requestedURL, TitleComputer titleComputer) -+ throws RestApiException, URISyntaxException { ++ throws RestApiException, URISyntaxException { ImmutableMap.Builder<String, Object> data = ImmutableMap.builder(); Map<String, SanitizedContent> initialData = new HashMap<>(); Server serverApi = gerritApi.config().server(); -@@ -131,6 +134,10 @@ public class IndexHtmlUtil { +@@ -129,6 +132,10 @@ public class IndexHtmlUtil { } data.put("gerritInitialData", initialData); @@ -63,7 +63,7 @@ index ce22ae8e59..952ba1fef4 100644 } diff --git a/java/com/google/gerrit/httpd/raw/IndexServlet.java b/java/com/google/gerrit/httpd/raw/IndexServlet.java -index fcb821e5ae..36eb0c990c 100644 +index fcb821e5ae..e1464b992b 100644 --- a/java/com/google/gerrit/httpd/raw/IndexServlet.java +++ b/java/com/google/gerrit/httpd/raw/IndexServlet.java @@ -48,13 +48,15 @@ public class IndexServlet extends HttpServlet { @@ -97,21 +97,21 @@ index fcb821e5ae..36eb0c990c 100644 urlOrdainer, - getRequestUrl(req)); + getRequestUrl(req), -+ titleComputer); ++ titleComputer); renderer = soySauce.renderTemplate("com.google.gerrit.httpd.raw.Index").setData(templateData); } catch (URISyntaxException | RestApiException e) { throw new IOException(e); diff --git a/java/com/google/gerrit/httpd/raw/StaticModule.java b/java/com/google/gerrit/httpd/raw/StaticModule.java -index 8e8a9d27f0..a0fb168554 100644 +index 15dcf42e0e..9f56bf33ce 100644 --- a/java/com/google/gerrit/httpd/raw/StaticModule.java +++ b/java/com/google/gerrit/httpd/raw/StaticModule.java -@@ -226,10 +226,11 @@ public class StaticModule extends ServletModule { +@@ -241,10 +241,11 @@ public class StaticModule extends ServletModule { @CanonicalWebUrl @Nullable String canonicalUrl, @GerritServerConfig Config cfg, GerritApi gerritApi, - ExperimentFeatures experimentFeatures) { + ExperimentFeatures experimentFeatures, -+ TitleComputer titleComputer) { ++ TitleComputer titleComputer) { String cdnPath = options.devCdn().orElse(cfg.getString("gerrit", null, "cdnPath")); String faviconPath = cfg.getString("gerrit", null, "faviconPath"); - return new IndexServlet(canonicalUrl, cdnPath, faviconPath, gerritApi, experimentFeatures); @@ -193,10 +193,10 @@ index 0000000000..8fd2053ad0 + } +} diff --git a/resources/com/google/gerrit/httpd/raw/PolyGerritIndexHtml.soy b/resources/com/google/gerrit/httpd/raw/PolyGerritIndexHtml.soy -index 8c97a49e81..129092dc7e 100644 +index dbfef44dfe..347ee75aab 100644 --- a/resources/com/google/gerrit/httpd/raw/PolyGerritIndexHtml.soy +++ b/resources/com/google/gerrit/httpd/raw/PolyGerritIndexHtml.soy -@@ -32,10 +32,12 @@ +@@ -33,10 +33,12 @@ {@param? defaultDashboardHex: ?} {@param? dashboardQuery: ?} {@param? userIsAuthenticated: ?} @@ -211,5 +211,5 @@ index 8c97a49e81..129092dc7e 100644 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">{\n} -- -2.36.0 +2.37.3 diff --git a/third_party/gerrit/default.nix b/third_party/gerrit/default.nix index 606d7e9abf40..82e62e80a581 100644 --- a/third_party/gerrit/default.nix +++ b/third_party/gerrit/default.nix @@ -23,7 +23,7 @@ let runScript = "/bin/bazel-run"; }; bazel = bazelTop // { override = x: bazelTop; }; - version = "3.6.1"; + version = "3.7.0-rc4"; in pkgs.lib.makeOverridable pkgs.buildBazelPackage { pname = "gerrit"; @@ -31,9 +31,9 @@ pkgs.lib.makeOverridable pkgs.buildBazelPackage { src = pkgs.fetchgit { url = "https://gerrit.googlesource.com/gerrit"; - rev = "028b90fc362051cc7005e540030e497320b83c92"; + rev = "3e445c7833c4acf49f1171fe4c82ceb32e93c780"; branchName = "v${version}"; - sha256 = "sha256:0rwmrix4h9jvgxr1gzp5f090g3xz3qlss3l1xvs2s6f3ynbxixa7"; + sha256 = "sha256:002aw2bfifyla66v8khyiq4m9qj6ahs6r1dzb5kjk8xqpf6c6q9p"; fetchSubmodules = true; }; @@ -55,7 +55,7 @@ pkgs.lib.makeOverridable pkgs.buildBazelPackage { fetchConfigured = true; fetchAttrs = { - sha256 = "sha256:1ggp5zrj25g5jc6ny9y333q0g76a7s1544j1ps9j3xhra9vbc1vq"; + sha256 = "sha256:09nfjw8376amrymblnjl4v85zgxrvc93zblvxrh23k7af62bk1nk"; preBuild = '' rm .bazelversion ''; @@ -99,7 +99,14 @@ pkgs.lib.makeOverridable pkgs.buildBazelPackage { # Normalize permissions on .yarn-{tarball,metadata} files find $bazelOut/external/yarn_cache \( -name .yarn-tarball.tgz -or -name .yarn-metadata.json \) -exec chmod 644 {} + - (cd $bazelOut/ && tar czf $out --sort=name --mtime='@1' --owner=0 --group=0 --numeric-owner external/) + mkdir $bazelOut/_bits/ + find . -name node_modules -prune -print | while read d; do + echo "$d" "$(dirname $d)" + mkdir -p $bazelOut/_bits/$(dirname $d) + cp -R "$d" "$bazelOut/_bits/$(dirname $d)/node_modules" + done + + (cd $bazelOut/ && tar czf $out --sort=name --mtime='@1' --owner=0 --group=0 --numeric-owner external/ _bits/) runHook postInstall ''; @@ -108,6 +115,8 @@ pkgs.lib.makeOverridable pkgs.buildBazelPackage { buildAttrs = { preConfigure = '' rm .bazelversion + + cp -R $bazelOut/_bits/* ./ ''; postPatch = '' # Disable all errorprone checks, since we might be using a different version. |