commit | 18abad17ba1ce030bed401e1155fb743484f52e1 | [log] [tgz] |
---|---|---|
author | Nasser Grainawi <nasser.grainawi@linaro.org> | Thu Jan 19 10:24:09 2023 -0700 |
committer | Nasser Grainawi <nasser.grainawi@linaro.org> | Tue Jan 24 12:23:33 2023 -0700 |
tree | 27ba99a274f7068d108993c84a30f02cf8e5828e | |
parent | e72f8da257b7433a159d5761fab50bb4a58f7f2e [diff] |
Fix negated label: queries with external groups The ChangeIndexPostFilterPredicate approach doesn't fix the case where the operator is also negated. For example if there was a query like `status:open NOT label:Code-Review=1,group=ldap/testers` then in that scenario we tried to index match Code-Review+1 votes and expected that we would use post-filtering for the group. However, since the operator was negated, we excluded those changes from the results before we reached the post-filter stage, meaning we never include changes where the voter isn't in the given group. This solution is an unoptimized approach that avoids using the index for the label operator whenever an external group is given. A better approach would fix the negation case for any ChangeIndexPostFilterPredicate, but that looks to be much more complicated to implement. Avoiding duplicated code is tricky here since the PostFilter and Index predicates need to extend different classes, but share almost all of the same logic for match(). Using a static inner helper class 'Matcher' as a member of both the PostFilter and Index classes seems to be the simplest way to minimize the duplication. Additionally we can extend that helper class in each of the PostFilter/Index classes within MagicLabelPredicates because they need slightly different behavior for one method. The added tests pass with both the Lucene and FakeIndex implementations, but the FakeIndex also passes without the fix because it uses match() instead of doing some kind of index search operation. Release-Notes: Fixed bug with negated label: operator using an external group Change-Id: I0268476f0e6e3008d30ce49dfbb71ea3b093f7c1
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.