| commit | 4a43425ed02af7554a9fd01393711403f4d89f22 | [log] [tgz] |
|---|---|---|
| author | Edwin Kempin <ekempin@google.com> | Thu Mar 25 14:32:58 2021 +0100 |
| committer | Edwin Kempin <ekempin@google.com> | Wed Mar 31 14:57:24 2021 +0200 |
| tree | dd613bc94c6d80ca1b2a34fb291cc1e9a485a35e | |
| parent | 6bc25fa98e82327dd2f1fd54ecb4af7bb9d6e93c [diff] |
Do not invoke submit rules twice when updating a change Currently the submit rules are executed twice whenever a change gets updated, once for indexing the change, and once for sending out the change-updated event (both of these code paths create a ChangeData instance and the submit rules get triggered when certain fields in ChangeData are accessed for the first time). Executing the submit rules twice is bad as the execution time for the submit rules adds up to the latency of the update request, and running some submit rules (e.g. the code owners submit rule) is rather expensive. Change I415d745de caches the ChangeData instance that is created for indexing the change and makes it available in the postUpdate phase. We now reuse this ChangeData instance to send out the change-updated event. Since this ChangeData instance has the results of the submit rules already cached, the submit rules are not triggered again. By re-using the ChangeData instance we potentially also avoid doing other expensive lazy loads twice (EventUtil already avoids this for some expensive options by skipping them when formatting the change JSON for the change events, with this change doing this may become unnecessary). Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: Iad5f9f2294983087918beceab327dc28eb24deef
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 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 --recurse-submodules 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 8 based Gerrit image:
docker run -p 8080:8080 gerritcodereview/gerrit[:version]-centos8
To run a Ubuntu 20.04 based Gerrit image:
docker run -p 8080:8080 gerritcodereview/gerrit[:version]-ubuntu20
NOTE: release is optional. Last released package of the version is installed if the release number is omitted.