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
There is pending upgrade for review for years now to version 2.33: [1],
that appears to be too introusive change. There are two issues:
* Collision with rules_closure's and closure-templates's args4j version
* Non trivial changes in gerrit core to adapt to newer args4j version
Dismantle those issues, by upgrading to intermediate version: 2.0.29.
Re-fetch args4j twice: one for rules_closure to work properly with
ancient args4j version, while renaming the internal one to the more
recent version: args4j-intern.
Needless to say, that we have uploaded these PRs to both projects:
rules_closure and closure-templates that were more or less rejected,
so that we don't hope that args4j is going to be upgraded upstream,
thus keeping this status quo of double fetching: [2],[3].
The reason we need this change is dependency of gitblit-plugin on more
recent version so that we are getting classpath collision. Another
alternative that was considered (but abandoned) is to downgrade args4j
version in gitblit to the same ancient version used by gerrit core.
[1] https://gerrit-review.googlesource.com/c/gerrit/+/67793
[2] https://github.com/bazelbuild/rules_closure/pull/262
[3] https://github.com/google/closure-templates/pull/155
Change-Id: I5ec6645b92d54fccc03a723b7b50c50a99393d57
The fonts added in I7588e9aa1ef0b2e4ccd / 00a23600a8 were added with
deviating file modes compared to others in this folder. This change aligns
them.
Change-Id: Ic5db038e9d3d942f41a6f4789dd76f053556d6c4
The font has been replaced by Roboto in I7588e9aa1ef0b2e4ccd / 00a23600a8.
SourceCodePro font files were dereferenced with that change, but the font
files itself appear not to have been removed.
Change-Id: I525f18e3f6b61e475fe8c3082af6a3c9a80350e8
The 'fail' method is deprecated. Replace it as necessary.
The new version includes a dependency on diffutils; add it.
Change-Id: I80527c9ea41eb752710bed64cdb1621d4216ee46
* stable-2.14:
GerritServer: save gerrit.config before site init
ReindexIT: remove unnecessary method throws clause
RestSession#postWithHeader: Make parameter order consistent with #putWithHeader
Bump guice version to 4.2.0
Change-Id: Ibdedb3281414a140b214cb8c9006754cff542d25
The new version provides better support for Java 9 and improves
performance. Multibindings artifact is now included in the guice
core artifact. The full release notes is here: [1].
[1] https://github.com/google/guice/wiki/Guice42
Change-Id: I208d53ce1cf9b99ed8f03ae34470e95c3b8f71ce
(cherry picked from commit 1fa7774d237d0ea864b9f03b6551fd1ebef0c619)
New rule uses polymer-bundler instead of deprecated vulcanize.
Also use this rule to package UI plugins.
Also for combining PolyGerrit UI.
Feature: Issue 7144
Change-Id: I17380c670fe4a980dc9748b356e7df18aebdb4ca
When we upgraded to 5.0.1.201806211838-r the Javadoc was not
available, so the previous version was used.
Now it's available, so we can use it.
Change-Id: Ic1b244177964d6a15d0179e3bf5223ff7fc07cd8
* stable-2.14:
Apply buildifier to .bzl files.
Update Bower to 1.8.2
Bump commons-io version to 2.2
Change-Id: Ic90865db76a0e34f0f8fef33b83ec7b2fd75c875
Buildifier is now also used for formatting .bzl files.
This change was created by running buildifier 0.12 over our source tree.
Change-Id: I9f15112d4fe23e5cec0700cfe47f1ca649f61d2a
Buildifier is now also used for formatting .bzl files.
This change was created by running buildifier 0.12 over our source tree.
Change-Id: I9f15112d4fe23e5cec0700cfe47f1ca649f61d2a
JGit 5.0.0 introduces some new features (including support for the
git protocol v2), performance improvements, and bug fixes.
It also includes a number of deprecations, some of which cause
warnings in the gerrit project. These are not fixed in this commit,
but will be fixed in follow-ups.
See the release notes [1] for full details of the release.
[1] https://projects.eclipse.org/projects/technology.jgit/releases/5.0.0
Change-Id: I62200941b34ebcfa58934be531a2486b1fef3d01
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* stable-2.14:
Format WORKSPACE and BUILD files with buildifier version 0.12.0
Move commons-io from lib/BUILD to lib/commons/BUILD
Change-Id: I6130353f0cceed80b370e5566d329acd7e0829b3
All the commons-* libraries are defined in lib/commons/BUILD with
the exception of commons-io which is in lib/BUILD.
Move it to lib/commons/BUILD to make it consistent.
Change-Id: If2541eba2a4a9e9b5e7a777940bfce923478808b
This repository is used twice: for GWT and for PG toolchains, under
different names:
* codemirror_minified for GWT
* codemirror-minified for PG
In I1e75690fe1 the external repository names were harmonized, but
renaming of codemirror_minified to codemirror-minified was undone
to avoid collision between the two external repositories.
Make them unique and rename codemirror_minified to
codemirror-minified-gwt to avoid collision.
Change-Id: I14c2f319d0ca451dea9424af9f5080d89dc704ad
Recent Bazel versions support dash character in external repository
names. Consistently use them with one exception: javax_inject. This is
needed to match the name in the rules_closure.
Change-Id: I1e75690fe1ee2ab32fffe07c0c30dbed84753960
This is a snapshot built from the head of JGit's stable-4.9 branch and
includes the following commits since the currently used version:
5fe8e31d4 Ensure DirectoryStream is closed promptly
d13918310 Retry stale file handles on .git/config file
185e53bce Fix ssh host name handling for Jsch
891103609 Jsch overrides the port in the URI with the one in ~/.ssh/config
3d6455331 Minor fixes in three error messages
bea3b4667 Revert handling of ssh IdentityFile to pre-4.9 behavior
279eaf069 Strings#convertGlob: fix escaping of patterns like [\[].
The one we're interested in is:
5fe8e31d4 Ensure DirectoryStream is closed promptly
which fixes a leak of file handles when running GC.
Bug: Issue 8915
Change-Id: I9571d9df7ee0df2bae788ef10442e2c9e28797e9
Recent Bazel versions support dash character in external repository
names. Consistently use them with one exception: javax_inject. This is
needed to match the name in the rules_closure.
Change-Id: I1e75690fe1ee2ab32fffe07c0c30dbed84753960
* stable-2.14:
AbstractElasticIndex: fix index name of delete request and add coverage
Bazel: Remove unused commons-lang3
DropWizardMetricMaker: Move sanitizeMetricName to MetricMaker base class
Change-Id: I5e03191d329c6893ba9823fd20676aeefe0fb653
After removing Elasticsearch and Jest REST client library, commons lang3
is not used any more in Gerrit core. Given that we have forgotten to
remove it and stil expose it in plugin API only confused the plugins
that depend on it, because the build pass, but then the plugin cannot
work, because the required dependency is missing.
Change-Id: I7af2f9f6cb90e8e52d7ed2efaf4c3af85b47a9e2
Support for markdown files would only typeset text as bold or italic
when it appeared inside the corresponding inline Markdown syntax. It
didn't render the Markdown, but rather approximated what the text might
look like if rendered. Because this provides little real value, and
because HLJS sometimes incorrectly parses these Markdown constructs,
markdown is dropped from the highlighting layer.
Bug: Issue 9056
Change-Id: I97865dc8b522dca5a50264456274590fac83dae9
* stable-2.15:
Update git submodules
Reformat all Java files with google-java-format 1.6
Reformat all Java files with google-java-format 1.6
ChangeNotesTest: Have at most one call after ExpectedException#expect
FieldType: Remove unnecessary KEYWORD type
Remove unnecessary annotations from reindex test classes
AbstractReindexTests: Assert account index and group index
AbstractElasticIndex: Rename getActions to getDeleteActions
dev-bazel: Improve documentation of build caches
Hoist declaration of TestName up to GerritBaseTests
Bazel: Replace native {http,git}_archive with Skylark rules
Bazel: Bump rules_closure to 0.7.0
dev-contributing: Update link to buildifier tool
dev-contributing: Update buildifier to latest released version
Bump minimum Bazel version to 0.14.0 and activate caches
ElasticReindexIT: Add tests against Elasticsearch version 5
Elasticsearch: Add tests for queries against version 5
MatchQueryBuilder: Don't use deprecated "match" query
Elasticsearch: Add an adapter to support V5
Add Bazel version check
Change-Id: I6bbf229b76790f3fbb74a952d4330ba92e3dd449
This is the next part of the migration to Flogger. This change migrates
all remaining classes Flogger. This means all classes in Gerrit core now
use Flogger.
During this migration we try to make the log statements more consistent:
- avoid string concatenation
- avoid usage of String.format(...)
The visibility of the slf4j library is restricted to plugins and jgit
now. This avoids that we accidentally add new dependencies to slf4j.
Change-Id: Ide573327315a15cde69b68b5f27934deeb790d37
Signed-off-by: Edwin Kempin <ekempin@google.com>
Flogger is an open source project (Apache 2 License) from Google that
provides a fluent JAVA API for logging:
* https://github.com/google/flogger
* https://google.github.io/flogger/
We want to use Flogger instead of slf4j. This idea was discussed at the
Gerrit hackathon in Lund [1] and on the mailing list [2].
Benefits:
* Better Readability
* Better Performance
* Will allow us to implement request tracing
Flogger API examples:
* logger.atSevere()
.withCause(err)
.log("Error in %s %s", req.getMethod(), uri);
* logger.atInfo()
.atMostEvery(1, TimeUnit.HOURS)
.log(...)
* logger.atInfo()
.withStackTrace(StackSize.FULL)
.log(...)
Within Google Flogger is long-established and is used by almost 3/4 of
all Google's Java projects, hence this library is very mature.
The Flogger API can be used with different logging backends. We are
using the log4j backend, as we are currently using log4j as backend with
slf4j. This means there are no changes to how logs are configured
(existing log4j.properties and log4j.xml files continue to work). It
also means that this doesn't effect any integrations that work with
log4j (e.g. integration with logstash continues to work).
To use the log4j backend for Flogger the system property
'flogger.backend_factory' must be set to
'com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance'.
E.g. this system property may be set in gerrit.config:
[container]
javaOptions = "-Dflogger.backend_factory=com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance"
If this property is not set Gerrit sets it automatically on startup so
that we always have a proper logging configuration. We do this in
Main.java before loading any class. This is important since Flogger
reads this system property only once when the FluentLogger class is
loaded and we must be sure that the system property was set before this.
Using Flogger and slf4j in parallel is not a problem. Logs from both
APIs end up in the same log file(s).
This change doesn't migrate any classes to Flogger yet. This will be
done by follow-up changes.
JGit is still using slf4j and needs an explicit runtime dependency on
slf4j.
[1] https://docs.google.com/presentation/d/1Kwn77c1PScMLDEWiJDklEm43NsN2-mWm2PqHwYTkJfI/edit?usp=sharing
[2] https://groups.google.com/d/msg/repo-discuss/meEWJO7c4pA/fxDx2waRCQAJ
Change-Id: Ifc31fb95c10397857e8de5657c729f49c1820ec4
Signed-off-by: Edwin Kempin <ekempin@google.com>
* stable-2.14:
Remove unnecessary annotations from reindex test classes
AbstractReindexTests: Assert account index and group index
AbstractElasticIndex: Rename getActions to getDeleteActions
dev-bazel: Improve documentation of build caches
Hoist declaration of TestName up to GerritBaseTests
Bazel: Replace native {http,git}_archive with Skylark rules
Bazel: Bump rules_closure to 0.7.0
dev-contributing: Update link to buildifier tool
dev-contributing: Update buildifier to latest released version
Bump minimum Bazel version to 0.14.0 and activate caches
Change-Id: I27a88f0887b0d1e3af92fe2934d9e54222012e0f
Future Bazel versions will discontinue support for native http rules and
replace them with Skylark equivalents: [1]. Prepare the Gerit build tool
chain for that move.
The replacements depend on this PR in rules_closure project: [2], that
wasn't merged yet. For now we can apply "patch on import", thanks
Skylark's http rules patch support. When [2] is merged, and new version
of rules_clsoure is released, we can remove the patching procedure.
One side effect of this change is that Skylark version of http_file lost
the ability to save the downloaded artifact under its real name and is
using a generic download file name. The rule closure tool chain stumbles
on this, and rejects to accept polymer_closure artifact without ".js"
suffix. To rectify add intermediate rule and renamed "download" file to
one with js suffix "polymer_closure_renamed.js": [3].
[1] https://groups.google.com/d/topic/bazel-discuss/dO2MHQLwJF0/discussion
[2] https://github.com/bazelbuild/rules_closure/pull/270
[3] http://paste.openstack.org/show/722557
Inspired-By: "Klaus Aehlig" <aehlig@google.com>
Feature: Issue 9151
Change-Id: I44ca2ecfea67d2f4434a4743e7a6f8a3645e96a8
Testcontainers is a Java 8 library that supports JUnit tests, providing
lightweight, throwaway instances of common databases, Selenium web
browsers, or anything else that can run in a Docker container.
This change replaces ES integration test that currently uses embedded
ES mode with ES docker image using Testcontainers library. All this is
done from within acceptance tests.
This change removes dependency on ES server stack for the test code. As
the consequence, this stack can be removed.
Prerequisite for this change is installed docker service on the SUT. If
docker service is not installed, assumption violation is raised so that
the tests don't fail. Unfortunately, due to this missing Bazel feature,
JUnit assumption violations are not reflected on the Bazel UI: [1] yet.
[1] https://github.com/bazelbuild/bazel/issues/3476
Change-Id: Iccf44310292cc44bff9173f2a4ea757b43f77183
Remove jest API which depends on Elasticsearch native API (also
removed), so no longer depend on lucene for this scope. Replace such
removed dependencies with the Elasticsearch low-level API, which does
not depend on Lucene. That now used API is a REST client with minimal
dependencies, indeed. -As opposed to Elastic's current high-level API,
which still depends on lucene and other Gerrit-constraining libraries.
Do so in order to decouple the elasticsearch client from lucene in
Gerrit. That REST client does not logically require Lucene anyway. Most
importantly, such decoupling now enables upcoming support for more than
just one Elasticsearch server version. This includes the new possibility
of bumping the latter to multiple yet later versions, such as 5 and 6.x.
The currently used version (2.4) should also still be kept, for a while.
Bumping such versions will likely require some Elasticsearch client code
adaptations, so that Gerrit can (dynamically?) switch between either
Elasticsearch server version to eventually support (hopefully soon).
Doing the same for the elasticsearch tests in Gerrit is to be done using
another change or more changes.
Add a partial and customized fork of [1], based on [1]'s commit [2], to
preserve the ability of building proper json requests for Elasticsearch.
Put that forked json-generating code under a new 'builders' sub-package.
There should be a possibility in some near future to consider removing
that fork, based on potential progress such as the one proposed in [3].
Meanwhile, this fork shall be maintained to usual Gerrit quality levels.
[1] https://github.com/elastic/elasticsearch
[2] tag: v2.4.4
[3] https://github.com/elastic/elasticsearch/issues/30791
Bug: Issue 6094
Change-Id: I720c9885c9eab2388acc328eecb9eaa6940ced0c
* stable-2.14:
AbstractElasticIndex: Don't mention "change" in exception message
Consistently import org.slf4j.LoggerFactory
PluginLoader: Make Logger private
Documentation: clarify latest IntelliJ version use
Elasticsearch builders: fix the Eclipse warnings
Remove stale references to no longer used jackson libraries
Add 'docker' tag to build rules for Elasticsearch tests
ReindexIT: Split Elasticsearch test out to a separate class
Due to change I7c1461c45 ("ReindexIT: Split Elasticsearch test out to
a separate class") it is now possible to re-introduce the other changes
that were reverted in previous merges from stable-2.14 to stable-2.15:
- Iccf443102 ("Acceptance tests: Replace embedded ES with docker
testcontainer")
- I57e5d0718 ("Acceptance tests: Remove ES bootstrap boilerplate")
Although the reindex tests for Elasticsearch still don't work on the
stable-2.15 branch (issue 8799), they are now isolated in their own
class and the tests can be skipped using the @Ignore annotation.
Change-Id: Ia19ea3fc68d80e0d20ff3cbed2baa49981db401e
* stable-2.14:
ElasticContainer: Allow to specify the docker container version to create
ElasticContainer: Include cause in AssumptionViolatedException
ElasticContainer: Create with static method
Acceptance tests: Replace embedded ES with docker testcontainer
Elasticsearch: replace native API in prod w/ REST
Changes to ReindexIT done in Iccf443102 ("Acceptance tests: Replace embedded
ES with docker testcontainer") are reverted in this merge since that test
currently doesn't work with Elasticsearch on stable-2.15 (issue 8799).
Change-Id: I21d8b10ebd450c7dc840846a5a0d836b4243dacc
Dependency on jackson-dataformat-cbor and jackson-dataformat-smile was
removed in change Iccf443102. They were removed from the WORKSPACE, but
references to them were left in the lib/ folder.
Change-Id: I8d04842fb238a6749f6a97f9ce809f99e16beec5
Testcontainers is a Java 8 library that supports JUnit tests, providing
lightweight, throwaway instances of common databases, Selenium web
browsers, or anything else that can run in a Docker container.
This change replaces ES integration test that currently uses embedded
ES mode with ES docker image using Testcontainers library. All this is
done from within acceptance tests.
This change removes dependency on ES server stack for the test code. As
the consequence, this stack can be removed.
Prerequisite for this change is installed docker service on the SUT. If
docker service is not installed, assumption violation is raised so that
the tests don't fail. Unfortunately, due to this missing Bazel feature,
JUnit assumption violations are not reflected on the Bazel UI: [1] yet.
[1] https://github.com/bazelbuild/bazel/issues/3476
Change-Id: Iccf44310292cc44bff9173f2a4ea757b43f77183
Remove jest API which depends on Elasticsearch native API (also
removed), so no longer depend on lucene for this scope. Replace such
removed dependencies with the Elasticsearch low-level API, which does
not depend on Lucene. That now used API is a REST client with minimal
dependencies, indeed. -As opposed to Elastic's current high-level API,
which still depends on lucene and other Gerrit-constraining libraries.
Do so in order to decouple the elasticsearch client from lucene in
Gerrit. That REST client does not logically require Lucene anyway. Most
importantly, such decoupling now enables upcoming support for more than
just one Elasticsearch server version. This includes the new possibility
of bumping the latter to multiple yet later versions, such as 5 and 6.x.
The currently used version (2.4) should also still be kept, for a while.
Bumping such versions will likely require some Elasticsearch client code
adaptations, so that Gerrit can (dynamically?) switch between either
Elasticsearch server version to eventually support (hopefully soon).
Doing the same for the elasticsearch tests in Gerrit is to be done using
another change or more changes.
Add a partial and customized fork of [1], based on [1]'s commit [2], to
preserve the ability of building proper json requests for Elasticsearch.
Put that forked json-generating code under a new 'builders' sub-package.
There should be a possibility in some near future to consider removing
that fork, based on potential progress such as the one proposed in [3].
Meanwhile, this fork shall be maintained to usual Gerrit quality levels.
[1] https://github.com/elastic/elasticsearch
[2] tag: v2.4.4
[3] https://github.com/elastic/elasticsearch/issues/30791
Bug: Issue 6094
Change-Id: I720c9885c9eab2388acc328eecb9eaa6940ced0c