|author||Luca Milanesio <email@example.com>||Wed Sep 15 01:13:16 2021 +0100|
|committer||Luca Milanesio <firstname.lastname@example.org>||Wed Sep 22 23:14:26 2021 +0100|
Filter out non-existent changes from advertised refs The project may contain refs that are not associated to any change, possibly because of corruption issues or errors in migrating them to NoteDb. Consider any non-existent changes as non-existent refs and avoid serving them in the advertised refs list. Change-Id: I8df20d299f753fdbf206503f8ca02bff99d8b7e6
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-filterdirectory to Gerrit
bazel build plugins/git-refs-filter
bazel test plugins/git-refs-filter:git_refs_filter_tests
git-refs-filter.jarmodule is generated under
git-refs-filter.jar library to Gerrit
/lib and add the following one extra settings to
[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.
Filtering a closed change refs has the following meaning:
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.