System logs file appenders were created with an info threshold which
was preventing debug and trace log statement to be printed in the
files. File appenders should not have a threshold. Instead, the root
logger should have a proper level (i.e. info) so if a specific logger is
using a finer grain level (e.g. debug, trace), the log statements won't
be filtered out by the appender.
Set the root category to info and no longer set the file appender
threshold when creating system logs.
Change-Id: I747bef1f5dcb99784ba91dba6d29cf1fba582b62
This allows Shawn to skip this module in his build so that
administrator users on his servers cannot invoke them.
Change-Id: I9c852d3f22b820f24f3fcab8481feb1a63f2778c
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
The (global) schedule can be configured in "gerrit.config" by specifying
startTime and interval. The "startTime" can be specified in section "gc"
in the following format:
startTime = <hours>:<minutes>
or
startTime = <day of week> <hours>:<minutes>
The "interval" can be given using the usual time unit suffixes.
Change-Id: I16e92c353d0fa05c020fc18da4ed1f5825ad677c
* stable-2.9:
Bash: Deploy plugin archetypes to Maven Central
Fix documentation of how to publish artifacts to Maven Central
Buck: Deploy plugin artifacts to Maven Central
Conflicts:
.gitignore
Change-Id: I72aca7e13b55fbbe34bbf00d799a8a05dc96a955
Switch deploying Gerrit extension and plugin API from Google storage
bucket to Maven Central.
To simplify the troubleshooting new trace option was added to
underlying python script. When environment variable VERBOSE=1
is set, then the mvn command is printed to stderr:
VERBOSE=1 buck build api_deploy_oss
Change-Id: I9ebe44ec8aca91aa6b5514f561209e7c50377927
java_library() now accepts provided_deps argument which replaces
our custom use of java_library2().
This change replaces compile_deps with provided_deps parameter in
gerrit_{plugin,extension} rules. Plugins that are using it must be
updated.
Change-Id: I16d53793da567c958267f91ca203e9cae6c4d02f
Plugins can replace the existing implementation with the statement:
DynamicItem.bind(binder(), WebSession.class).to(...);
in a module designated as a "<Gerrit-HttpModule>" in the manifest.
Just the Cache implementation used for web sessions can be changed
by binding to a subclass of the now abstract CacheBasedWebSession
which supplies the Cache in the superclass constructor.
This is a step towards solving web session issues with multi-master.
Change-Id: I255661a62cfcbfe07646cb90005764061d618f3d
In new buck version `$SRCDIR` is not necessary any more. Buck now
always runs genrule relative to the $SRCDIR link forest.
Change-Id: Iee88bb575c7baa62bc087527927be5347a7f8f95
Use the system property 'gerrit.install_plugins' to control which
of the packaged plugins will be installed during auto site init
in a servlet container.
When 'gerrit.install_plugins' property is not defined then all packaged
plugins will be installed. If it is present then it is parsed as a
comma separated list of plugin names to install. Defining an empty
string as the property value means that no plugin will be installed.
Change-Id: I52881c9677bc9cc1e51c46c2c2ce4558c79b9a3e
When Gerrit is deployed in a servlet container and the system property
'gerrit.init' is defined then, besides the automatic site
initialization, also all packaged plugins (under WEB-INF/plugins) will
be installed.
Change-Id: Ia1e50d88ba63e96fc70717f854c87c7409f0c618
This fix is mostly useful for those developers who want to deploy/test
Gerrit in Tomcat, use the embedded H2 database and have automatic init
on deployment.
The init of a new site on startup (from WebAppInitializer) was failing
when the site was provided via the -Dgerrit.site_path property because
we assumed that the database initialization has to be skipped always
when running in a servlet container. However, this is only true for
the case when using the -Dgerrit.init_path. When Gerrit site is provided
via -Dgerrit.site_path then we have to perform database initialization.
Change-Id: Id577f391cd888bd71ec8502e8ad2f621cbc3fd80
If a command should only be used on a server in master mode, but not
slave mode, it should be bound in both MasterCommandModule and
SlaveCommandModule, we have to remember to add it separately on each
of the commands list, the maintenance work is tedious.
Refactor the way of binding ssh commands. Add a field 'runsWith' to
CommandMetaData to mark a given ssh command to run on MASTER mode or
MASTER_OR_SLAVE mode. Remove SlaveCommandModule and MasterCommandModule,
and use only DefaultCommandModule.
This reverts commit 84bcead690240e07e0314b165fb8d6dc95d2c5e7.
Change-Id: Ia4908267b135be04ff9c8a9470a243a6c8d665a8
Require the secondary index to be enabled in Gerrit 2.9. Unless
configured differently, Lucene is used for the secondary index.
Change-Id: I3d2d804170835d69ffbfef586ddc3873ea3cd1c8
The mergeability flag of a change is immediately updated when the
change is created or when a new patch set is uploaded.
When a branch is updated the mergeability flag is asynchronously
updated for all open changes that are destined for that branch.
This way the mergeability flag is always up to date. With this the
(new) change screen doesn't need to explicitly trigger the update of
this flag whenever the screen is loaded. The corresponding call is
removed.
In a follow-up change we can now display the mergeability flag also in
the change tables and user dashboards which wouldn't make sense if the
displayed information is outdated.
It is important to update the mergeability flag on a branch update in
the background since the computation and even the check whether the
mergeability flag needs to be recomputed is expensive.
Change-Id: Id20e567e5c5d5b3d851ca5cda9bde01ac01c9967
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Cut down on a bunch of one-offs of install(new *Module() {...}) by
choosing a more appropriate base module class. This doesn't solve all
such cases, for example RpcServletModule must still inherit from
ServletModule, but it does clean up some code. (And who knows, fewer
modules may even mean faster startup time.)
Change-Id: Ie1aed05d0a64f7f11b121c9a637bb30d80e9a595
With new Mina project release two backends are supported Mina & NIO2. Expose
new NIO2 backend through new configuration option while preserving the Mina
backend to be default.
Remove the fake to turn off closing idle connections by using the highest
timeout allowed by Apache SSD (~24 days). That special treatment is not
needed any more.
Restrict `sshd.tcpKeepAlive` configuration option to be used only for Mina
backend.
Remove `sshd.reuseAddress` (it is per default true) as there is no obvious
way how to set it.
SSHD 0.9.0 incorrectly sends "Authenticated with..." message:
davido@wizball:>ssh gerrit cookbook say-hello Dude
Authenticated with partial success.
Hello Dude!
That bug is tracked under [1]. With that patch applied the problem with
"Authenticated with partial success." is solved. Gerrit's Maven repository
contains 0.9.0.201311081 which is 0.9.0 with [2] cherry-picked on top.
[1] https://issues.apache.org/jira/browse/SSHD-254
[2] https://github.com/apache/mina-sshd/pull/2
Bug: issue 2003
Change-Id: Ic352d7e6a9e6f8ab4122b2667ead24ac3d73f68a
This allows the tests to run faster, with lower system overheads.
The new @UseLocalDisk annotation must be added to any test method
that wants the classical init and daemon testing strategy.
A new sshd.requestLog configuration variable is introduced to
permit tests to disable the SSH command log.
Timing for `buck test --all` on my Linux desktop:
before 3m37.129s
after 2m18.789s
Change-Id: I18c07ef2d913f6abbb3925b3e7d3df5d28668497
(cherry picked from commit 318bfcae5cdf457893083e08aa550ab3d4335393)
This supports automatic site initialization on Gerrit server startup
when Gerrit runs in a servlet container. Both creation of a new site
and upgrade of an existing site are supported.
This feature may be useful for such setups where Gerrit admins don't
have direct access to the database and the file system of the server
where Gerrit should be deployed and, therefore, cannot perform the
init from their local machine prior to deploying Gerrit on such a
server. It may also make deployment and testing in a local servlet
container faster to setup as the init step could be skipped.
The site initialization will be performed only if the 'gerrit.init'
system property exists (the value of the property is not, used only the
existence of the property matters).
If the 'gerrit.site_path' system property is defined then the init is
run for that site. The database connectivity, in that case, is defined
in the etc/gerrit.config.
If 'gerrit.site_path' is not defined then Gerrit will try to find an
existing site by looking into the system_config table in the database
defined via the 'jdbc/ReviewDb' JNDI property. If system_config table
exists then the site_path from that table is used for initialization.
Database connectivity is defined by the jdbc/ReviewDb JNDI property.
Finally, if neither 'gerrit.site_path' property nor the system_config
table exists, the 'gerrit.init_path' system property, if defined, will
be used to determine the site path. Database connectivity, also for this
case,is defined by the jdbc/ReviewDb JNDI property.
Example 1:
Prepare Tomcat so that a site is initialized at a given path using
the H2 database (if the site doesn't exist yet) or using whatever
database is defined in the etc/gerrit.config of that site:
$ export CATALINA_OPTS='-Dgerrit.init -Dgerrit.site_path=/path/to/site'
$ catalina.sh start
Example 2:
Prepare Tomcat so that an existing site with the path defined in the
system_config table is initialized (upgraded) on Gerrit startup. The
assumption is that the jdbc/ReviewDb JNDI property is defined in
Tomcat:
$ export CATALINA_OPTS='-Dgerrit.init'
$ catalina.sh start
Example 3:
Assuming the database schema doesn't exist in the database defined
via the jdbc/ReviewDb JNDI property, initialize a new site using that
database and a given path:
$ export CATALINA_OPTS='-Dgerrit.init -Dgerrit.init_path=/path/to/site'
$ catalina.sh start
Change-Id: Ic3e8c993087d2fbb38e14479a539dc62495ad908
Command-line programs that don't start a Gerrit daemon may want to
load plugins using this module, but don't need the additional
dependencies brought in by being a RestApiModule.
Change-Id: I4524ba7e04112101cd3a890e171658ad037ef1ee
Asciidoctor doesn't support the conf file, so we remove it, do the macro
replacing ourselves, and put all the attributes into the command line
parameters.
Change-Id: I21b49e5a2d75ff0f9b52f26fccaae42fcbaa0837
The static GuiceFilter breaks when a plugin loads and configures
its own web environment. Follow the pattern used by JettyServer
to initialize and load GuiceFilter in a non-static way, allowing
Gerrit to always have its own filter stack during any request.
Bug: issue 1966
Change-Id: I864f3badc4ec90154a276d35e6a5a3fa75058933
Force relative paths by passing the Prolog compiler only a relative
name from within $SRCDIR. This avoids picking up the user's $HOME
path as part of the generated class file names, and prevents build
failures on filesystems where individual path components are limited
to 256 bytes.
Change-Id: I43f2a93daf857413401f4e1aeb24b9b2a8c741fe
Eventually this will fully support all account information, similar
to GroupBackend. For now lets start by defining a simple base class
that can supply name, email and avatar URLs to an AccountInfo for
the REST API. Bind this in the Daemon and web application code so
its at least partially pluggable at the static Guice injector level.
Change-Id: I6e1b55fd46f3e99a982f7bd523f3e9d91b637b0d
This saves about 70ms when running targets like
//gerrit-gwtui:ui_chrome that reference a JAR in
gerrit-common but do not need the Version file.
Change-Id: Iab7377f3c5e1ce82cc3dc3ddcb3b1e4f9f12a8b7
Latest version of buck is faster than the prior version used by
Gerrit. No-op updates when loading a debug version of the UI now take
only 1.804s on my laptop (previously 7s) and a draft UI compile is
only 24.659s (previously 39s).
The slow acceptance tests must now be excluded with `--exclude slow`.
Buck changed the meaning of the -e option to be --emulator, which is
unfortunately useful only for Android application developers.
genrule() now needs to use $(exe) to reference the binary to run,
offers $(location) to make it easier to find files in the build tree.
The empty srcs array is no longer required for genrule(). Buck has
determined it is sufficiently powerful with $(location) and deps that
requiring srcs is unnecessary.
Supporting .src.zip files in the srcs array of java_library() means
Gerrit no longer needs to run a separate genrule() to extract files
produced by ANTLR, or call javac inside of the BuckPrologCompiler
support glue.
Change-Id: Ib03042921a081b867a7aad0423bd45523e42917a
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
For the Reindex command, use a new threadpool defaulting to the number
of available processors, under the assumption that the bulk of
indexing time is in CPU-intensive work like tree diffing. Modify
ChangeIndexer to return ListenableFutures so we can bound the size of
the work queue.
For the server, default to using the default work queue, but make this
configurable as index.threads to use a dedicated threadpool, with
non-positive values indicating the default.
Because we now have more non-Lucene-specific Guice logic, split that
out into its own module.
Change-Id: I55181e556a2d43b81c9032f53b74b690342ab62b
Add a ChangeIndex interface and an implementation based on Apache
Lucene[1] to provide a secondary index, indexing things we won't or
can't index in the database.
As an example, index the list of modified files in the most recent
patch set of each change. Provide an EqualsFilePredicate for searching
on exact filenames[2], and teach the query builder to rewrite such
predicates as ChangeDataSources returning results from the index.
As this feature is still experimental but we want to avoid prolonged
feature branch development, protect it with an undocumented
index.enabled boolean in gerrit.config.
[1] http://lucene.apache.org/core/
[2] Uses the "file:" operator the same as RegexFilePredicate, but does
not support regular expressions in the search context.
Change-Id: Ie14ebe062d991eb9626f7b5d78b2d193c1bcb33f
The Maven build does not work since the introduction of CodeMirror.
Remove the build until to prevent people from trying to use a broken
build process. If buck is rejected this commit will be reverted, and
we will attempt to fix the Maven build to include CodeMirror. If buck
is accepted, we just saved time by avoiding a messy Maven change.
Change-Id: I147d8d1741d52f59de1d2ddce8e5e82583990c14