Gerrit server-side hooks

In order to automate some checks on each patch that is sent, we have some custom gerrit hooks installed on our gerrit instance. There's a detailed explanation in the gerrit hooks official docs of the way they work in a generic view.

Here are some of the oVirt-only details about how we use them.

Configurations

NOTE: This info is very likely to be outdated, do not rely on it's freshness, if the info you want has to be reliable, always check the gerrit server itself for the current info.

We have hooks configuration on several different places:

/home/gerrit2/review_site/hooks/config

#!/bin/bash
## Credentials to use when connecting to bugzilla
BZ_USER='automation@ovirt.org'
BZ_PASS='******'
## Gerrit credentials/url used to review the patches (through ssh cli)
GERRIT_SRV="gerrit-hooks@localhost"
## Gerrit credentials/url used to review the patches as jenkins
JENKINS_GERRIT_SRV="jenkins@localhost"
## Tracker id on bugzilla for the autotracker hook
## 81 -> oVirt gerrit
TRACKER_ID='81'
TRACKER_NAME="oVirt gerrit"
PRODUCT='oVirt'
PRODUCTS=('oVirt' 'Red Hat Enterprise Virtualization Manager')
CLASSIFICATION='oVirt'

/home/gerrit2/review_site/git/infra-docs.git/hooks/config

CHECK_TARGET_RELEASE=("master|^.*")

/home/gerrit2/review_site/git/lago.git/hooks/config

CHECK_TARGET_RELEASE=("master|^.*") 
PRODUCTS=('lago')

/home/gerrit2/review_site/git/lago-images.git/hooks/config

CHECK_TARGET_RELEASE=("master|^.*") 
PRODUCTS=('lago')

/home/gerrit2/review_site/git/ovirt-engine.git/hooks/config

#!/bin/bash
## Branches to take into account
BRANCHES=('ovirt-engine-3.6' 'ovirt-engine-3.6.0' 'ovirt-engine-3.6.1' 'ovirt-engine-3.6.2')
STABLE_BRANCHES="ovirt-engine-3.6 ovirt-engine-3.6.5 ovirt-engine-3.6.6"
CHECK_TARGET_RELEASE=("ovirt-engine-3.6|^3\.[6543210].*") 
CHECK_TARGET_MILESTONE=('ovirt-engine-3.6|^.*3\.6.*') 
PRODUCT="oVirt"

/home/gerrit2/review_site/git/ovirt-hosted-engine-ha.git/hooks/config

#!/bin/bash
STABLE_BRANCHES="ovirt-hosted-engine-ha-1.1 ovirt-hosted-engine-ha-1.2 ovirt-hosted-engine-ha-2.0"
CHECK_TARGET_RELEASE=("ovirt-hosted-engine-ha-1.1|^3\.4.*$" "ovirt-hosted-engine-ha-1.2|^3\.5.*$" "ovirt-hosted-engine-ha-2.0|^4\.0.*$")

/home/gerrit2/review_site/git/ovirt-hosted-engine-setup.git/hooks/config

#!/bin/bash
STABLE_BRANCHES="ovirt-hosted-engine-setup-1.1 ovirt-hosted-engine-setup-1.2 ovirt-hosted-engine-setup-2.0"
CHECK_TARGET_RELEASE=("ovirt-hosted-engine-setup-1.1|^3\.4.*$" "ovirt-hosted-engine-setup-1.2|^3\.5.*$" "ovirt-hosted-engine-setup-2.0|^4\.0.*$")

/home/gerrit2/review_site/git/ovirt-system-tests.git/hooks/config

CHECK_TARGET_RELEASE=("master|^.*") 
PRODUCTS=('lago')

/home/gerrit2/review_site/git/repoman.git/hooks/config

CHECK_TARGET_RELEASE=("master|^.*") 
PRODUCTS=('Repoman')

/home/gerrit2/review_site/git/vdsm.git/hooks/config

#!/bin/bash
## Branches to take into account
BRANCHES=('ovirt-3.6')
STABLE_BRANCHES="ovirt-3.6"
CHECK_TARGET_RELEASE=("ovirt-3.5|^3\.[54321].*")
CHECK_TARGET_MILESTONE=('ovirt-3.6|^.*3\.6.*')
PRODUCT="oVirt"

List of projects and the hooks they use

NOTE: This list is very likely to be outdated, do not rely on it's freshness, if the info you want has to be reliable, always check the gerrit server itself for the current info.

Common to all the projects

All-Projects.git

  • No hooks

All-Users.git

  • No hooks

chrooter.git

cockpit-ovirt.git

  • No hooks

cpopen.git

fabric-ovirt.git

gerrit-admin.git

gluster-nagios-monitoring.git

  • No hooks

imgbased.git

infra-docs.git

infra-puppet.git

ioprocess.git

jasperreports-server-rpm.git

jenkins.git

jenkins-whitelist.git

  • No hooks

lago.git

lago-images.git

mom.git

otopi.git

ovirt-appliance.git

ovirt-container-engine.git

ovirt-container-node.git

ovirt-docs.git

ovirt-dwh.git

ovirt-engine-api-explorer.git

ovirt-engine-api-metamodel.git

ovirt-engine-api-model.git

ovirt-engine-cli.git

ovirt-engine-dashboard.git

  • No hooks

ovirt-engine-extension-aaa-jdbc.git

ovirt-engine-extension-aaa-ldap.git

ovirt-engine-extension-aaa-misc.git

ovirt-engine-extension-logger-log4j.git

ovirt-engine.git

ovirt-engine-sdk.git

ovirt-engine-sdk-java.git

ovirt-engine-sdk-js.git

ovirt-engine-sdk-ruby.git

ovirt-engine-sdk-tests.git

ovirt-guest-agent.git

ovirt-host-deploy.git

ovirt-hosted-engine-ha.git

ovirt-hosted-engine-setup.git

ovirt-imageio.git

  • No hooks

ovirt-image-proxy.git

ovirt-image-uploader.git

ovirt-iso-uploader.git

ovirt-jboss-modules-maven-plugin.git

ovirt-live.git

ovirt-log-collector.git

ovirt-node-dbus-backend.git

ovirt-node.git

ovirt-node-iso.git

ovirt-node-ng.git

ovirt-node-plugin-hosted-engine.git

ovirt-node-plugin-vdsm.git

ovirt-node-tests.git

ovirt-optimizer.git

ovirt-register.git

ovirt-release.git

ovirt-reports.git

ovirt-scheduler-proxy.git

ovirt-setup-lib.git

ovirt-system-tests.git

ovirt-testing-framework.git

  • No hooks

ovirt-testing-framework-tests.git

  • No hooks

ovirt-tools-common-python.git

ovirt-vdsmfake.git

ovirt-vmconsole.git

ovirt-wgt.git

ovirt-wgt-toolchain.git

pthreading.git

releng-tools.git

repoman.git

safelease.git

samples-portals.git

samples-uiplugins.git

test.git

  • No hooks

vdsm-arch-dependencies.git

vdsm.git

vdsm-imaged.git

vdsm-jsonrpc-java.git

vmconsole.git