Trigger GitRefUpdatedEvent when star labels are updated

When star labels are updated a refs/starred-changes/* branch in the
All-Users repository is updated. For this update we must trigger a
GitReferenceUpdated event, so that e.g. this ref update gets replicated
to Gerrit slaves.

For this GitRefUpdatedEvent we don't want to reindex the account since
star labels are not stored in the account index (but in the change
index and StarredChangesUtil already takes care to reindex the change).

Change-Id: I1d7fccfdeee603297e0b4e79393621b5ab57547a
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2017-10-05 14:34:17 +02:00
parent 54c04d380d
commit dc4e5d339c
4 changed files with 28 additions and 1 deletions

View File

@@ -32,6 +32,7 @@ import com.google.gerrit.pgm.util.SiteProgram;
import com.google.gerrit.pgm.util.ThreadLimiter;
import com.google.gerrit.server.change.ChangeResource;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.extensions.events.GitReferenceUpdated;
import com.google.gerrit.server.index.IndexModule;
import com.google.gerrit.server.index.IndexModule.IndexType;
import com.google.gerrit.server.index.change.ChangeSchemaDefinitions;
@@ -170,6 +171,7 @@ public class Reindex extends SiteProgram {
@Override
protected void configure() {
factory(ChangeResource.Factory.class);
bind(GitReferenceUpdated.class).toInstance(GitReferenceUpdated.DISABLED);
}
});