32 Commits

Author SHA1 Message Date
Han-Wen Nienhuys
a76ca4a345 Move //lib:common-io to //lib/commons:io
Change-Id: I1bd002a0073acb44d0033b6b994eb1c5129c76ec
2018-01-24 15:21:30 +01:00
David Pursehouse
fce6a071eb Remove commons_oro and commons_collections
These were only required as transitive dependency of Velocity, which
was removed in change I9942eb1a9.

Change-Id: Ia55ebd275eafe0987168bafd5b90f108ecc8416d
2017-10-31 08:32:45 +09:00
David Ostrovsky
fdbfcad77d Remove Buck based build
Bug: Issue 5302
Change-Id: I6e860446ef30ff0ad1c7c49fc0e39d39d921820b
2017-01-23 12:44:58 +00:00
David Ostrovsky
fa18907d7f Bazel: Reformat build files
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
2016-12-07 11:33:07 +00:00
Jonathan Nieder
4b657d5c39 Update commons-compress to 1.12
We haven't updated commons-compress for a while.  Update now to make
later upgrades easier in case we need a feature or security fix.

Change-Id: If6796f2b52bbd719d1221f56edbe37639e65a802
2016-10-17 16:50:29 -07:00
Han-Wen Nienhuys
5e4491886b bazel: update for elasticsearch and lucene.
Change-Id: Icb9f9f0344b10a008d5b353362933890446eb544
2016-09-28 21:17:08 +02:00
Dave Borowitz
d08edf6a71 Merge changes from topic 'elasticsearch'
* changes:
  Introduce gerrit-index module
  Add support for secondary index with Elasticsearch
2016-09-28 08:38:54 +00:00
David Pursehouse
8e72f5301b Add support for secondary index with Elasticsearch
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
2016-09-27 23:27:37 +09:00
Yuxuan 'fishy' Wang
410c3b5824 bazel: licenses cleanup
Add licenses for diffy_logo, clippy, and fix commons/oro license.

Change-Id: Ie77dee5b3178c6ef7b9561e03b172a00680bc56a
2016-09-27 08:48:56 +08:00
Yuxuan 'fishy' Wang
75b98f77d9 bazel: add license to appropriate lib/ targets
This is to prepare for implementing genlicenses rule in bazel.

Change-Id: I60d79d5b53f9dd05c9f9ebfe6e6f658604c5a037
2016-09-26 16:42:38 +08:00
David Pursehouse
71a530d544 Merge branch 'stable-2.12'
* stable-2.12:
  Update commons-validator to 1.5.1 and add test for validating TLDs

Change-Id: Icdb4cf317daa6e346ef06dfa769121fd5e69d810
2016-06-29 11:17:52 +09:00
David Pursehouse
802a16207a Update commons-validator to 1.5.1 and add test for validating TLDs
Version 1.4.1 does not recognize .team as a valid TLD and thus prevents
users from using that domain as their email address.

Upgrade to version 1.5.1 which uses TLD list Version 2016042500, which
includes .team.

Also add a test for the validator.

The list of TLDs tested is taken from the IANA site [1] and is a later
version that includes some TLDs not yet supported by commons-validator.

Test that supported TLDs validate, while unsupported TLDs do not.

[1] http://data.iana.org/TLD/tlds-alpha-by-domain.txt

Bug: Issue 4154
Change-Id: I82378e578387a1fd70eabac012570e430e193e52
2016-06-28 12:49:59 +00:00
Edwin Kempin
b644ff8fcf Merge "Implement Bazel build" 2016-06-24 10:51:33 +00:00
Shawn Pearce
48d8a04cea Update to Apache Commons Net 3.5
The getReplyStrings() strings is now provided by the base class,
so we do not need to implement it ourselves.

Change-Id: I6a90c3dd11cbc5c7532c2c80f2c81046443b3030
2016-06-19 11:01:02 -07:00
David Ostrovsky
b81b4f75ae Implement Bazel build
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
2016-06-14 21:12:02 +02:00
Shawn Pearce
bd6143c4db Update commons-collections to 3.2.2
Change-Id: I59a2d2874dd410df1715a70b011f879a9d9480e3
2016-03-07 10:45:36 -08:00
David Pursehouse
04807b67fc Remove unnecessary dependency on commons-io
commons-io is no longer used in core Gerrit.  Remove the dependency and
stop exporting it in the plugin API.

Also update the replication plugin to the latest revision:

- Bundle commons-io since gerrit core no longer provides it

Change-Id: I6bcf6ec6134039de7d8f9c1670167a0318510745
2015-07-30 21:54:17 +09:00
David Pursehouse
68a0881e54 Merge branch 'stable-2.11'
* stable-2.11:
  Update 2.11.1 release notes
  PatchListCacheImpl: Catch LargeObjectException
  Update commons-validator to 1.4.1

Change-Id: I34f81ad8a0276d127b925422d6d97ac3c7b9bea4
2015-05-27 11:00:46 +09:00
Edwin Kempin
09ee9a979a Update commons-validator to 1.4.1
This fixes a bug where a valid email address is incorrectly rejected.

Bug: Issue 2791
Change-Id: I27a538d5b4485ccaded8ec0aa33f5e7797bc1503
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2015-05-26 11:36:00 +02:00
David Pursehouse
78bbaad5f0 Merge "Support 'git-upload-archive'" 2015-05-07 04:37:04 +00:00
Gustaf Lundh
d00e9e7b99 Package jsonevent-layout with war
Since java does not allow aditional -classpaths when loading
a -jar (or war in Gerrits case), it is more or less impossible
to add a new external log4j appender when using embedded jetty.

This change packages the common jsonevent-layout appender and
its dependencies with gerrit.war, allowing logging in json-format
(usable for instance when sending logs to logstash).

This change also updates commons-lang from 2.5 to 2.6 which is
preferred by jsonevent-layout.

Change-Id: I1a6e35c9e0da571bf88718ce5e56c5d9e8649203
2015-04-29 13:26:01 +00:00
Francois Ferrand
1e9338854c Support 'git-upload-archive'
This allows use the standard git archive command to create an archive
of the content of a repository:

  $ git archive -f tar.bz2 --prefix=foo-1.0/ \
    --remote=ssh://john@gerrit:29418/foo \
    refs/changes/73/673/1 > foo-1.0.tar.bz2

Different compression levels can be configured for zip format:

  $ git archive -f zip -9 \
    --remote=ssh://john@gerrit:29418/foo \
    refs/changes/73/673/1 > foo.zip

TEST PLAN:

  buck test --include ssh

Bug: Issue 2061
Change-Id: Ifc1a92bacef3155cf474adee883cbe587dd8759f
2015-04-23 20:45:28 +02:00
David Pursehouse
a4640fb15c Move httpcomponents libraries out of lib/commons to lib/httpcomponents
The elasticsearch REST client (Jest) has dependencies on more of the
libraries from httpcomponents, so it will make things a bit cleaner if
they are all kept in a separate lib.

Change-Id: I5c66b9bd63cbd66136bd7f543a1c4766de052889
2014-09-17 17:55:17 +09:00
Edwin Kempin
4ed7fb2020 Use ban commit REST endpoint in ban-commit SSH command
Change-Id: I1d32b6c64af35fad3768863b15c1cc37c5c3c886
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-07-10 13:21:58 +02:00
David Ostrovsky
b1e9143246 Update httpclient and dependencies
The new release fixes a number of bugs [1].

Also replace deprecated DefaultHttpClient with HttpClientBuilder.

[1] http://www.apache.org/dist/httpcomponents/httpclient/\
RELEASE_NOTES-4.3.x.txt

Change-Id: I3cdd566d5edf313673d79df3707de010a395b5b6
2014-06-23 07:02:31 +00:00
Shawn Pearce
65df1358a1 Merge "Validate email address when adding email or creating account" 2014-03-08 00:36:40 +00:00
David Ostrovsky
fbf6b7dabd Download commands: Add JGit archive
Since JGit 3.1 archive command was implemented. Add it to download
drop down as new line.

The following libraries are introduced in this change:

* jgit-archive (Apache 2)
* commons-compress (Apache 2)
* tukaani-xz (Public domain)

Change-Id: I5f61aac8c434414c73585a9320e84f4430dd111d
2014-03-03 23:34:46 +00:00
Edwin Kempin
a9abdf4589 Validate email address when adding email or creating account
This checks that the email address has a valid format.

Change-Id: I1f8d95dd9b02e720996bd15cca093ca55b5e4597
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-02-07 10:02:33 +01:00
David Ostrovsky
8852c3b04b Revert "BUCK: fix Implementation-Version in replication plugin"
d69333006e488da9142d2be68a6a7c6f0acc0bab fixed Buck's bug, that was
reproduced [1], reported [2] and fixed [3] upstream.

[1] https://github.com/davido/buck_test
[2] https://github.com/facebook/buck/issues/44
[3] e93cb2a698

Change-Id: Ie6cfa832c8c9dc100ff6fc63c5583aa931857359
2013-09-21 02:49:23 +00:00
David Ostrovsky
d69333006e BUCK: fix Implementation-Version in replication plugin
buck build plugins/replication

produces broken META-INF/MANIFEST.MF in replication.jar file.

What Buck is doing is to issue that command (shorten):

  jar cfm replication.jar buck-out/gen/plugins/replication/MANIFEST.MF \
          buck-out/gen/.../replication__plugin.jar \
          buck-out/gen/lib/commons/io/commons-io-1.4.jar

and the content of correct input MANIFEST.MF file get overriden with the
content of MANIFEST.MF from commons-io-1.4.jar.

So instead of expected Gerrit version:
Implementation-Version: v2.7-rc4-1348-g36c61aa

we get:
Implementation-Version: 1.4

Change-Id: If93b1c64e8199c858aa55505352f631790a029ff
2013-08-29 21:09:29 +00:00
Ahaan Ugale
404c8246bc Add secondary index implementation using SolrCloud
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
2013-06-27 13:52:39 -07:00
Shawn Pearce
fd6bb9f6a5 Build with Buck
Implement a new build system using Buck[1], Facebook's
open source clone of Google's internal build system.

  Pros:
  - Concise build language
  - Test and build output is concise
  - Test failures and stack traces show on terminal
  - Reliable incrementals; clean is unnecessary
  - Extensible with simple blocks of Python
  - Fast
      buck: clean: 0.452s, full 1m21.083s [*], no-op:  7.145s,
      mvn:  clean: 4.596s, full 2m53.776s,     no-op: 59.108s,

      [*] full build includes downloading all dependencies,
          time can vary due to remote server performance.

  Cons:
  - No Windows support
  - No native Maven Central support (added by macros)
  - No native GWT, Prolog, or WAR support (added by macros)
  - Bootstrap of buck requires Ant

Getting started:

  git clone https://gerrit.googlesource.com/buck
  cd buck
  ant

  Mac OS X:
    PATH="`pwd`/bin:/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands:$PATH"

  Linux:
    PATH="`pwd`/bin:$PATH"

Importing into Eclipse:

  $ time buck build :eclipse
  0m48.949s

  Import existing project from `pwd`
  Import 'gerrit' (do not import other Maven based projects)
  Expand 'gerrit'
  Right click 'buck-out' > Properties
  Under Attributes check 'Derived'

  If the code doesn't currently compile but an updated classpath
  is needed, refresh the configs and obtain missing JARs:

  $ buck build :eclipse_project :download

Running JUnit tests:

  $ time buck test --all -e slow  # skip slow tests
  0m19.320s

  $ time buck test --all          # includes acceptance tests
  5m17.517s

Building WAR:

  $ buck build :gerrit
  $ java -jar buck-out/gen/gerrit.war

Building release:

  $ buck test --all && buck build :api :release
  $ java -jar buck-out/gen/release.war
  $ ls -lh buck-out/gen/{extension,plugin}-api.jar

Downloading dependencies:

  Dependencies are normally downloaded automatically, but Buck can
  inspect its graph and download missing dependencies so future
  compiles can run without the network:

  $ buck build :download

[1] http://facebook.github.io/buck/

Change-Id: I40853b108bd8e153cefa0896a5280a9a5ff81655
2013-05-09 13:40:36 +00:00