Track user activity in a persistent cache

Add a new Groovy script `track-active-users-1.0.groovy` to track user
activities by entering their `id` and timestamp into
`track-active-users_cache` persistent cache.

The tracking is implemented as a side effect on a new
`GroupBackend` implementation that handles all group `UUID`'s. This way
our backend `membershipsOf(CurrentUser)` method will be called whenever
any group membership resolution is done. This gives us a single
place to get the user activities for all supported entry points (UI,
REST, SSH, git-over-http). The impact of on the user group resolution
should be neglectable and should be equal to the performance of the
persistent cache `get()` and `put()` calls. The user activity timestamp
is stored with one-minute precision.

Bear in mind, that in the case of git-over-http access to public
repositories, even when the user provides authentication details, Gerrit
will not consult any of the `GroupBackend`'s. This means that clones and
fetches of publicly visible repositories will not be counted as user
activity.

Bug: Issue Issue 327730871
Change-Id: I5827288d40bba4c6b1e7b20d9aae822db8eabc29
2 files changed
tree: a7f81058527bbce3735b4c138fe68bdf4163ca69
  1. admin/
  2. multi-primary/
  3. replication/
  4. .gitignore
  5. README.md
README.md

Gerrit scripting plugins collection

Overview

This repository contains a collection of Gerrit scripting plugins that are intended to provide simple and useful extensions.

How to run the scripting plugins

Gerrit needs to be able to recognise the scripts syntax and being able to load them as plugins.

In order to be able to run Groovy scripts, you need to install first the Groovy scripting provider and then copy the Groovy scripts under your Gerrit /plugins directory.

Similarly for Scala scripts, you need to install the Scala scripting provider and then copy the Scala scripts under your Gerrit /plugins directory.

Administration Scripts

Gerrit multi-primary Scripts