757 Commits

Author SHA1 Message Date
David Ostrovsky
8eee3669f3 Merge "update web-component-tester to 5.0.0." 2017-02-13 18:46:21 +00:00
Dave Borowitz
39bc108a39 Make implicit reviewers feature actually work on GWT UI
This was presumably fixed in Ia5e6b9791 and in I8b735db4f. It turns
out, that labels map is not null in GWT UI, as it is the case in PG,
but also non empty, even in non-voting case: Code-Review: 0.

Fix the optimization check to account for zero votes.

Bug: Issue 4638
Change-Id: I6d9a2cc42ec51e6b1df13b96cf4bcdd082c87f60
2017-02-11 06:19:54 +00:00
Dave Borowitz
292fa154c1 Format all Java files with google-java-format
Having a standard tool for formatting saves reviewers' valuable time.
google-java-format is Google's standard formatter and is somewhat
inspired by gofmt[1]. This commit formats everything using
google-java-format version 1.2.

The downside of this one-off formatting is breaking blame. This can be
somewhat hacked around with a tool like git-hyper-blame[2], but it's
definitely not optimal until/unless this kind of feature makes its way
to git core.

Not in this change:
* Tool support, e.g. Eclipse. The command must be run manually [3].
* Documentation of best practice, e.g. new 100-column default.

[1] https://talks.golang.org/2015/gofmt-en.slide#3
[2] https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/git-hyper-blame.html
[3] git ls-files | grep java$ | xargs google-java-format -i

Change-Id: Id5f3c6de95ce0b68b41f0a478b5c99a93675aaa3
Signed-off-by: David Pursehouse <dpursehouse@collab.net>
2017-02-07 10:04:39 +09:00
Han-Wen Nienhuys
afdd224496 update web-component-tester to 5.0.0.
Change-Id: I8e4b409574cd0b660f290213fdec26f8d2e7411c
2017-02-01 13:33:56 +01:00
Han-Wen Nienhuys
3dede1653a bower2bazel: don't specify versions for non-seed packages.
The 'seed' packages are the ones whose versions are set by us in
WORKSPACE. We should not set the versions for the rest of the packages
in the bower input JSON, so bower can suggest the right versions to
use.

Change-Id: I9b75f16655d049e2064726862980a339c91dd534
2017-02-01 13:33:55 +01:00
Paladox none
603fb17b44 Remove one last buck file from gerrit's core
Change-Id: I48ab5af8be5493b36f903e4e32277a611de97a17
2017-01-27 19:41:56 +00:00
David Ostrovsky
a3acef8de4 Bazel: Fix powermock-core declaration
In the definition of //lib/powermock:powermock the dependency to
@powermock_core//jar was missing.

Change-Id: I4055085592ad556e7b1da730344b7e48460be7af
2017-01-24 23:31:15 +01:00
David Ostrovsky
fdbfcad77d Remove Buck based build
Bug: Issue 5302
Change-Id: I6e860446ef30ff0ad1c7c49fc0e39d39d921820b
2017-01-23 12:44:58 +00:00
David Pursehouse
074cf23832 Upgrade JGit to 4.6.0.201612231935-r.30-gd3148f300
This snapshot includes several fixes since the release, including some
improvements in LFS support:

  d3148f300 Make ObjectDownloadListener public
  55c629a9f LfsProtocolServlet#LfsRequest: Add operation type helper methods
  56fe21778 Expose LFS operation strings as public constants
  590141163 LfsProtocolServlet: Improve error on getLargeFileRepository failure
  7245aa031 Add support for refusing LFS request due to invalid authorization
  0e187f148 Add LfsPointerFilter TreeFilter

Change-Id: Ib3cd9d8677b6c6017becc5c46e7fa4dfc5192807
2017-01-19 23:45:46 +00:00
Paladox
10649e4550 Update bouncy castle to 1.56
See release notes at https://www.bouncycastle.org/releasenotes.html

Change-Id: Id0c5b1e929118469b4a80252e44a201b7b8f62f5
2017-01-11 23:05:10 +00:00
Matthias Sohn
e1d12494d9 Update JGit to 4.6.0.201612231935-r
Change-Id: Ibd58603e6c1975c883dbf9f1d115e03a25467774
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: David Pursehouse <dpursehouse@collab.net>
2016-12-29 21:21:37 +00:00
David Ostrovsky
1b44bb8430 Merge "Update codemirror to 5.22.0" 2016-12-27 20:06:02 +00:00
Paladox
1e55a382d6 Update codemirror to 5.22.0
Highlights include:
 - New themes duotone-light and duotone-dark
 - Various small fixes to language modes

Change-Id: I632cc2dd3815767293ea9638b0551f7a98f330b2
2016-12-22 23:40:25 -04:00
Dave Borowitz
bb6896caad Update gwtorm to v1.17
$ git log --oneline v1.16..v1.17
09ada04 Version 1.17
4ce1c32 JdbcAccess: Defer exceptions when in a transaction
b46ab3e Incorporate table into H2 column constraint name
0bfc2e3 Start 1.17

Change-Id: Iee0002cbc74678cac53c1931acf1bea92ef25c7e
2016-12-22 12:20:56 -05:00
David Ostrovsky
86da32cd24 Buck: Simplify jsoup integration
Remove unnecessary java_library rule wrapper around another
java_library defined through maven_jar rule.

Change-Id: I197df73f8944b9d17c7738c036035b2daccd8e61
2016-12-21 23:25:11 +01:00
David Ostrovsky
6fe506f00d Buck: Simplify mime4j integration
Remove unnecessary java_library rule wrappers around another
java_library defined through maven_jar rule.

Change-Id: I5df214dccf419bbf745babda6ee9ccd7f4905b72
2016-12-21 23:20:00 +01:00
David Ostrovsky
f077f132b2 Buck: Simplify mail integration
Remove unnecessary java_library rule wrappers around another
java_library defined through maven_jar rule.

Change-Id: Ibb6d52d210e2ba1f2569177d232f41b7a67a6a7f
2016-12-21 23:11:29 +01:00
Han-Wen Nienhuys
42ea853037 bazel: remove code to sniff license field in bower.json.
Instead, use a hard-coded map of licenses.

Hardcode a false dependency on diff-match-patch to avoid a diff for
the Apache2.0 license.

Tested:
  bazel build Documentation:js_licenses.txt
  buck build Documentation:js_licenses.txt
  diff -u  buck-out/gen/Documentation/js_licenses.txt/js_licenses.txt \
    bazel-genfiles/Documentation/js_licenses.txt
 diff shows only diffs for added [[header]] anchors.

Change-Id: I7886e1fadec900cf854a1b3b7c538b83d66af7a4
2016-12-20 15:44:52 +01:00
Dave Borowitz
8cadb33267 Improve documentation of diff-match-patch build
Output the actual jar path used for the build in the generated JS
file, rather than a broken Google Code link. This requires extracting
a constant for the version string.

Rename the addon_merge target to indicate that it includes bundled
dependency code from diff-match-patch, which fact is not otherwise
obvious.

Change-Id: I6512e5d65b81802d917f718f8e62ac414e8bffda
2016-12-19 16:51:56 -05:00
Han-Wen Nienhuys
238c6e9763 Add license for diff-match-patch JS.
Fix dependencies for codemirror targets.

Change-Id: Ibda5573438b0ab76c42f5faaa3a463b5975bd43c
2016-12-19 11:53:43 +01:00
David Ostrovsky
52e9272e68 Merge "Buck: Activate error prone checks" 2016-12-13 20:55:54 +00:00
David Ostrovsky
8b73d9cb56 Buck: Activate error prone checks
Given that Bazel activates error prone static analyzer per default,
allow to activate it for Buck as well.  We already monkey patch
java_library and java_test rules, so it's trivial to munge javac_jar
and compiler_class_name attributes as well.

Due to compile performance coniderations and some issues that were
reported with error prone activated by default in Buck driven build,
we make the integration optional and disabled by default. There are
two option to activate it:

1. Add these lines to your private .buckconfig.local to permanently
activate error prone checks:

  [sanitizers]
    error_prone = 1

2. Use this config option to instantly run error prone check:

  buck build --config sanitizers.error_prone=1  gerrit

Error prone has an issue with naming artifact with all transitive
dependencies included: while it has the suffix "ant", it should be
just called "all". But, TBH, we don't care.

Error Prone is Google library and is released under Apache 2 license.

Change-Id: I2bbe0313ad3e54df1d52968cc28d7e13db36d83f
2016-12-12 08:38:23 +00:00
David Pursehouse
2d08500516 Format .bzl files with Bazel Buildifier
Change-Id: I3ab30565e5ac110a18cbe3d34f76307801c30373
2016-12-11 19:00:21 +09: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
David Pursehouse
1a03ecf787 Upgrade JavaEWAH to 1.1.6 to match version used in JGit
JavaEWAH was upgraded in JGit in [1], which is included in the snapshot
build of JGit being used in Gerrit since change Ic7c646b32.

Upgrade to use the same version.

[1] https://git.eclipse.org/r/#/c/77604/

Change-Id: I5de4cdbdf816296d97640bb83130544ec85685af
2016-12-05 22:28:15 +09:00
Han-Wen Nienhuys
c1a6976b50 bazel: put source jars in the same package.
This lets us associate the jar and the src jar in the java_import()
declaration, so IDE plugins could understand how artifacts and source
are connected.

Classpath generation for Eclipse IDE was adjusted to reflect the changed
location of the source artifact.

Change-Id: I2cf9c6db3ad4b648457f2ac8d380c3771b4a3ee2
2016-11-30 08:48:20 +01:00
David Ostrovsky
8c9a9ea486 Expose sources in GWT UI plugin API
gwt_binary() uses Bazel feature to retrieve the sources from the
dependency libraries. For the standalone API this feature cannot be
used as the only dependency is GWT UI plugin API. Expose the sources
in GWT UI plugin API as well.

TEST PLAN:

Apply this change and create the plugin API:

  $ ./tools/maven/api.sh install

Apply reviewers plugin Bazel build implementation change: [1] and
verify, that the reviewers plugin can be built with the GWT UI plugin
API created with this change.

[1] https://gerrit-review.googlesource.com/91830

Change-Id: I2b065a8eccbc33020d461834704d684871f463d7
2016-11-22 22:16:18 +00:00
Shawn Pearce
b3fdbcf78d Update JGit to 4.5.0.201609210915-r.115-g81f9c1843
Adds support for MonotonicClock, which Gerrit can use
inside of ReviewDb and NoteDb to maintain timestamps.

Change-Id: Ic7c646b32644c1d1b1e93eeb50a3bf153e85d3c3
2016-11-21 14:10:02 -08:00
David Pursehouse
d678ca18b8 Merge "Add jsoup to Buck and Bazel" 2016-11-16 01:43:32 +00:00
Patrick Hiesel
ced85a98fa Add jsoup to Buck and Bazel
This library will be used for parsing incoming HTML emails and ingest
comments into Gerrit.

Change-Id: I3ccfd231ad36a8da94172bb32cbf979bafc914b5
2016-11-16 01:24:59 +00:00
David Ostrovsky
2502fab15a Bazel: Implement GWT UI build for the plugins
TEST PLAN:

  $ bazel build plugins/cookbook-plugin

Deploy to the server site and verify that it works.

Change-Id: I98af807f9c92ba4ed7efad332d8fdee407bb8ce6
2016-11-15 15:29:13 -08:00
David Ostrovsky
899edce177 Bazel: Unsign the JGit jars
Now that we use download_file.py anyway, move the unsign part to it.

Change-Id: I139fae87bbe263ac42e75d4706fa28059a53e326
2016-11-15 15:12:11 +00:00
Shawn Pearce
933306d823 Update JGit to 4.5.0.201609210915-r.104-g1c70dd6d2
Includes {get,set}GitwebDescription on Repository,
which can replace methods in GitRepositoryManager.

Change-Id: Ie25a49864c770e1cfb065dfc9e7c1e8faa97b03c
2016-11-14 12:33:32 -08:00
David Ostrovsky
e712a30c19 Merge "Bazel: use a custom maven_jar rule" 2016-11-13 17:18:13 +00:00
David Pursehouse
76fce8d8de Merge "Bump guava to 20.0" 2016-11-09 08:48:45 +00:00
David Ostrovsky
6546085df7 Bazel: use a custom maven_jar rule
Using existing download_file.py from custom maven_jar Skylark rule
gives us the following advantages:

* fetching of sources (needed for GWT JSNI build and IDE integration)
* server support for proxies
* global, per-user cache of artifacts
* support for local maven repository (~/.m2)

Change-Id: Ic246dd9298775a6819f05453c601c688d8cb7ab9
2016-11-09 08:31:11 +01:00
Viktar Donich
5389538038 Serve fonts for local PolyGerrit development
Packs fonts the same way bower_components are packed, with a 'fonts'
folder inside fonts.zip.

Also removes deprecated OpenSans fonts from build files.

Bug: Issue 4893
Change-Id: I7fc11d6e689c7d5b1d68d09e94ee7aaba91ded9b
2016-11-07 14:24:06 -08:00
ekempin
dff208be39 Merge changes from topic 'email-ingestion'
* changes:
  Add IMAP implementation for receiving emails
  Add POP3 implementation for receiving emails
  Implement RawMailParser
  Implement receiver class structure and bindings
2016-11-07 12:22:01 +00:00
Patrick Hiesel
8f0fabf9dc Implement RawMailParser
This change adds a parser to parse raw emails received by either POP3 or
IMAP into a MailMessage. It adds a dependency to Apache Mime4j to handle
the mime message parsing and tests.

Change-Id: I97ead9615ffcd0a7839ae1aa1581be4005cf67f1
2016-11-07 11:18:50 +01:00
Patrick Hiesel
328b761528 Implement receiver class structure and bindings
This commit implements the basic class structure for receiving emails,
all required config parameters, all necessary bindings depending on
which protocol the administrator has configured and updates the
documentation accordingly.

It also adds test-only dependencies to Greenmail and javax.mail. These
will be used to create integration tests.

It's the first change in a topic of changes to implement email ingestion
for Gerrit.

Change-Id: I0edec7ca2655fcd70284bb75ca8eb94ce2491d7a
2016-11-07 11:18:45 +01:00
David Ostrovsky
87f3fdbf67 Bump guava to 20.0
Change-Id: Ie34c4b8b301871090665173d21af55729740ad02
2016-11-07 09:28:54 +01:00
David Ostrovsky
0fc4f7a900 Rename ewah dependency to javaewah
This is a preparation change to support building JGit from development
tree.

Change-Id: I581a1632aad93eaf820fc2c608ea37d29286f392
2016-11-06 18:29:06 +01:00
David Ostrovsky
d7dc720738 Bump auto-value to 1.4-rc1
Among other this version fixed "Compile-time constant expression
overflows" bug, reported by Bazel 0.4.0. Other fixes and improvements
are here: [1].

This upgrade is needed to be able to support Bazel 0.4.0.

[1] https://github.com/google/auto/releases/tag/auto-value-1.4-rc1

Change-Id: I2e792bae1afa276efdf1580b6543fdc0cec6d45c
2016-11-03 23:23:19 +01:00
Han-Wen Nienhuys
246f928887 bazel: update bower packages.
Change-Id: I1672018089db8df90f52416f532436b387c242cb
2016-11-03 13:01:39 +01:00
David Ostrovsky
76eac6f3fc Bazel: Fix build
Iaab184501 renamed out to outs in genrule2, but missed to replace some
places.

Change-Id: I3e9673b95ab7e6ff8cd0feab42d5c7569297be54
2016-11-03 08:06:21 +01:00
Han-Wen Nienhuys
29cced5e29 bazel: remove 'out' attribute from genrule2, and use throughout.
This centralizes the OSX mktemp solution.

Change-Id: Iaab18450146b649245b36865bedc5d7b50d1aa07
2016-11-02 13:54:10 +01:00
David Pursehouse
34c0481f47 Merge branch 'stable-2.13'
* stable-2.13:
  Fix to reindex a change via SSH: get from DB/Notes instead of Lucene
  Update git submodules
  Fix Postgresql JDBC driver leaking memory
  Fix Schema_127 for mysql on case-sensitive FS
  Update git submodules

Change-Id: Ida6a895ccb8cab2c68bb0cdb83fe4d076f2b007c
2016-11-02 17:36:09 +09:00
Hector Oswaldo Caballero
fd6c8bf400 Fix Postgresql JDBC driver leaking memory
Older versions of Postgresql JDBC driver rely on finalize() methods in
order to avoid leaking unclosed database objects. Given finalize
methods are unpredictable (no guarantee about prompt execution, if at
all), in some high load environments this could lead to a memory leak
with millions of JDBC objects pending finalization.

Newer versions of the Postgresql JDBC driver removed the use of finalize
methods to avoid this kind of issues.

Bug: Issue 4848
Change-Id: Ia143f1df1d8e41686362fd76b9bc82e0046f9894
2016-11-01 13:45:51 -04:00
David Ostrovsky
c84bce4cae Bump GWT version to 2.8.0
Change-Id: I0dd10792a0c12adba3927c18dabc31875df3622f
2016-10-27 22:22:05 +02:00
David Pursehouse
5eaed62346 Allow to share guava definitions between buck and bazel builds
Move the definitions of GUAVA_VERSION and GUAVA_DOC_URL into a
separate .bzl file, and add GUAVA_BIN_SHA1. Modify the existing
GUAVA_VERSION file to include the new .bzl file.

This allows to reuse the same values in both the buck and bazel
builds, and when we update Guava we only need to modify one file.

Update the bazel build of the extension API to include the Guava
Javadoc URL in the javadoc rule.

Change-Id: I7895ceb761d609d79d3b80a271e6bd7425c17e2b
2016-10-26 15:46:27 +09:00