* stable-2.14:
Fix java.lang.ArrayIndexOutOfBoundsException when checking for parent
ProjectTagsScreen: Fix title of revision field for new tag
Fix cyclic dependency when using site_path from system_config table
Change-Id: I1f4ed09818885284b9686d38705a20cf21cfce23
The starting mode where site_path is not specified (as a system property)
and Gerrit first connects to the database using the ReviewDb JNDI
property from the servlet container was broken since I60f585f5ef due to
a cyclic dependency in Guice bindings.
Make sure to inject the non-wrapped SchemaFactory<ReviewDb> in the
SitePathFromSystemConfigProvider.
Change-Id: Ie283a5498e981642a82aac1fcb8b33b0c881fc84
Online reindex recalculates the status of all the changes
by invoking the Prolog rules associated.
That is good in general but breaks systematically when the
rules depend on plugins for their accurate evaluation.
Noteworthy example is the use of singleusergroup plugin in
conjunction with user-specific ACLs for labels.
Another even more severe example is the use of custom
Prolog predicates in rules.pl provided by the owners' plugin.
By swapping the order of registration of the Plugins module
and the Lucene Index module, the lifecycle listener will then
load first the plugins and only afterward activate the online
reindexer.
Bug: Issue 6472
Change-Id: I87da6ac632d08aa915a57a01435cfa415b7de2f9
The registration of PluginModule and PluginRestApiModule needs to be
decoupled because they are conceptually separate, even if one (PluginModule)
needs to happen before the other (PluginRestApiModule).
This is a pre-requisite for the next change I87da6ac6 where the PluginModule
registration needs to be moved around without necessarily having an impact
on the PluginRestApiModule.
Change-Id: I80fee34e5bda5afb480c8d103e6e83b8ae11c8eb
The API includes some new classes since 2.14 and we need to be able
to build snapshot artifacts to test plugins that use the new classes.
Change-Id: Ifad31b93e5b5068c0d6952582f6882edc252e227
FileInputStream and FileOutputStream rely on finalize() method to ensure
resources are closed. This implies they are added to the finalizer queue
which causes additional work for the JVM GC process.
This is an open bug on the OpenJDK [1] and the recommended workaround is
to use the Files.newInputStream and Files.newOutputStream static methods
instead.
[1] https://bugs.openjdk.java.net/browse/JDK-8080225
Change-Id: I3cef6fcf198dde2be7cd15bded8d2fa247177654
Move the binding out of GerritGlobalModule so it's part of the daemons,
making it easier to swap to a different PermissionBackend.
Expose DefaultPermissionBackend class as public so another backend
could wrap and delegate to DefaultPermissionBackend by accepting it
as an argument to its constructor.
Change-Id: I01f10d8a65d8942e73354bcf055c26b17d2606f9
* stable-2.14:
Move systemctl files to /init/ rather than /systemd/
SitePathInitializer: Fix destination file name for gerrit.socket
Clarify documentation for accountPatchReviewDb.url
Add the new gerrit systemctl file to init
Remove unneeded output in MigrateAccountPatchReviewDb
ES: Implement online reindex for ElasticSearch
JdbcAccountPatchReviewStore: Fix copyright year
Fix documentation nits in pgm-MigrateAccountPatchReviewDb.txt
Support Jdbc implementation of AccountPatchReviewStore
ES: Temporarily disable server discovery
Change-Id: I1034869bc6146db929f6242610c9eb13a7b092f7
Provide in gerrit core support for alternative database backends
for AccountPatchReview store.
H2 was used for storing AccountPatchReview. This can become
problematic in large installation since embedded H2 cannot execute
concurrent requests even to the same database. The options related to
multi-thread in H2 are:
- MULTI_THREADED: a long running query blocks the ones in other
threads [1].
- MVCC: This is not production-ready yet, since it is not fully
tested [2].
AccountPatchReviewStore is an extension and a plugin could
implement a jdbc store but this would result in duplicated code
with core H2 implementation. Since core H2 implementation was
almost already compliant to jdbc standard, it's easy to make
jdbc url configurable in gerrit config and make the core support
other database than H2.
One could extend the H2 implementation in plugin, however the
changes on the supper class could lead to breaking plugin
implementation.
[1] http://www.h2database.com/html/features.html#multiple_connections
[2] http://www.h2database.com/html/advanced.html#mvcc
Change-Id: Ie61ac63a72cab71bd907886a794541cb3dea291e
* stable-2.14:
Add new maintainers to developers section in pom.xml files
Update Version to 2.14-rc0
Change-Id: Ib620c5f49ec5dee1a838c082f74b785689edba71
* stable-2.14:
PolyGerrit: Bug fix for iOS 10.3 and mac 10.12.4
Replace AbstractFileKeyPairProvider with FileKeyPairProvider in log4j config
Change-Id: Ic3c681c37ee5521e43008314324da4d6259b8d90
The AbstractFileKeyPairProvider class was replaced with FileKeyPairProvider
in the upgrade from sshd 1.2 to 1.4.
Change-Id: I711582ea01235849f40991fa7aefd13673aa2277
* stable-2.13:
Prevent circular module dependency when running in external container
Update Documentation of Auto Site Initialization
Change-Id: Ibcbaf7e7b5af58dca5c9b32d068acb81d1fd9781
Commit 220a3f5 introduced circular dependency between the database
module and NotesMigration (impl. class ConfigNotesMigration).
Having the site path being stored in the database was broken by above
change. The class Daemon solves this by explicitly setting the site
path and adds a SitePath module before starting everything.
This patch makes it possible again to run the gerrit war in an external
Servlet container, but you need to set the System property
"-Dgerrit.site_path=/path/to/gerrit" to make it work.
The site path stored in the database became practically obsolete with the
NotesMigration change mentioned above.
Change-Id: Id735fbf928dda186e659792c84d4e675c893a29a
Reformatting the code with google-java-format tool in change Id5f3c6de9
resulted in wrapped lines being unwrapped to the new 100 columns limit.
In cases where the wrapped line was wrapped on a string concatenation,
the resulting long line now includes redundant concatenations. See the
upstream issue [1] for an example of this.
Squash the redundant concatenations with:
git ls-files | grep java$ | xargs sed -i '' 's/" + "//g'
(note: this also resulted in a couple of unwanted changes; those are
manually undone.)
[1] https://github.com/google/google-java-format/issues/122
Change-Id: I7348413ae460c8c7a0b0c72dab0a1ae7275a2ec3
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>
This allows to do checks on Gerrit startup and abort the Gerrit startup
if issues are found. E.g. this allows us to do validation on the Gerrit
config, which is needed by a follow-up change.
The startup checks are done after all lifecycle listeners have been
invoked so that logging is already available and the reason for a
failing startup can be written to the error log.
All implementations of StartupCheck should be bound in
StartupChecks.Module.
Change-Id: I941dad2c926130a1f9c5a1a363f7e1eff0dab304
Signed-off-by: Edwin Kempin <ekempin@google.com>
SSH command registration was extended so that command gets registered
only in case when plugin is configured in gerrit.config.
Change-Id: Iffaf00775bdf1242e1fbe1dea15e5ce0bf912079
Signed-off-by: Jacek Centkowski <geminica.programs@gmail.com>
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
Gerrit already has "pluggable" features that need to be installed
at the early stages of the bootstrap phase and cannot be "unplugged"
as plugins do.
Attendees at the recent hackathon in Mountain View decided to
call this new entities "LibModules", and configure them in the
gerrit.config as follows:
[gerrit]
installModule = com.googlesource.gerrit.libmodule.MyModule
installModule = com.example.abc.OurSpecialSauceModule
Change-Id: Id8bf1a2e88b14c8e9125f20cb10a041d47799100
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
bazel: generate the workspace version from the volatile status.
To work across bazel 0.3.1 and 0.3.2, we should grep both volatile and
stable status files for the magic version string.
Change-Id: I48361374a8d9cda1e7a5b5db4e147bc49b4452a3