Gerrit

From Wikitech
(Difference between revisions)
Jump to: navigation, search
(Giving users Labs access, if they don't already have SVN access)
(moved "how to get an account" info to Wikimedia Labs/OpenStack page)
Line 7: Line 7:
 
It uses the misc DB server (db9/db10), database name "reviewdb", for most storage.  
 
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 <tt>ou=people,dc=wikimedia,dc=org</tt> and groups under <tt>ou=groups,dc=wikimedia,dc=org</tt> are exposed to Gerrit. The Gerrit account name is the "cn" field in LDAP.
+
It uses the LDAP instance shared with [[subversion]] and [[labs]], possibly on virt0.wikimedia.org, for authentication. Accounts under <tt>ou=people,dc=wikimedia,dc=org</tt> and groups under <tt>ou=groups,dc=wikimedia,dc=org</tt> 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 [[OpenStack#Access_control]] for the process of getting a Labs account.
  
 
Gerrit shells out to GitWeb, a Perl application which is installed using the stock package.  
 
Gerrit shells out to GitWeb, a Perl application which is installed using the stock package.  
Line 18: Line 18:
  
 
It is 2.2.1 at the time of writing.  
 
It is 2.2.1 at the time of writing.  
 
== Giving users Labs access, if they already have an SVN account ==
 
In order to log in to Gerrit, a user needs to already have a Labs account.
 
 
Collect the following information from the user:
 
 
* Preferred wiki username. This will also be the user's git username, so legal name would be reasonable
 
* Preferred email address
 
* Their svn account name
 
 
On formey, run the following command:
 
 
add-labs-user --wikiname="<wikiusername>" --mail="<email address>" <svnusername>
 
 
Then go to [https://labsconsole.wikimedia.org/wiki/Special:NovaProject Special:NovaProject] and add the user, by wiki username, to the bastion project.
 
 
Then the user must do the following:
 
 
# Go to the [https://labsconsole.wikimedia.org/wiki/Special:PasswordReset password reset form at labs console]
 
# Use the temporary password to set a password
 
# Log into [https://gerrit.wikimedia.org gerrit]
 
# Add their SSH key
 
 
If they are an ops team member, they should also be added to the ops group:
 
 
modify-ldap-group --addmembers=<svnusername> ops
 
 
If they are WMF staff, they should also be added to the wmf group:
 
 
modify-ldap-group --addmembers=<svnusername> wmf
 
 
== Giving users Labs access, if they don't already have SVN access ==
 
Ask for:
 
 
* Preferred wiki username. This will also be the user's git username, so legal name would be reasonable
 
* Preferred email address
 
* Their preferred shell account name
 
 
Then either:
 
 
* just get the accountcreators power from Ryan Lane or Sara Smollett or Mutante and then create the user's account using https://labsconsole.wikimedia.org/w/index.php?title=Special:UserLogin&type=signup and choose "By email" to send the user a password
 
* [[Svn.wikimedia.org#Add_users|Make an LDAP user on formey]] and then follow the instructions for people who have SVN accounts (above)
 
  
 
== Using gerrit ==
 
== Using gerrit ==
  
 
This is [https://labsconsole.wikimedia.org/wiki/Main_Page documented on the labsconsole wiki] and [[mw:Git/Workflow|on mediawiki.org].
 
This is [https://labsconsole.wikimedia.org/wiki/Main_Page documented on the labsconsole wiki] and [[mw:Git/Workflow|on mediawiki.org].

Revision as of 21:11, 22 February 2012

Gerrit is installed on formey 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 formey 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 OpenStack#Access_control 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.2.1 at the time of writing.

Using gerrit

This is documented on the labsconsole wiki and [[mw:Git/Workflow|on mediawiki.org].

Personal tools
Namespaces

Variants
Actions
Navigation
Ops documentation
Wiki
Toolbox