1211 Commits

Author SHA1 Message Date
Thomas Draebing
8ba0926df1 Do not use jsonevent-layout for error logs in JSON format
So far the net.logstash.log4j.jsonevent-layout package was used to
format the error logs to JSON. This format was not suitable for the
httpd- and sshd logs and thus was not used there. Also the format
provided by the dependency was not configurable, e.g. did not allow
to change the timestamp. This resulted in different timestamp formats
for the text- and the json-formatted error logs.

To be more flexible in the formatting of the json logs, this change
removes the dependency. It keeps however the ISO8601-formatted timestamp,
but adds the timezone offset and thus does not assume the UTC timezone.
In a followup change the timestamps of all logs will be adapted to the
same standard.

Change-Id: I3a2bdba5d4b25067d0324fb63438e2a6ec726c68
2020-03-06 16:23:46 +01:00
David Pursehouse
197894f2b0 Merge branch 'stable-3.1'
* stable-3.1:
  UrlFormatter: Fix Javadoc of getSettingsUrl()
  Add a separator between blame and the edit icon
  Remove target=_self from commentlinks
  Update .mailmap
  Update .gitreview file
  ReceiveCommits: Factor repeated "internal server error" text to a constant
  Update .mailmap
  Documentation: Add site-path arg to reindex command
  Isolate log4j dep
  gr-diff-builder: Remove unused function renderSection
  Update .mailmap
  Cancel deprecation of change identifiers
  FakeGroupAuditService: Make auditEvents final
  ErrorProne: Increase severity of MutableConstantField to ERROR
  ConfigUpdatedEvent: Use immutable type in field declaration
  gr-diff-processor: remove unused resolve value
  Add missing slf4j dependencies in BUILD file
  JGitMetricModule: fix WindowCache miss ration which wasn't reported
  Revert "JGitMetricModule: Replace anonymous Supplier instances with method references"
  Suppress generic logging on docker start for ElasticSearch container
  Replace deprecated OptionParser with ArgumentParser
  Documentation: Replace plugins list with home page

Change-Id: I93e54874d7bba26120e609b4ea81a7c41ee88deb
2020-03-02 08:12:22 +09:00
David Pursehouse
5979ce84e3 Merge branch 'stable-3.0' into stable-3.1
* stable-3.0:
  UrlFormatter: Fix Javadoc of getSettingsUrl()
  Add a separator between blame and the edit icon
  Remove target=_self from commentlinks
  Update .mailmap
  ReceiveCommits: Factor repeated "internal server error" text to a constant
  Update .mailmap
  Documentation: Add site-path arg to reindex command
  Isolate log4j dep
  Update .mailmap
  Cancel deprecation of change identifiers
  FakeGroupAuditService: Make auditEvents final
  ErrorProne: Increase severity of MutableConstantField to ERROR
  ConfigUpdatedEvent: Use immutable type in field declaration
  Add missing slf4j dependencies in BUILD file
  JGitMetricModule: fix WindowCache miss ration which wasn't reported
  Revert "JGitMetricModule: Replace anonymous Supplier instances with method references"
  Suppress generic logging on docker start for ElasticSearch container
  Replace deprecated OptionParser with ArgumentParser
  Documentation: Replace plugins list with home page

Change-Id: Idae7755cb887a8df60028a96fff0a01d5d637f8a
2020-03-01 17:21:02 +09:00
Marco Miller
6213e7c183 Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
  FakeGroupAuditService: Make auditEvents final
  ErrorProne: Increase severity of MutableConstantField to ERROR
  ConfigUpdatedEvent: Use immutable type in field declaration
  Add missing slf4j dependencies in BUILD file
  JGitMetricModule: fix WindowCache miss ration which wasn't reported
  Revert "JGitMetricModule: Replace anonymous Supplier instances with method references"
  Suppress generic logging on docker start for ElasticSearch container
  Replace deprecated OptionParser with ArgumentParser

Change-Id: I36a7ce5c043bd43d90fb415fcec67440db2b5c84
2020-02-26 16:31:07 -05:00
Tao Zhou
8e44f52f7c Fix ba-linkify on emails with url-like names
foo.com@test.com should be recognized as an email.

currently because url patterns are matched before email pattern,
so it will be recognized as two urls instead of one email.

As upstream for ba-linkify has not been updated for 10 years: https://github.com/cowboy/javascript-linkify

Will propose to fix it in local copy directly.

Change-Id: I1f33cd600885b759d2e2707fe97a72f4bc656248
2020-02-25 12:04:24 +00:00
Hamza Kaced
20fa6bd8b2 Add missing slf4j dependencies in BUILD file
slf4j dependencies were not included in the BUILD file (I43e6cf797cc)
which cause the Bazel build to fail when attempting to run the tests.

Change-Id: Ie5c8bbb80625453a066e29f92660da7b0e5c8674
2020-02-25 13:10:19 +09:00
Ben Rohlfs
7f77168c3d Update all font/woff files and add Open Sans font
Change-Id: If525fac6d7a09c7a380a4bddf88291fc5ec08a8e
2020-02-18 13:03:00 +01:00
Matthias Sohn
79bec412a1 Update JGit to 5.1.13.202002110435-r
JGit 5.1.13.202002110435-r adds
- new WindowCache metrics
- and enables using strong references to reference cache pages in the
WindowCache. Set core.packedGitUseStrongRefs = true to enable using
strong references to reference packfile pages cached in the WindowCache.
If this option is set Java gc can no longer flush the WindowCache to
free memory if the used heap comes close to the maximum heap size. On
the other hand this provides more predictable performance.

Change-Id: I895369a8596dfc5adce76c65202ecf37e6a8386d
2020-02-14 13:38:59 +01:00
David Pursehouse
701e6c0c60 Merge "Upgrade JGit to 5.3.7.202002110540-r" into stable-3.0 2020-02-14 10:38:02 +00:00
Dmitrii Filippov
d97c843ccf Cleanup unused bower components and rules
All unused bower components and rules are removed. Some rules
are not removed because they are used by plugins. We should keep them
until all core plugins get rid of bower components.

Change-Id: I6e6b5a3805fd68e7e438135c9b60e9d732cb8092
2020-02-12 15:42:46 +00:00
Dmitrii Filippov
fbdc89d307 Use node modules for polygerrit-ui release build
This change uses node modules to build polygerrit-ui release artifact.
Tests still use bower_components.

Change-Id: I3457931b0ff8edcb41250d1aa3518b8ea18a964e
2020-02-12 15:42:23 +00:00
Dmitrii Filippov
93e4b083af Update package.json files and licences
This change:
* adds dependencies to polygerrit-ui package.json files
  and defines licenses for polygerrit-ui/app dependencies.
* generates new licenses.txt files. Because bower
  components are still in use, licenses for js packages
  appear twice in .txt file. In the following change duplicated
  licenses are removed.
  This is the reason for the following warning:
    WARNING: ..id assigned to block already in use: ...
  Fixed in other change in the chain.

The packages from package.json are not used to build final
artifact (gerrit.war), so frontend still uses Polymer 2.

Change-Id: I7dc91a89640f607abc4e0c9e3577786663daa3de
2020-02-12 15:29:58 +00:00
David Pursehouse
2cf8c42e74 Merge branch 'stable-3.0' into stable-3.1
* stable-3.0:
  Update web-component-tester to 6.5.1
  Add support for Elasticsearch version 7.6.*
  Error Prone: Enable and fix ClassCanBeStatic
  Write upload-pack metrics to sshd log

Change-Id: I533d5ca030b608399cc56e7905c9c5b6e6a994bc
2020-02-12 18:31:22 +09:00
David Pursehouse
556a1a64ce Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
  Update web-component-tester to 6.5.1

Change-Id: I871f08e59dcfc0717888aa9f0ade82fc3edc851d
2020-02-12 17:29:58 +09:00
Tao Zhou
d6970e3244 Fix missing sinon lib by updating wct to 6.5.1
This reverts commit 48026defc8ae48e76f29a583544779f7295446a6.

And also add changes to update wct to 6.5.1 and rerun
"tools/js/bower2bazel.py" to update bower_archives

Change-Id: I0eb5c7c5e11fc16e17bd0f35576631d1e1794a2d
2020-02-12 07:50:46 +00:00
Tao Zhou
5a7a364ff2 Update web-component-tester to 6.5.1
This will fix the build failure as the sinon.js dependency issue
fixed in upstream (wct 6.5.1)

Change-Id: I871f08e59dcfc0717888aa9f0ade82fc3edc851d
2020-02-12 08:42:20 +01:00
David Pursehouse
e91d5828ba Upgrade JGit to 5.3.7.202002110540-r
JGit 5.3.7.202002110540-r adds
- new WindowCache metrics
- and enables using strong references to reference cache pages in the
WindowCache. Set core.packedGitUseStrongRefs = true to enable using
strong references to reference packfile pages cached in the WindowCache.
If this option is set Java gc can no longer flush the WindowCache to
free memory if the used heap comes close to the maximum heap size. On
the other hand this provides more predictable performance.

Documentation of core.packedGitUseStrongRefs is added in I895369a85,
which will reach stable-3.0 by merge later.

Change-Id: I8c080a16e25678dc6aeec9c21a6029965fb1ac5b
2020-02-12 09:25:20 +09:00
Tao Zhou
48026defc8 Fix missing sinon lib
As original sinon.js from bower (https://github.com/blittle/sinon.js/)
is not availble any more,
and official release of sinonjs/sinon doesn't support bower for v1.17.1,
we decided to import standalone js file from:
https://github.com/Polymer/sinon.js

Keep the name as `sinonjs` as thats required by wct:
https://github.com/Polymer/web-component-tester/blob/master/browser.js#L223

Bug: Issue 12304
Change-Id: Idc97ef4808be6ed30c7ed2e9c580d09b1338d4de
2020-02-10 14:24:06 +01:00
David Ostrovsky
f51a3e2594 Merge branch 'stable-3.1'
* stable-3.1:
  Acceptance BUILD: Fix plugin standalone test exec
  Bazel: Reduce size of gerrit-acceptance-framework artifact

Change-Id: I42dc463ee92f662ed6169c56670d1af2eb3c9c9f
2020-01-28 21:34:36 +01:00
Marco Miller
a3a5ac5fbc Acceptance BUILD: Fix plugin standalone test exec
Before this change, the hereby moved package classes were not found,
while executing plugin tests in bazel standalone mode.

Bug: Issue 12218
Change-Id: I6143263b8c1f34e30d90191a62a894c1a4658114
2020-01-26 10:12:42 -05:00
David Pursehouse
88afbd2092 Merge branch 'stable-3.1'
* stable-3.1:
  Remove Powermock again
  Bazel: Mark truth libraries as test only
  Bump Bazel version to 2.0.0

Change-Id: I4084f22c5f7225af55b2a99decacc034dd1a1d8e
2020-01-20 10:52:12 +09:00
David Pursehouse
1a20152774 Merge branch 'stable-3.0' into stable-3.1
* stable-3.0:
  Bazel: Mark truth libraries as test only
  Bump Bazel version to 2.0.0

Change-Id: I48e486409411f9b131277dcc58ff1b5e4e539062
2020-01-20 10:51:34 +09:00
David Pursehouse
b330b9fed9 Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
  Bazel: Mark truth libraries as test only
  Bump Bazel version to 2.0.0

Change-Id: I00beceb92d9a6bcb1a9826d348d01dd5cea42237
2020-01-20 10:51:04 +09:00
David Pursehouse
803ea9fecb Remove Powermock again
Powermock was removed by change Iafcc40d2f but was unintentionally
added back when change Ib0dd147bd was merged up from stable-2.16
(where it still exists) to later branches.

Change-Id: I1c17212208d122b7212647e84894bd5b6f69e75f
2020-01-20 10:47:54 +09:00
David Ostrovsky
e9068d2c8c Bazel: Mark truth libraries as test only
Change-Id: I01bb40ac64121e860955b6f23799796ee4c5660f
2020-01-20 08:14:31 +09:00
Marco Miller
61c27c969b Merge "Upgrade guava to 28.2-jre" 2020-01-14 01:09:02 +00:00
Marco Miller
2d310638fa Merge branch 'stable-3.1'
* stable-3.1:
  Fix eclipse project generation

Change-Id: I9913da261587bbb9f1a04cd0d6e3a5fde6eb7441
2020-01-13 16:10:30 -05:00
Marco Miller
e33b61bf5e Merge branch 'stable-3.0' into stable-3.1
* stable-3.0:
  Fix eclipse project generation

Change-Id: I2af3d46bfa75145677d65b272eb5e31f36e7f599
2020-01-13 15:56:38 -05:00
Marco Miller
0aed79e983 Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
  Fix eclipse project generation

Change-Id: If7ed1c9aea5138ade7486182b2204f9d333ce85a
2020-01-13 15:47:03 -05:00
David Ostrovsky
41eae482e8 Fix eclipse project generation
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
2020-01-10 21:38:35 +01:00
David Pursehouse
a767f08db3 Merge branch 'stable-3.1'
* stable-3.1:
  Update highlight.js
  Add "Page ..." next to back and forward arrows
  Fix the size of the commit message box
  Bazel: Fix issues flagged by buildifier
  Document that gerrit supports JDK 11
  lib/lucene: merge jars using a java_binary rule

Change-Id: I9807d05de588e8437310ade18e2e5e9c84d2fe27
2020-01-10 14:20:23 +09:00
David Pursehouse
6b8318d247 Merge branch 'stable-3.0' into stable-3.1
* stable-3.0:
  Update highlight.js
  Bazel: Fix issues flagged by buildifier
  Document that gerrit supports JDK 11
  lib/lucene: merge jars using a java_binary rule

Change-Id: Ibac37e9cafd7dfbd1e565f9492a90733edd38f26
2020-01-10 14:17:35 +09:00
David Pursehouse
bf64e2d354 Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
  Update highlight.js
  Bazel: Fix issues flagged by buildifier
  Document that gerrit supports JDK 11
  lib/lucene: merge jars using a java_binary rule

Adjust Documentation/licenses.txt to reflect new name of merged Lucene
library due to "lib/lucene: merge jars using a java_binary rule".

Change-Id: Iae42e901c8756e46effd1302df9449e37c52f262
2020-01-10 10:37:45 +09:00
Paladox none
32884030f0 Update highlight.js
Fixes we want:
* fix(makefile) fix double relevance for assignments
* (xml) expand and improve document type highlighting
* fix(kotlin): fix termination of """ string literals 
* (cpp) Add additional keywords
* Backslash is not used to escape in strings in standard SQL
* (javascript) fix jsx self-closing tag issues
* enh(ini) support arrays and much cleaner grammar
* (javascript) support jsx fragments

Updates to commit: 42f1df4d391126e9135d7c7a6e27931ca85c709e

Change-Id: I6fd8cc6b6527e73f8502d65caff69368c9f29942
2020-01-09 16:10:35 +00:00
Han-Wen Nienhuys
1fdd3f7b27 lib/lucene: merge jars using a java_binary rule
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
2020-01-08 23:06:40 +01:00
Marco Miller
fe0a634336 Upgrade guava to 28.2-jre
Change-Id: Ia5876ce091358a90328e221cf633259cad6738b6
2019-12-29 18:03:20 +00:00
David Ostrovsky
dcd81d68f5 Bazel: Fix tests execution on Java 11
To support tests execution on Java 11, without using Java 11 toolchain
additional parameters must be passed. The use case is building on host
Java 11. This is needed to bump host Java version to Java 11 on Gerrit
CI.

Test Plan:

1. Install Java 11 (only)

  $ java -fullversion
  openjdk full version "11.0.5+10-post-Debian-1deb10u1"

2. Execute tests and confirm that all tests are passing

  $ bazelisk test //...

Change-Id: I97c244052f353eb61053a5f4f36a5ee646b8be9c
2019-12-13 21:24:46 -08:00
David Pursehouse
0f15c89195 Merge branch 'stable-3.0' into stable-3.1
* stable-3.0:
  Switch PatchListCache to using legacy cache backend
  Replace guava caches with caffeine

Change-Id: If7ac2b18f61ed95dd365ab2690280003ff83e838
2019-12-04 19:21:47 +09:00
David Ostrovsky
b3e8cb0d25 Merge "Bazel: Widen visibility of javax-annotation rule to plugins" 2019-12-04 10:17:54 +00:00
David Pursehouse
791d19e0f4 Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
  Switch PatchListCache to using legacy cache backend
  Replace guava caches with caffeine

Add caffeine and caffeine-guava to Documentation/licenses.txt
which did not exist on earlier branches.

Change-Id: I40fb2798a8b6eda2e92e4409c1e57042a8e59ef4
2019-12-04 18:26:21 +09:00
David Ostrovsky
06c86046fe Replace guava caches with caffeine
Replacing Guava caches with Caffeine reduces the chances of having the
deadlocks and improves the cache performance.

This was already attempted in: I8d2b17a94d0, but got reverted in:
If65560b4a9b due to recursion in PatchListLoader. This recursion issue
is present on current master. While this change replaces all caches
with Caffeine backend, the follow-up change in this series will switch
back to using Guava backend for PatchListCache implementation.

For seamless integration, the caffeine-guava adapter library is used.
Given that the final artifact for the adapter is also called guava,
there is only the version number that differentiates that artifact from
the guava library itself so that we have a danger for naming collision.
To avoid potential naming collision risk, rename the library name to
caffeine-guava.jar during the fetch from Maven Central.

Alternatives considered is not to use the caffeine-guava adapter
library. But then the Cache and LoadingCache classes and friends would
change the package name from com.google.common.cache package to
com.github.benmanes.caffeine.cache package and this change would also
affect some gerrit plugins and thus considered to be a quite intrusive
change.  Still we can consider to do this change in one of the future
gerrit releases.

Bug: Issue 7645
Bug: Issue 11484
Change-Id: I6af4c15d6c15f438becd62409b7d233c309be8de
(cherry picked from commit 0050a9b5f61da67a9f33fda0bb170f8b1df6080a)
2019-12-04 01:19:23 +01:00
David Pursehouse
8705396bf2 Merge branch 'stable-3.1'
* stable-3.1:
  Update paper-styles to a6c207e6eee3402fd7a6550e6f9c387ca22ec4c4
  Update 'font-roboto' to 'font-roboto-local' in license files
  Update paper-styles to dd0b13e186b9690d5e74a93f6e51e0835ea60495
  Change on-tap to on-click for iron-dropdown
  Fix reporting for flaky builds in Jenkinsfile

Change-Id: I9a319fbe4a7d6995c3338c861f487358703eb9f9
2019-11-26 13:14:34 +09:00
Paladox none
6336802f35 Update paper-styles to a6c207e6eee3402fd7a6550e6f9c387ca22ec4c4
This includes a fix to stop using google fonts external resource
and rather use local fonts.

Bug: Issue 11993
Change-Id: I731e54ca872a2430461bc4de7d3c2dfe6d56062e
2019-11-26 10:37:58 +09:00
David Pursehouse
975aa701c6 Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
  Update paper-styles to dd0b13e186b9690d5e74a93f6e51e0835ea60495
  Fix reporting for flaky builds in Jenkinsfile

Change-Id: Ibcf36ab82b85684baf8c442eddc81fee66320341
2019-11-26 10:18:01 +09:00
Paladox none
c12ed4a869 Update paper-styles to dd0b13e186b9690d5e74a93f6e51e0835ea60495
This includes a fix to stop using google fonts external resource
and rather use local fonts.

Bug: Issue 11993
Change-Id: I731e54ca872a2430461bc4de7d3c2dfe6d56062e
2019-11-25 16:47:30 +00:00
David Ostrovsky
b98d621969 Bazel: Widen visibility of javax-annotation rule to plugins
Some of the plugins, most notably checks plugin, may want to use
java_doc Starlark rule and for that access to //lib:javax-annotation
is required.

Change-Id: Iddc907138f71fded02c76136f34e17070dc64d18
2019-11-20 12:21:02 -08:00
David Ostrovsky
0050a9b5f6 Replace guava caches with caffeine
Replacing Guava caches with Caffeine reduces the chances of having the
deadlocks and improves the cache performance.

This was already attempted in: I8d2b17a94d0, but got reverted in:
If65560b4a9b due to recursion in PatchListLoader. This recursion issue
is present on current master. While this change replaces all caches
with Caffeine backend, the follow-up change in this series will switch
back to using Guava backend for PatchListCache implementation.

For seamless integration, the caffeine-guava adapter library is used.
Given that the final artifact for the adapter is also called guava,
there is only the version number that differentiates that artifact from
the guava library itself so that we have a danger for naming collision.
To avoid potential naming collision risk, rename the library name to
caffeine-guava.jar during the fetch from Maven Central.

Alternatives considered is not to use the caffeine-guava adapter
library. But then the Cache and LoadingCache classes and friends would
change the package name from com.google.common.cache package to
com.github.benmanes.caffeine.cache package and this change would also
affect some gerrit plugins and thus considered to be a quite intrusive
change.  Still we can consider to do this change in one of the future
gerrit releases.

Bug: Issue 7645
Bug: Issue 11484
Change-Id: I6af4c15d6c15f438becd62409b7d233c309be8de
2019-11-15 07:26:46 -08:00
David Pursehouse
69db64291f Merge branch 'stable-3.1'
* stable-3.1:
  Set version to 3.1.1-SNAPSHOT
  Set version to 3.1.0
  Upgrade JGit to latest master
  Upgrade gitiles-servlet and blame-cache to 0.3-6
  Add sshd-common to lib/nongoogle_test.sh
  Increase 'execution.defaultThreadPoolSize' default and min to 2
  Upgrade gitiles-servlet and blame-cache to 0.2-11
  Fix formatting of submission IDs
  LazyPostReceiveHookChain: Simplify check for pack size
  Update highlight.js
  ChangeNotesParser: Skip parsing meta data of deleted patch sets
  Add a --header-box-shadow theme css variable
  Don't allow "show 2 more" reviewers
  Bazel: Expedite the LC process
  Update Jgit to latest master revision
  Move tooltip to below the button for change detail actions
  LazyPostReceiveHookChain: Catch IllegalStateException on ReceivePack.getPackSize

Change-Id: I8e118de48a692ef60171d4f4d26f69bafb330c70
2019-11-15 00:27:29 -08:00
David Pursehouse
dea7102715 Add sshd-common to lib/nongoogle_test.sh
Change-Id: Idb3c46afd23ccce90b5bab39d1a9067f58fc1891
2019-11-14 15:04:33 -08:00
Nasser Grainawi
3b145b7c5c Replace Jetty Continuation with AsyncContext
Continuation is deprecated in Jetty 9.4 and removed in Jetty 10. Migrate
ProjectQoSFilter to use javax.servlet.AsyncContext instead.

Change-Id: I398fca0f75b675ad683a6d4c572ffb844c23e364
2019-11-14 14:11:41 -08:00