Gerrit Staging Commands

From Qt Wiki
Jump to navigation Jump to search

Gerrit provides a command line interface to handle staging related activities. These commands provide a mechanism for viewing and managing the status of gerrit branches. This can be as simple as listing the currently staged items associated with a project/branch, the creation of a new build for a project/branch and the status setting of staged items that have passed or failed some integration step.

The version of gerrit that is running on codereview.qt.io has been modified from the original code base. These changes are available here

Staging List

This lists all the commits that have been applied to the staging branch.

gerrit staging-ls -p <gerrit project> -b <source branch> -d <destination>

Staging Pass

This is the integration approval command that merges all staged and currently integrating commits into the master branch and changes the gerrit status to merged.

gerrit staging-approve -p <gerrit project> -i <gerrit build> -b <source branch> -r pass -m <message>

Staging Fail

This is the integration fail command that cancels currently integrating commits and changes gerrit status back to 'review in progress'.

gerrit staging-approve -p <gerrit project> -i <gerrit build> -b <source branch> -r fail -m <message>

Staging New Build

This creates a new build and places all the currently staged commits into a unique build branch and changes the gerrit status to INTEGRATING.

gerrit staging-new-build -p <gerrit project> -s <source branch> -i <gerrit build id>

SSH Access

Access to these commands are typically handled via an SSH connection to the gerrit server on qt.io. This through port 29418 to codereview.qt.io with the following syntax

ssh -p 29418 codereview.qt.io gerrit <gerrit command/options>

Gerrit Help

To obtain a printout of help from gerrit there is a help option that can be passed to the server.

ssh -p 29418 codereview.qt.io gerrit help

Common issues

Some Linux distros (such as Arch) by default consider all of the ssh ciphers that gerrit uses to be obsolete, so during git push you might get an error like

Unable to negotiate with 54.229.21.112 port 29418: no matching cipher found. Their offer: aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc

In that case, edit ~/.ssh/config and add at least one of the supported ciphers so that your ssh client will support it too; for example

Host codereview.qt-project.org
        Port 29418
        User myusername
        Ciphers aes256-cbc

or, /etc/ssh/ssh_config to change it system-wide (but this makes your whole system slightly less secure):

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes256-cbc

More information