* changes:
Buck: Rename gwtxml to gwt_xml in gwt_module()
Buck: Omit default values to gwt_binary() rule
Buck: Make gwt_module() rule more pythonic
Buck: Merge deps and compile_deps parameters in gwt_module() rule
Update Buck and use gwt_binary()
* stable-2.9:
Link to solved issues from 2.9 release notes
Reindex: Include exception cause when dying
Fix the request wrapper for http requests served from plugins
Fix a possibility to overcome BLOCK permission
Add asciidoc build back in the Documentation folder
Change CopyableLabel to hide onKeyUp
Conflicts:
gerrit-server/src/main/java/com/google/gerrit/server/project/PermissionCollection.java
Change-Id: I1ebcc44873eb12acd80b4a0a98d22a73c69a886c
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
176b801295fbe616689390f8ff4c11b18d1884fc added PluginData class but
missed to switch the code to use the new class.
Change-Id: Iee6665cd4643ad9251e8feadc31894212bd5ee4c
Jetty by default provides set of MBeans that can be registered in JMX.
This patch adds new configuration option called httpd.registerMBeans, by
default set to false, to control this behavior.
Change-Id: I3771ed3bb755240d7d90e9f1f1d7e7f84ff33ce3
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
This change fixes ephemeral port assignment for HTTP and SSH daemons.
Current implementation is broken: it assigns a random port in GerritServer,
closes the socket and effectively freeing it for the kernel to recycle to
another thread, and store that port in gerrit.config file for reuse. Some
time later in HTTP and SSH daemons the port number get read from the config
file and the ports are bound. The problem is, that during this "think time"
another test got the same port assigned and bind attempt is failing with:
Caused by: java.net.BindException: Address already in use
To rectify it, set port to 0 in gerrit.config for both HTTP and SSH daemons
and let the daemons to do the ephemeral port assignments. In SSH and HTTP
daemons this special case is recognized and the assigned ports are written
back to gerrit.config to pass to the test harness side.
Change-Id: Ib4971b200d6dc86268674398fe590137ae35b6f3
This change fixes ephemeral port assignment for HTTP and SSH daemons.
Current implementation is broken: it assigns a random port in GerritServer,
closes the socket and effectively freeing it for the kernel to recycle to
another thread, and store that port in gerrit.config file for reuse. Some
time later in HTTP and SSH daemons the port number get read from the config
file and the ports are bound. The problem is, that during this "think time"
another test got the same port assigned and bind attempt is failing with:
Caused by: java.net.BindException: Address already in use
To rectify it, set port to 0 in gerrit.config for both HTTP and SSH daemons
and let the daemons to do the ephemeral port assignments. In SSH and HTTP
daemons this special case is recognized and the assigned ports are written
back to gerrit.config to pass to the test harness side.
Change-Id: Ib4971b200d6dc86268674398fe590137ae35b6f3
Run reindex without '--recheck-mergeable' will get
Guice creation error which say No implementation for
com.google.gerrit.server.change.ChangeKindCache was bound.
Fixed.
Change-Id: I89118ce699e91b82f26da772fd252e4f29645dc0
SAP MaxDB (http://maxdb.sap.com/) is now supported as a database.
Depends-On: I9385bafe481152ce0c1471f2a7f89b1db5abac80
Change-Id: Iae2ad25a3db3a1069b80cf5733c92882da86e404
* stable-2.9:
SideBySide2: Show [ and ] shortcut keys in nav arrow tooltips
Always auto confirm adding reviewers for set-reviewers SSH command
Improve wording of 'parents' field description in CommitInfo
Fix 'parents' field name of CommitInfo in REST documentation
Implement pagination in project list screen
Add option 'S' to projects REST API to support query offset
Fix: Failure of acceptance tests.
Fix link behaviour inconsistencies in change info panel
Remove message box when editing topic of change
Update cookbook plugin to latest revision
Update Gerrit 2.9 release notes with info about 2.8.x series
Update GWT version to 2.6.0 in debug launcher
Do not refresh project list if filter did not change
Fix inconsistent behavior of diff view when viewing binary files
Update cookbook plugin to latest revision
Correct Javadoc of RestReadView in extension API
Emit ref-updated event when editing project access via web UI
Fix ChangeListener auto-registered implementations
Fix: The email notification of review comments gets stuck.
Fix memory leak of SubIndex.NrtFuture objects
Use consistent grammatical tense in command descriptions
Make skip bar more user friendly
Bump version to 2.8.4 in plugin API and archetypes
Helper script to update API version in plugin archetype pom files
Serialize GWT dbg and opt compiles
Bump GERRIT_VERSION to 2.8.4
Update the mysql documentation concerning charsets
By default don't allow admins to create new branches by push
Disable commitWithin when running Reindex
Emit ref-updated event when editing project access via web UI
SideBySide2: Fix syntax highlighting for shell files
ChangeScreen2: Respect comment visibility strategy
Don't add "Patch File" download link for merge commits
Conflicts:
gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/PatchMessages.java
gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/PatchMessages.properties
gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java
Change-Id: I3f2cb9a9f98e2c39d98fae47b0407bdf4ab8e4f4
* stable-2.8:
Emit ref-updated event when editing project access via web UI
Fix ChangeListener auto-registered implementations
Fix: The email notification of review comments gets stuck.
Use consistent grammatical tense in command descriptions
Make skip bar more user friendly
Bump version to 2.8.4 in plugin API and archetypes
Helper script to update API version in plugin archetype pom files
Serialize GWT dbg and opt compiles
Bump GERRIT_VERSION to 2.8.4
Update the mysql documentation concerning charsets
By default don't allow admins to create new branches by push
Disable commitWithin when running Reindex
Emit ref-updated event when editing project access via web UI
SideBySide2: Fix syntax highlighting for shell files
ChangeScreen2: Respect comment visibility strategy
Don't add "Patch File" download link for merge commits
The change 'ChangeScreen2: Respect comment visibility strategy' [1]
is dropped intentionally, see [2].
[1] https://gerrit-review.googlesource.com/55081
[2] https://gerrit-review.googlesource.com/#/c/55536/3/gerrit-gwtui/src/main/java/com/google/gerrit/client/change/History.java
Conflicts:
Documentation/config-gerrit.txt
VERSION
gerrit-gwtui/BUCK
gerrit-gwtui/src/main/java/com/google/gerrit/client/change/ChangeScreen2.java
gerrit-gwtui/src/main/java/com/google/gerrit/client/change/DownloadBox.java
gerrit-gwtui/src/main/java/com/google/gerrit/client/change/History.java
gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/SkipBar.java
gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/project/ChangeProjectAccess.java
gerrit-plugin-archetype/pom.xml
gerrit-plugin-gwt-archetype/pom.xml
gerrit-plugin-gwtui/pom.xml
gerrit-plugin-js-archetype/pom.xml
gerrit-server/src/main/java/com/google/gerrit/server/change/EmailReviewComments.java
gerrit-server/src/main/java/com/google/gerrit/server/project/PutConfig.java
gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ListMembersCommand.java
Change-Id: I16c848cb385080fd25555c983a3030e0f1cc560b
* stable-2.9
Split mergeability checks by priority
Refactor MergeabilityChecker to use a builder pattern
Change-Id: Ibf2e6d86158e72728a2bebdd5f285dc15fbb5228
When a project config is updated or a change is merged, all open
changes on an entire project or branch need to be rechecked for
mergeability. For projects or branches with lots of open changes,
this can flood the queue with potentially slow checks. This will
block simpler cases, such as checking mergeability of a single change
during ReceiveCommits.
Define a new Priority enum on the MergeabilityChecksExecutor so we
can split the queue based on priority, allowing smaller, interactive
changes such as pushes to not wait for the entire queued backlog.
Change-Id: I57f9eb33dbbcd8a560adfe4458ce48d7b0817957
* stable-2.9:
Set http queue size to max integer when maxQueued 0 is provided
Include only current votes into change message when removing a reviewer
Revert "== GERRIT" in documentation.
In 8e78797190ddb9e04f93190bae86fe3956f08b3d, in migration change from
Jetty 8 to Jetty 9 one special case was missing: maxQueued = 0. By
mapping this value to max capacity of the queue without extra check
for the 0 value makes Jetty fail to start with IllegalArgumentException
when httpd.minThreads (default 5) smaller then maxQueued.
Rectify it by assigning Integer.MAX_VALUE to maxQueued when 0 was set.
Adjust the documenatation to reflect this change.
Change-Id: I686cf75a0bd0af16983e52ba22e7957a65cbb5b9
Disable the 'commitWithin' from within Reindex by overriding
the configuration with '-1'. Treat negative values as the
original behavior, auto-flushing but not auto-committing, which
is the least safe but the most efficient for reindexing the
entire site.
Change-Id: Ifdba797bee871d2a3d8928810a6304bacb850c8c
This change adds a migration that creates an All-Users project for
storing meta data for all users. With this change no data is stored in
this repository yet, but future changes will e.g. store user
preferences in this repository by creating a ref per user.
Change-Id: Ib1ba5e4c2fb7a2f8e49d3bcf994c99d9e911475c
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Moves reusable parts of InitUtil to FileUtil class in gerrit-common
Change-Id: Ia24a34028ec27d98cd7927d97822eb218c5719a8
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
This will allow to use the class in other places than just in PGM.
Change-Id: I007fb9686762b86c66fb34c4bbc44d775cd509d8
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
When using an external custom log4j.properties using the
-Dlog4j.configuration option, you may need to keep the
ability to log HTTP activity using the Gerrit HttpLogLayout.
Change-Id: Ibd4b36736fa0f716c346d41f5586f8e66a5d1431
Some streams were not properly closed.
1. ProtoGen:
The OutputStream returned by lock.getOutputStream() was not closed in
case the instantiation of OutputStreamWriter failed with an
IOException.
2. InitUtil:
The InputStream was never closed. IO.readWholeStream(...) says that it
is the responsibility of the caller to close the stream.
3. Libraries:
The InputStream was not closed in case the instantiation of
InputStreamReader failed with an IOException.
4. JythonShell:
The InputStream was never closed.
5. LogFileCompressor:
The FileOuputStream was not closed in case the instantiation of
GZIPOutputStream failed with an IOException.
6. Version:
The InputStream was not closed in case the instantiation of
InputStreamReader failed with an IOException.
7. PrologCompiler:
The FileOutputStream was not closed in case the instantiation of
JarOutputStream failed with an IOException.
8. EncryptedContactStore:
The FileInputStream was not closed in case
PGPUtil.getDecoderStream(in) failed with an IOException.
9. HttpContactStoreConnection:
The OutputStream was not closed in case out.write(body) failed with an
IOException.
Change-Id: I05e10ab67b2daaf85b9324a13c8c8daf510545f7
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Similar like it is done by commit 6a88c2fcb8c0f66d9c077a7aedd907c0b49caecf
the URLClassLoader should not be closed since closing it means that it can
no longer be used to load new classes or resources that are defined by this
loader.
This partially reverts commit 21e277760e472a3043d0059ecb9a172eb1a01310.
Change-Id: I57952fbf7a94eff9563fb205b42d86545fc3ff8a
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
The documentation[1] says:
"Closes this URLClassLoader, so that it can no longer be used to load
new classes or resources that are defined by this loader."
This was incorrectly converted to try-with-resources in [2].
The purpose of this method is to add URLs to the existing ClassLoader
so they can be used in the future, so closing it immediately is
counterproductive, and indeed was causing NoClassDefFoundErrors when
trying to start Gerrit.
[1] http://docs.oracle.com/javase/7/docs/api/java/net/URLClassLoader.html#close()
[2] Iead344269bc0b985b2cd2176f15a764e6a0abb70
Change-Id: I322b665a164e1783ca872ba7dcafdc9ad09e139a
The try-with-resources statement ensures that the created resources
are always closed. Thus we can remove the suppression of Eclipse's
warnings about unclosed resources.
Change-Id: Ib20620d35e2b18fd061f6b1ea4d97eb9a00003bc
- The try-with-resources statement ensures that the URLClassReader
is always closed, and allows to remove the suppression of Eclipse's
warning about an unclosed resource.
- Catching multiple exception types in the same block reduces the
amount of duplicated code.
Change-Id: Iead344269bc0b985b2cd2176f15a764e6a0abb70
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
* changes:
Solr index requires SolrCloud rather than plain Solr
Handle exceptions during reindexing
InitIndex: Allow user to configure the Solr index URL
Solr index URL should be configured under the main "index" section
Improve information message about rebuilding the index
Broken by I1bd2c931, but fortunately already available in the
MergeabilityModule so just a matter of moving them around.
Change-Id: I68c43d861b3d6d49c4e5e2d933c64dfa0a182be2
If HTTPD not used in tests, it doesn't make much sense to enable it.
Using @NoHttpd on class or method it is now possible to disable HTTP
entirely and is another small step making slow tests fast.
With maturity of plugin API, more and more tests are going to move
to plugin API driven tests from REST driven tests.
Benchmark shows, that doing REST vs. plugin API comparisson:
@Test
public void rest() throws Exception {
String changeId = createChange().getChangeId();
for (int i = 0; i < 1000; i++) {
getRESTChange(changeId, ALL);
}
}
@Test
public void api() throws Exception {
String changeId = createChange().getChangeId();
for (int i = 0; i < 1000; i++) {
getPluginAPIChange(changeId, ALL);
}
}
make on my machine ca. 2 sec. for plugin API vs. 10 sec. for REST:
The whole Servlet/HTTP stack and Gson serialization
and deserialization is out if the picture for API driven tests.
Change-Id: If60170f06f466765d9602450043a1629a344d7ce
If an exception is thrown from within the change indexer, the reindex
program shows a stack trace. In the case of an error when using the
Solr index, it does not exit and continues running, while showing debug
messages "Got ping response for sessionid", but not doing anything
else.
Catch exceptions in the indexer and exit with a fatal error message.
Change-Id: Ief41eccc0d3fe9c5592782b51afa66c0c3150886
If the index URL is not configured, running the `reindex`
program fails with:
java.lang.IllegalStateException: index.url must be supplied
Add a step in the initialisation to allow the user to provide
the URL. Set the default value to "localhost:9983".
Change-Id: Iae52ade99dd5e17a0688f090cd3f3aea3b676682
When initialising Gerrit into an existing workspace, the index
should be "rebuilt", not "built". Change the message accordingly.
Also add a new line at the beginning of the message to make it
stand out from the other information that is being output. This
is consistent with other warnings such as the warning about
bouncycastle not being bundled.
Change-Id: I2ef5b9e141097da70fafd9dcf266988e9d6aaa27
All this class needs to do is mark an empty index as ready. Factor out
a small static method to do this work.
Change-Id: Id0bcef9cb7e5a6879288ed4716ea45fb6539f07c