Gerrit

From Wikitech
(Difference between revisions)
Jump to: navigation, search
m
(== Creating new repositories == see mw:Git/Creating new repositories)
Line 38: Line 38:
  
 
''Note'': You may need to restart gerrit after the upgrade is finished.
 
''Note'': You may need to restart gerrit after the upgrade is finished.
 +
 +
== Creating new repositories ==
 +
 +
see [[mw:Git/Creating new repositories]]
  
 
== See also ==
 
== See also ==
 
* [[gerrit-wm]]
 
* [[gerrit-wm]]
 
* [[gerrit.wikimedia.org]]
 
* [[gerrit.wikimedia.org]]

Revision as of 22:16, 7 September 2012

We use Gerrit for our code review system for Git. It supersedes the CodeReview extension.

Contents

Quick links

Details

Gerrit is installed on manganese in the prefix /var/lib/gerrit2.

It is a Java daemon which listens for HTTP connections (port 8080) and SSH connections (port 29418). Apache on manganese proxies the relevant URLs on port 80 and 443 through to Gerrit. The SSH port provides a restricted shell for Git checkouts and administrative commands.

It uses the misc DB server (db9/db10), database name "reviewdb", for most storage.

It uses the LDAP instance shared with subversion and labs, possibly on virt0.wikimedia.org, for authentication. Accounts under ou=people,dc=wikimedia,dc=org and groups under ou=groups,dc=wikimedia,dc=org are exposed to Gerrit. The Gerrit account name is the "cn" field in LDAP. In order to log in to Gerrit, a user needs to already have a Labs account. See "Help:Access" on the Labsconsole wiki for the process of getting a Labs account.

Gerrit shells out to GitWeb, a Perl application which is installed using the stock package.

To find out what version of Gerrit is running, you can use:

java -jar /var/lib/gerrit2/gerrit.war version

It is 2.3 at the time of writing.

Using git

This is documented on the labsconsole wiki and on mediawiki.org.

Upgrading Gerrit

  1. Back up the database (db9.reviewdb) and git directories (/var/lib/gerrit2/review_site/git/). Just In Case.
  2. Download the latest .war file from Google Code to /var/lib/gerrit2/.
  3. Stop the gerrit daemon (/var/lib/gerrit2/review_site/bin/gerrit.sh stop)
  4. Start gerrit with the new *.war file using the "init" flag. For example: cd /var/lib/gerrit2 && java -jar gerrit-2.3.war init -d review_site
  5. The updater is going to ask you some questions, keep the current values. When it asks you if you want to copy the *.war file to the bin directory, say yes.
  6. Profit!!

Note: You may need to restart gerrit after the upgrade is finished.

Creating new repositories

see mw:Git/Creating new repositories

See also

Personal tools
Namespaces

Variants
Actions
Navigation
Ops documentation
Wiki
Toolbox