From 359cd63caf3dfa8feac71c6d92ec06e87bfc60f5 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 1 Aug 2018 11:12:04 +0200 Subject: [PATCH 1/7] dev-contributing: use buildifer 0.15.0 Version 0.15.0 is the latest. Running it on the build files does not result in any formatting changes. Change-Id: I6e9ad5c8cf4cba4e775fcce88b6e79fb57ed2e71 --- Documentation/dev-contributing.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/dev-contributing.txt b/Documentation/dev-contributing.txt index cff941e729..a6fdee8f8e 100644 --- a/Documentation/dev-contributing.txt +++ b/Documentation/dev-contributing.txt @@ -155,7 +155,7 @@ To format Java source code, Gerrit uses the link:https://github.com/google/google-java-format[`google-java-format`] tool (version 1.5), and to format Bazel BUILD, WORKSPACE and .bzl files the link:https://github.com/bazelbuild/buildtools/tree/master/buildifier[`buildifier`] -tool (version 0.12.0). +tool (version 0.15.0). These tools automatically apply format according to the style guides; this streamlines code review by reducing the need for time-consuming, tedious, and contentious discussions about trivial issues like whitespace. From 5531347e569c4af160ec3cca4a6ea3e734aa9021 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Wed, 1 Aug 2018 22:33:57 +0200 Subject: [PATCH 2/7] Bump auto-value to 1.6.2 This upgrade is needed to support JDK9, that was fixed in this commit: [1]. [1] https://github.com/google/auto/commit/f04406c1f11d3796bd93ed89ae160f47bcb4b7e4 Change-Id: Ic7464964dc7e21946aac4b4a786107a0df51ae2a --- WORKSPACE | 12 ++++++++++-- gerrit-acceptance-framework/BUILD | 1 + gerrit-common/BUILD | 1 + gerrit-httpd/BUILD | 1 + gerrit-pgm/BUILD | 1 + gerrit-server/BUILD | 2 ++ gerrit-sshd/BUILD | 1 + lib/auto/BUILD | 21 +++++++++++++++++++-- 8 files changed, 36 insertions(+), 4 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index efa7149f06..3e1ef2c0d3 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -440,10 +440,18 @@ maven_jar( sha1 = "b60e33a6bd0d71831e0c249816d01e6c1dd90a47", ) +AUTO_VALUE_VERSION = "1.6.2" + maven_jar( name = "auto-value", - artifact = "com.google.auto.value:auto-value:1.4", - sha1 = "6d1448fcd13074bd3658ef915022410b7c48343b", + artifact = "com.google.auto.value:auto-value:" + AUTO_VALUE_VERSION, + sha1 = "e7eae562942315a983eea3e191b72d755c153620", +) + +maven_jar( + name = "auto-value-annotations", + artifact = "com.google.auto.value:auto-value-annotations:" + AUTO_VALUE_VERSION, + sha1 = "ed193d86e0af90cc2342aedbe73c5d86b03fa09b", ) maven_jar( diff --git a/gerrit-acceptance-framework/BUILD b/gerrit-acceptance-framework/BUILD index 83aca51124..ef78e228c4 100644 --- a/gerrit-acceptance-framework/BUILD +++ b/gerrit-acceptance-framework/BUILD @@ -44,6 +44,7 @@ java_library2( "//lib:truth", "//lib:truth-java8-extension", "//lib/auto:auto-value", + "//lib/auto:auto-value-annotations", "//lib/httpcomponents:fluent-hc", "//lib/httpcomponents:httpclient", "//lib/httpcomponents:httpcore", diff --git a/gerrit-common/BUILD b/gerrit-common/BUILD index 7f299da76e..6432060f99 100644 --- a/gerrit-common/BUILD +++ b/gerrit-common/BUILD @@ -82,5 +82,6 @@ junit_tests( deps = [ "//lib:truth", "//lib/auto:auto-value", + "//lib/auto:auto-value-annotations", ], ) diff --git a/gerrit-httpd/BUILD b/gerrit-httpd/BUILD index a5494bcf9d..fda84af075 100644 --- a/gerrit-httpd/BUILD +++ b/gerrit-httpd/BUILD @@ -39,6 +39,7 @@ java_library( "//lib:servlet-api-3_1", "//lib:soy", "//lib/auto:auto-value", + "//lib/auto:auto-value-annotations", "//lib/commons:codec", "//lib/commons:lang", "//lib/guice", diff --git a/gerrit-pgm/BUILD b/gerrit-pgm/BUILD index 54851f1f4c..389d8d98b4 100644 --- a/gerrit-pgm/BUILD +++ b/gerrit-pgm/BUILD @@ -151,6 +151,7 @@ java_library( # We want all these deps to be provided_deps "//gerrit-launcher:launcher", "//lib/auto:auto-value", + "//lib/auto:auto-value-annotations", ], ) diff --git a/gerrit-server/BUILD b/gerrit-server/BUILD index f730ca4819..a92ddea15a 100644 --- a/gerrit-server/BUILD +++ b/gerrit-server/BUILD @@ -55,6 +55,7 @@ java_library( "//lib:velocity", "//lib/antlr:java-runtime", "//lib/auto:auto-value", + "//lib/auto:auto-value-annotations", "//lib/bouncycastle:bcpkix-neverlink", "//lib/bouncycastle:bcprov-neverlink", "//lib/commons:codec", @@ -130,6 +131,7 @@ java_library( deps = TESTUTIL_DEPS + [ "//gerrit-pgm:init", "//lib/auto:auto-value", + "//lib/auto:auto-value-annotations", "//lib/easymock:easymock", "//lib/powermock:powermock-api-easymock", "//lib/powermock:powermock-api-support", diff --git a/gerrit-sshd/BUILD b/gerrit-sshd/BUILD index b1fe5ecbce..189057e9b3 100644 --- a/gerrit-sshd/BUILD +++ b/gerrit-sshd/BUILD @@ -24,6 +24,7 @@ java_library( "//lib:jsch", "//lib:servlet-api-3_1", "//lib/auto:auto-value", + "//lib/auto:auto-value-annotations", "//lib/bouncycastle:bcprov-neverlink", "//lib/commons:codec", "//lib/dropwizard:dropwizard-core", diff --git a/lib/auto/BUILD b/lib/auto/BUILD index 98055eb475..1e722bcae5 100644 --- a/lib/auto/BUILD +++ b/lib/auto/BUILD @@ -1,13 +1,19 @@ java_plugin( name = "auto-annotation-plugin", processor_class = "com.google.auto.value.processor.AutoAnnotationProcessor", - deps = ["@auto-value//jar"], + deps = [ + "@auto-value-annotations//jar", + "@auto-value//jar", + ], ) java_plugin( name = "auto-value-plugin", processor_class = "com.google.auto.value.processor.AutoValueProcessor", - deps = ["@auto-value//jar"], + deps = [ + "@auto-value-annotations//jar", + "@auto-value//jar", + ], ) java_library( @@ -20,3 +26,14 @@ java_library( visibility = ["//visibility:public"], exports = ["@auto-value//jar"], ) + +java_library( + name = "auto-value-annotations", + data = ["//lib:LICENSE-Apache2.0"], + exported_plugins = [ + ":auto-annotation-plugin", + ":auto-value-plugin", + ], + visibility = ["//visibility:public"], + exports = ["@auto-value-annotations//jar"], +) From 4b8fff2d06be6c55b23d456999b0ff6f0d501413 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Mon, 9 Jul 2018 00:49:12 +0200 Subject: [PATCH 3/7] Bazel: Consume rules_closure from HEAD Now, that both changes were merged, consume rules_closure from HEAD and avoid patching it during the build: [1]. [1] https://github.com/bazelbuild/rules_closure/commit/d1c92e34f28ab9a48ee416115132a5e79fe0e9f6 Change-Id: I5afeccb17e4ef76b2ec86f9f8b7f2741bf8d4e93 --- WORKSPACE | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 3e1ef2c0d3..9080457361 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -14,11 +14,9 @@ http_archive( http_archive( name = "io_bazel_rules_closure", - build_file_content = "exports_files([\"0001-Replace-native-http-git-_archive-with-Skylark-rules.patch\"])", - patches = ["//:0001-Replace-native-http-git-_archive-with-Skylark-rules.patch"], - sha256 = "a80acb69c63d5f6437b099c111480a4493bad4592015af2127a2f49fb7512d8d", - strip_prefix = "rules_closure-0.7.0", - url = "https://github.com/bazelbuild/rules_closure/archive/0.7.0.tar.gz", + sha256 = "4dd84dd2bdd6c9f56cb5a475d504ea31d199c34309e202e9379501d01c3067e5", + strip_prefix = "rules_closure-3103a773820b59b76345f94c231cb213e0d404e2", + url = "https://github.com/bazelbuild/rules_closure/archive/3103a773820b59b76345f94c231cb213e0d404e2.tar.gz", ) # File is specific to Polymer and copied from the Closure Github -- should be From 2e54868448f513ef64656bced933b78fb503e062 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 1 Aug 2018 15:12:47 +0200 Subject: [PATCH 4/7] Minor improvements in receive.maxObjectSizeLimit documentation Change-Id: I632a2fc3de1187b476cd182112149dff2a57c606 --- Documentation/config-gerrit.txt | 2 +- Documentation/config-project-config.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt index a0f211b34b..e4dfde491a 100644 --- a/Documentation/config-gerrit.txt +++ b/Documentation/config-gerrit.txt @@ -3486,7 +3486,7 @@ Gerrit administrators can use this setting to prevent developers from pushing objects which are too large to Gerrit. + This setting can also be set in the `project.config` -link:config-project-config.html[receive.maxObjectSizeLimit] in order +(link:config-project-config.html[receive.maxObjectSizeLimit]) in order to further reduce the global setting. The project specific setting is only honored when it further reduces the global limit. + diff --git a/Documentation/config-project-config.txt b/Documentation/config-project-config.txt index 34f39c8ca7..611085278d 100644 --- a/Documentation/config-project-config.txt +++ b/Documentation/config-project-config.txt @@ -136,9 +136,9 @@ is larger than the given size the pack-parsing will abort and the push operation will fail. If set to zero then there is no limit. + Project owners can use this setting to prevent developers from pushing -objects which are too large to Gerrit. This setting can also be set it -`gerrit.config` globally link:config-gerrit.html#receive.maxObjectSizeLimit[ -receive.maxObjectSizeLimit]. +objects which are too large to Gerrit. This setting can also be set in +`gerrit.config` globally (link:config-gerrit.html#receive.maxObjectSizeLimit[ +receive.maxObjectSizeLimit]). + The project specific setting in `project.config` is only honored when it further reduces the global limit. From e8e98d83e339632d79f796720bac4b9a1edc5cd6 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 2 Aug 2018 15:14:59 +0200 Subject: [PATCH 5/7] Upgrade JGit to 4.9.3.201807311005-r This release contains the following fixes that were submitted on JGit's stable-4.9 branch since the currently used snapshot was built: A fix for issue 9153: - ResolveMerger: Fix encoding with string; use bytes And several fixes related to cleanup of ref directories after running GC: - Delete all loose refs empty directories - Use java.nio to delete path to get detailed errors - GC: Remove empty references folders - Do not ignore path deletion errors Bug: Issue 9153 Change-Id: Ia385b5bb46e94e4a93503345648502885c61c5c9 --- lib/jgit/jgit.bzl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/jgit/jgit.bzl b/lib/jgit/jgit.bzl index e0b7560b05..add3f23aa6 100644 --- a/lib/jgit/jgit.bzl +++ b/lib/jgit/jgit.bzl @@ -1,12 +1,12 @@ load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_CENTRAL", "MAVEN_LOCAL", "maven_jar") -_JGIT_VERS = "4.9.2.201712150930-r.15-g5fe8e31d4" +_JGIT_VERS = "4.9.3.201807311005-r" -_DOC_VERS = "4.9.2.201712150930-r" # Set to _JGIT_VERS unless using a snapshot +_DOC_VERS = _JGIT_VERS # Set to _JGIT_VERS unless using a snapshot JGIT_DOC_URL = "http://download.eclipse.org/jgit/site/" + _DOC_VERS + "/apidocs" -_JGIT_REPO = GERRIT # Leave here even if set to MAVEN_CENTRAL. +_JGIT_REPO = MAVEN_CENTRAL # Leave here even if set to MAVEN_CENTRAL. # set this to use a local version. # "/home//projects/jgit" @@ -26,28 +26,28 @@ def jgit_maven_repos(): name = "jgit-lib", artifact = "org.eclipse.jgit:org.eclipse.jgit:" + _JGIT_VERS, repository = _JGIT_REPO, - sha1 = "dd93e272fb38c4a0e2b9e1cc39424e1e8d542352", - src_sha1 = "78d34eb21320b8262a1b52bd5c91e66380d0302a", + sha1 = "b063719602ce9aaa058421e5beafb26b4950532b", + src_sha1 = "c666721021b61465d3e140b8eef37b475c29eeb8", unsign = True, ) maven_jar( name = "jgit-servlet", artifact = "org.eclipse.jgit:org.eclipse.jgit.http.server:" + _JGIT_VERS, repository = _JGIT_REPO, - sha1 = "5ef78cf1da610c643a9fd03763b4cac2889567af", + sha1 = "0b7408658db0067cdaebeb9c8dda6cadf639b84a", unsign = True, ) maven_jar( name = "jgit-archive", artifact = "org.eclipse.jgit:org.eclipse.jgit.archive:" + _JGIT_VERS, repository = _JGIT_REPO, - sha1 = "238e20f82cb7b5ad99b60445d36f6c2c13ed8e4e", + sha1 = "e86ef418c398a38dda59abfbdb21e014dc94fb18", ) maven_jar( name = "jgit-junit", artifact = "org.eclipse.jgit:org.eclipse.jgit.junit:" + _JGIT_VERS, repository = _JGIT_REPO, - sha1 = "e16e9635020e8a4a62d93cd05869442690f54209", + sha1 = "0a061070690a57a855fa5963b71f1f9995dbf8cb", unsign = True, ) From c0c935d2b327fd55c228f8391e14a30682b7765c Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 1 Aug 2018 15:32:29 +0200 Subject: [PATCH 6/7] Clarify that receive.maxObjectSizeLimit does not get inherited Change-Id: If10ace95990a3ef032da4d700333dc76501ec9e6 --- Documentation/config-project-config.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/config-project-config.txt b/Documentation/config-project-config.txt index 611085278d..649bbf876a 100644 --- a/Documentation/config-project-config.txt +++ b/Documentation/config-project-config.txt @@ -141,7 +141,8 @@ objects which are too large to Gerrit. This setting can also be set in receive.maxObjectSizeLimit]). + The project specific setting in `project.config` is only honored when it -further reduces the global limit. +further reduces the global limit. The setting is not inherited from the +parent project; it must be explicitly set per project. + Default is zero. + From 3d9574e6c3cb74d3f4891707baf729f1aaa92327 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 2 Aug 2018 21:06:46 +0200 Subject: [PATCH 7/7] Upgrade JGit to 5.0.2.201807311906-r This release contains the following fixes since 5.0.1.201806211838-r: A fix for issue 9153: - ResolveMerger: Fix encoding with string; use bytes And several fixes related to cleanup of ref directories after running GC: - Delete all loose refs empty directories - Use java.nio to delete path to get detailed errors - GC: Remove empty references folders - Do not ignore path deletion errors Bug: Issue 9153 Change-Id: I38d57c20475345626e277c7734fd0e109070d69e --- lib/jgit/jgit.bzl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/jgit/jgit.bzl b/lib/jgit/jgit.bzl index 384469ce12..ba34750dbf 100644 --- a/lib/jgit/jgit.bzl +++ b/lib/jgit/jgit.bzl @@ -1,6 +1,6 @@ load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_CENTRAL", "MAVEN_LOCAL", "maven_jar") -_JGIT_VERS = "5.0.1.201806211838-r" +_JGIT_VERS = "5.0.2.201807311906-r" _DOC_VERS = _JGIT_VERS # Set to _JGIT_VERS unless using a snapshot @@ -26,28 +26,28 @@ def jgit_maven_repos(): name = "jgit-lib", artifact = "org.eclipse.jgit:org.eclipse.jgit:" + _JGIT_VERS, repository = _JGIT_REPO, - sha1 = "dbba66a425d2153ccd749d0ba9c075b0ba424655", - src_sha1 = "c85725a96e20d940fe20e1be4ddf50133c322f65", + sha1 = "a81d7c8d153a8a744b6be1d9c6d698270beec1c0", + src_sha1 = "c89f8f38cebaf75d13f9b2f7a1da71206d8c38f7", unsign = True, ) maven_jar( name = "jgit-servlet", artifact = "org.eclipse.jgit:org.eclipse.jgit.http.server:" + _JGIT_VERS, repository = _JGIT_REPO, - sha1 = "5d9cd43e880d49f14501ac48d59b55905f4ec5bf", + sha1 = "ab3d0c85bc2008da513c1127ab4acf3df8ef414e", unsign = True, ) maven_jar( name = "jgit-archive", artifact = "org.eclipse.jgit:org.eclipse.jgit.archive:" + _JGIT_VERS, repository = _JGIT_REPO, - sha1 = "1d94e2bfa505dd719f62cfb036295022543af17e", + sha1 = "ba6e0aaf3f733f2f460e227145526e1737ca160f", ) maven_jar( name = "jgit-junit", artifact = "org.eclipse.jgit:org.eclipse.jgit.junit:" + _JGIT_VERS, repository = _JGIT_REPO, - sha1 = "f848735061fab81f2863f68cca8d533ff403c765", + sha1 = "fe28963520e19c918eb26747e678ec9772ba800f", unsign = True, )