commit | e0f52ff1708c21ee7dcc9337fcc12a64d1bdd7e6 | [log] [tgz] |
---|---|---|
author | Gustaf Lundh <gustaflh@axis.com> | Mon Apr 16 10:51:47 2018 +0200 |
committer | Gustaf Lundh <gustaflh@axis.com> | Thu Apr 19 13:21:24 2018 +0200 |
tree | 0d89d1201e8dc1d18f3464edbf823c2aedab7dfe | |
parent | 7ad00f81afe7a35a9d5a406f4a9e8b5d203e4d42 [diff] |
Support reloading of gerrit.config This change introduces a mechanism to allow reloading of the @GerritServerConfig. To execute a reload of gerrit.config, the SSH command "reload-config" is provided. Challenges and implementation: ------------------------------ Most callers that inject @GerritServerConfig are @Singletons. These @Singletons will only parse the GerritServerConfig once and then build and store more suitable datastructures to work from. To allow these modules to react on config changes, a caller can now implement GerritConfigListener, which will enable the caller to receive notifications of future config updates. The GerritConfigListener provides: void configUpdated(ConfigUpdatedEvent event); The ConfigUpdatedEvent provides the old config and the new one. Implementing classes of the listener are expected to do three things: 1. Investigate if any of the updated config values are of interest. The ConfigUpdatedEvent provides helper methods for this purpose: public boolean isSectionUpdated(String section) public boolean isValueUpdated(String section, String subsection, String name) (+ various overloaded versions of these) 2. React to the configuration changes (if any) and apply them 3. Accept or reject the entries of interest: public void accept(Set<ConfigKey> entries) public void accept(String section) public void reject(Set<ConfigKey> entries) (+ various overloaded versions of these) When a section (or specific config keys) are accepted or rejected, the ConfigUpdatedEvent will build a diff of what changes were accepted and present it to the administrator that issued a configuration reload. For instance, in this case, 4 config rows where added(+), 2 removed(-1) and 1 modified. All but one change were accepted, hence the user would get this output: $ ssh $HOST -p 29418 gerrit reload-config Accepted configuration changes: - suggest.maxSuggestedReviewers = 10 - suggest.accounts = 50 * addreviewer.maxAllowed = [100 => 1000] + sshd.requestLog = true + commentlink.changeid.link = #/q/$1 + commentlink.changeid.match = (I[0-9a-f]{8,40}) Rejected configuration changes: + gc.startTime = Fri 10:30 Documentation: -------------- We start by documenting the config entries that support config reloads (which number will be increasing over time). When we support reloading of the majority of config settings, the documentation can switch to documenting the config entries that does _not_ support config reloading instead. Roadmap: -------- This change will be followed by a couple of changes that introduces reloadable config support for: suggest-reviewers, sshd-log and commentlinks. Other stuff TODO includes: * REST end point * Rejection messages (to allow for an explanation on why the value was not accepted) * Test cases * An option to allow displaying the current effective configuration * A lot of implementations of the GerritConfigListener. Change-Id: I4bd6f389731af303ef9ba5d1d73f173d869c62e4
Gerrit is a code review and project management tool for Git based projects.
Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.
Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer.
For information about how to install and use Gerrit, refer to the documentation.
Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.
Please report bugs on the issue tracker.
Gerrit is the work of hundreds of contributors. We appreciate your help!
Please read the contribution guidelines.
Note that we do not accept Pull Requests via the Github mirror.
The IRC channel on freenode is #gerrit. An archive is available at: echelog.com.
The Developer Mailing list is repo-discuss on Google Groups.
Gerrit is provided under the Apache License 2.0.
Install Bazel and run the following:
git clone --recursive https://gerrit.googlesource.com/gerrit cd gerrit && bazel build release
The instruction how to configure GerritForge/BinTray repositories is here
On Debian/Ubuntu run:
apt-get update & apt-get install gerrit=<version>-<release>
NOTE: release is a counter that starts with 1 and indicates the number of packages that have been released with the same version of the software.
On CentOS/RedHat run:
yum clean all && yum install gerrit-<version>[-<release>]
On Fedora run:
dnf clean all && dnf install gerrit-<version>[-<release>]
Docker images of Gerrit are available on DockerHub
To run a CentOS 7 based Gerrit image:
docker run -p 8080:8080 gerritforge/gerrit-centos7[:version]
To run a Ubuntu 15.04 based Gerrit image:
docker run -p 8080:8080 gerritforge/gerrit-ubuntu15.04[:version]
NOTE: release is optional. Last released package of the version is installed if the release number is omitted.