In Ibe62917e20 maven jar merging using python was replaced with
java_binary rule. Fix eclipse project generation and also clean up
left over unused import statement and script.
Change-Id: I46b14f8e8e380f38962937be253fb1b7e4fa147d
In I42fd1a130e ("Merge Lucene core and backward-codecs jars"), Dave
Borowitz introduced a script to concatenate META-INF/services/ files
for Codecs.
Buck would randomly pick one of the two service files. The solution
was to explicitly pick the first entry for class files, and
concatenate service files.
In Bazel, we can have Bazel do the work of merging jars. This is done
with the java_binary rule. This concatenates the service files, and
picks a single .class file from each input jar, as determined by the
ordering in the jars attribute.
Delete tools/merge_jars.py, as this was its only use. This also fixes
an issue where Mac users need to specify --host_force_python=PY2 if
they don't have Python 3.
Change-Id: Ibe62917e20eeb1824967782d4d510f3f63775fce
This change is fixing "All Java build rules should be loaded from
Starlark" warning flagged by latest buildifier version: [1]. Python
rules are now also loaded from the Starlark.
Also extract codemirror library import to BUILD file. This is needed to
avoid cycle in the workspace file, after importing java rules from
Starlark.
[1] https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#native-java
Change-Id: I36192c9465d988b25cf09c250e110f15850910cd
For packages having a default visiblity defined, it is redundant to also
set the same visibility per package, so remove those.
For packages that only have one rule, and its visibility differs from the
default visibility, remove the default visibility.
Also clean up wrapping of some of the default definitions.
Change-Id: I9e81c3f724b4ffde7a652b485d33c650866ad122
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
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
Reformat the Bazel build files with the buildifier tool [1].
The style is different for Bazel files. Most notably, indentation level
is 4 spaces instead of 2, and " is used instead of '.
[1] https://github.com/bazelbuild/buildifier
Change-Id: I95c0c6f11b6d76572797853b4ebb5cee5ebd3c98
Add support for secondary index on Elasticsearch via the REST API
using the Jest client [1].
Because Elasticsearch uses different version of Lucene we add another
maven_jar's in gerrit-elasticsearch BUCK. Fortunately both versions have
compatible API, this way we are able to compile and run Gerrit.
All tests for changes index passes, but they need to use Lucene's based
account index.
[1] http://www.searchly.com/documentation/developer-api-guide/java-jest/
TODO: Add support for online reindex
TODO: Add support for schema upgrades
Also-By: Janice Agustin <janice.agustin@ericsson.com>
Also-By: Olga Grinberg <olga.grinberg@ericsson.com>
Also-By: Dariusz Luksza <dluksza@collab.net>
Change-Id: I5e4fc08ce34d33c090c9e0bf320de1b17309f774
We need to have the same version in core Gerrit as is used by
Elasticsearch.
This reverts commit f18c2256d56ed9574429e0934de2acda47a4a065.
Change-Id: Ib8e403680be961406b67bf30069c9061f0445195
Version 5.5.2 is the latest release of 5.x before 6.x and will
be used in Elasticsearch 2.4.0 [1].
[1] https://github.com/elastic/elasticsearch/pull/19496
Change-Id: Ice4ca86fe141bc42abcdc25867761dc6f4272851
This is not the latest version on the 5.x series, but is the version
used in the latest release of Elasticsearch.
Change-Id: Iddc6852cc1e2e338e4d026b0ba3438e8f26fc812
To run the tests:
bazel test //...
To build the Gerrit plugin API, run:
bazel build gerrit-plugin-api:plugin-api_deploy.jar
To build the Gerrit extension API, run:
bazel build gerrit-extension-api:extension-api_deploy.jar
TODOs:
Licenses
Reduce visibility (all public for now)
Generate HTML Documentation
Core plugins
gerrit_plugin() rule to build plugins in tree and standalone modes
GWT UI (only gwt_module() skylark rule is provided, no gwt_binary())
PolyGerrit UI
WAR
Publish artifacts to Maven Central
Ask Bazel team to add Gerrit to their CI on ci.bazel.io
Contributed-By: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I9a86e670882a44a5c966579cdeb8ed79b1590de3
This is needed after the upgrade to Lucene 5.4.1.
This partially reverts commit fc70ea396173a667b13272646997e222bb4d0756.
Change-Id: Ie8f4449a08ff951278863bddf39016a951a05067
These hacks were added in 70aaf7ea to continue supporting old index
versions stored on disk, which was necessary to upgrade v14 to v25
for 2.11->2.12. Now that stable-2.12 has been cut, we can remove
support for this.
Get rid of the core-and-backward-codecs target and just use core. A
side effect of this change is that pack_war.py would now fail, since
it expects each jar that goes in lib/ to have a unique name, and there
is already a "core" target in MINA. Prefix all the lucene targets with
"lucene-" to get it working.
Change-Id: I146fc74ed649e0a44503f42bfa5822bf6fba5c03
This version includes a number of new features and bugfixes.
It also includes an API change that causes deprecation
warnings:
- BooleanQuery is now immutable and can be built using the
BooleanQuery.Builder class
Instantiate instances of BooleanQuery with the new builder class
instead of with its constructor.
See the release notes for full details:
https://lucene.apache.org/core/5_3_0/changes/Changes.html
Change-Id: I5954b10017f2ff1531b036f953c6e4488e338f0e
Both of these jars provide a provider-configuration file in
META-INF/services/org.apache.lucene.codecs.Codec registering their
respective implementations as providers of this codec. The proper way
to merge these files is to concatenate them, but the normal Buck build
process would otherwise choose one arbitrarily.
Add a new custom rule merge_maven_jars to merge multiple Maven jars
together using a simple Python script. The script concatenates all the
entries in two zip files, preferring the entry found in the first file
on the command line, which is still arbitrary but at least
deterministic. It specially handles files in the META-INF/services
directory by concatenating them.
Use this new rule to merge the old :core and :backward-codecs rules
into a single :core-and-backward-codecs rule.
Change-Id: I42fd1a130e42cb0eebf7bee61cfdf8545397cd09
There is nothing specific that we need in this version. It might be
needed for the Elasticsearch integration, and somewhat reduces the
changes that will potentially be needed when upgrading to 5.2.0 or
later.
Change-Id: Iafb3b13c302fa37ec1b4ce72d01c489b05169e07
Use this version starting at the existing schema version 15 (which has
been in master for only a week or so).
Notable changes:
- Can use the new IndexWriter#setCommitOnClose(boolean) method to
simplify closing an index.
- This means we no longer need to pass Version into the
IndexWriterConstructor. According to [1], this was _only_ used to
determine whether or not the index should be committed on close, as
this behavior differed between versions. No more mapping schema
versions to Lucene versions!
- IndexWriters are now forced to use their configured Analyzer,
removing the methods taking an Analyzer (which we weren't using
anyway). This saves some code in AutoCommitWriter.
- Lucene 5 cannot read indexes created by older versions without an
additional jar in the classpath, so we need to add that.
The most annoying change is that sorting cannot be done on normal
numeric fields by default anymore[2]. This was inefficient anyway, as
Lucene had to seek and read all index field values before doing the
sorting. Switch to the newer DocValues API for strongly-typed sortable
fields. This introduces some medium-term ugliness as the sort spec
changes depending on the schema version.
Unfortunately we can only use DocValues on new index versions; older
versions need to use the new UninvertingReader API, which provides
FieldCache based sorting without a reindex. An overzealous check in a
static method in Lucene[3] means we need to temporarily fork
SearcherManager.java from Lucene in order to get this to work with the
NRT machinery.
Since we have to jump through significant hoops to get older index
versions readable by this version of Lucene, add a test specifically
for schema v14.
[1] https://issues.apache.org/jira/browse/LUCENE-5871
[2] https://issues.apache.org/jira/browse/LUCENE-5666
[3] https://issues.apache.org/jira/browse/LUCENE-6370
Change-Id: I843be2fb697779fc741e25459a2716280b2bd0b6
Eventually this will no longer be part of the serialized change proto,
and even with the cache it is still expensive to check mergeability
for each change in a list of search results, as the submit type must
still be checked in order to look up the mergeability.
The new MERGEABLE field now loads from the cache, although ChangeJson
and several other callers still depend on the field in Change. This
will facilitate index schema upgrades, in that a full reindex will
also populate the persistent cache.
While we're at it, upgrade Lucene to 4.10.1, which contains some
important stability bugfixes[1].
[1] http://lucene.apache.org/core/4_10_1/changes/Changes.html#v4.10.1
Change-Id: I166b85f91bd596a3f0295616c2e72853b692dd54
Based off https://gerrit-review.googlesource.com/#/c/52190, but
implementing the final suggestion of indexing raw delta counts and
allowing arbitrary range queries off of those.
Also upgrade Lucene to 4.8.1 as this was released since the last
schema change (which was on 4.7.0).
Change-Id: Ia8a677e71e133f68eced4c5394df1d23efe7f12a
Index alongside the "project" field, which is an exact match field,
since we do not assume index implementations can search exact match
and prefix on the same field. We do not want to modify the existing
"project" to return prefixes.
Upgrade Lucene to 4.7.0, as this was released since the last schema
change.
Change-Id: I7c3379c087fc54af3e5790cb875a5e676e674338
Also remove unused artifacts from the Buck file.
Gerrit gitblit plugin must ship Lucene binaries in shaded jar, because
the versions of Lucene that Gerrit and Gitblit ship are different.
This change and this pull request [1] harmonize the Lucene versions in Gerrit
and Gitblit distributions.
[1] https://github.com/gitblit/gitblit/pull/124
Change-Id: Ib94a288b60445d73f617174d58f69e4fe91b4d36
The documentation of this endpoint is available in
rest-api-docsearch[.txt|.html].
The UI of showing the search result and doing the search will be in a
separate change.
Change-Id: Ifa4f5a7d576ada7f88a4fa1b765a38cba6d7e964
Of note in this version upgrade is the replacement of NrtManager by
ControlledRealTimeReopenThread, which has a different API as used by
SubIndex.
Change-Id: Id34eb8e75bb07a38be9b5ed9a1cdeaf195774b58
SolrCloud can be used instead of Lucene by adding "type = SOLR"
under [index] and "url = <zookeeper-url>" under [index "solr"]
in gerrit.config.
Change-Id: I0ff8579c5e23c58b16f3605bc20eba4e80fb40fc