commit | f681b01839e5a80ba6ac3d1d0da4cf3163a439a2 | [log] [tgz] |
---|---|---|
author | Luca Milanesio <luca.milanesio@gmail.com> | Tue Dec 11 16:26:45 2018 +0000 |
committer | Luca Milanesio <luca.milanesio@gmail.com> | Mon Dec 17 09:22:07 2018 +0000 |
tree | 1f090f838837253a1bed083fe511541b3f750a6e | |
parent | b2097c5cf114940a932d6b68e29ba7d20309d3b2 [diff] |
Initial commit of the closed refs filtering module The new refsfilter Gerrit module allows to reduce the footprint of the Git refs advertizing phase by hiding all the refs associated to non-live changes. Typical scenario is a CI build system: as closed changes (merged, abandoned) are not live anymore and would never be built, they are filtered out of the Git advertizing phase, saving a lot of processing from both client and server side. Another typical scenario is Gerrit slave replication for development purposes. Typically you do not work anymore on closed changes and there is little or even no value in getting those refs advertized and replicated to remote sites. Change-Id: I4636bc79bfc7b3290c4d491a638cacc8318d43a7
Gerrit lib module to allow filtering out refs in the Git advertizing protocol phase.
Build this module as it was a Gerrit plugin:
git-refs-filter
directory to Gerrit /plugins/git-refs-filter
bazel build plugins/git-refs-filter
bazel test plugins/git-refs-filter:git_refs_filter_tests
git-refs-filter.jar
module is generated under /bazel-genfiles/plugins/git-refs-filter/
Copy git-refs-filter.jar
library to Gerrit /lib
and add the following one extra settings to gerrit.config
:
[gerrit] installModule = com.googlesource.gerrit.modules.gitrefsfilter.RefsFilterModule
The refsfilter module defines a new global capability called “Filter out closed changes refs”. By default the capability isn't assigned to any user or group, thus the module installation has no side effects.
To enable a group of users of getting a “filtered list” of refs (e.g. CI jobs):
NOTE Gerrit makes a super-simplified ACL evaluation if all the projects are globally readable (e.g. project has a READ rule to refs/*). To enable the closed changes filtering you need to disable any global read rule for the group that needs refs filtering.