You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Gerrit: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>Hashar
m ({{ptag|Gerrit}} ! :))
imported>Hashar
No edit summary
Line 1: Line 1:
{{gerrit nav}}
{{gerrit nav}}
{{ptag|Gerrit}}
{{ptag|Gerrit}}
We use Gerrit for our code review system for Git.
{{Sidebar
| name = Quick links
| content1 =
[https://gerrit.wikimedia.org Our Gerrit instance]


* [https://gerrit.wikimedia.org Our Gerrit instance]
[https://gerrit.wikimedia.org/r/Documentation/index.html Built-in Gerrit documentation]
* [https://gerrit.wikimedia.org/r/Documentation/index.html Built-in Gerrit documentation]
 
* '''Monitoring'''
'''Monitoring'''
** [[gerrit:monitoring|JVM monitoring with JavaMelody]]
 
** [https://logstash.wikimedia.org/app/dashboards#/view/AW1f-0k0ZKA7RpirlnKV Server side logging (Kibana)]
[[gerrit:monitoring|JVM monitoring with JavaMelody]]
** [https://grafana.wikimedia.org/dashboards/f/5AnaHr2Mk/gerrit Metrics dashboard (Grafana)]
 
** HTTP: [https://grafana.wikimedia.org/d/L0-l1o0Mz/apache?var-host=gerrit1001 Apache scoreboard] - [https://grafana.wikimedia.org/d/Zh_ncGsWk/queues-upstream?viewPanel=20 Gerrit HTTP threads view]
[https://logstash.wikimedia.org/app/dashboards#/view/AW1f-0k0ZKA7RpirlnKV Server side logging (Kibana)]
Experimental:
 
*[[Gerrit test instance]]
[https://grafana.wikimedia.org/dashboards/f/5AnaHr2Mk/gerrit Metrics dashboard (Grafana)]
* [https://gerrit.devtools.wmflabs.org/ Gerrit test install], hosted in [[Nova_Resource:Devtools|devtools Cloud VPS project]]
 
''HTTP''
 
[https://grafana.wikimedia.org/d/L0-l1o0Mz/apache?var-host=gerrit1001 Apache scoreboard]
 
[https://grafana.wikimedia.org/d/Zh_ncGsWk/queues-upstream?viewPanel=20 Gerrit HTTP threads view]
 
'''Experimental'''
 
[[Gerrit test instance]]
 
[https://gerrit.devtools.wmflabs.org/ Gerrit test install] ''(hosted in [[Nova_Resource:Devtools|devtools Cloud VPS project]])''
}}
We use Gerrit for our code review system for Git https://www.gerritcodereview.com/


== Overview ==
Gerrit is installed on [[gerrit1001]] in the prefix <code>/var/lib/gerrit2</code> and serves public request at https://gerrit.wikimedia.org/r/) . A replica runs on gerrit2001 which serves requests at https://gerrit-replica.wikimedia.org/r/ ), it is intended for a switch over and for various bots in order to offload the primary instance.
Gerrit is installed on [[gerrit1001]] in the prefix <code>/var/lib/gerrit2</code> and serves public request at https://gerrit.wikimedia.org/r/) . A replica runs on gerrit2001 which serves requests at https://gerrit-replica.wikimedia.org/r/ ), it is intended for a switch over and for various bots in order to offload the primary instance.


Line 33: Line 48:


== End users documentations ==
== End users documentations ==
See:


* [[gerrit:Documentation/index.html|Gerrit online documentation]]
* [[gerrit:Documentation/index.html|Gerrit online documentation]]
Line 44: Line 57:
Alternatively, you can follow the [https://dev-codelabs.web.app/codelabs/getting-started-with-git-and-gerrit/index.html Git & Gerrit codelab].
Alternatively, you can follow the [https://dev-codelabs.web.app/codelabs/getting-started-with-git-and-gerrit/index.html Git & Gerrit codelab].


== Upgrade procedures ==
See [[/Upgrade]].
== Administration ==
See [[/Administration]]
== Operations ==
See [[/Operations]]
== How to setup Gerrit in a Cloud VPS project ==
See [[Gerrit/Running in Cloud VPS|Gerrit/Running in Cloud VPS]].
== Troubleshooting / upgrade FAQ ==
Frequently asked questions regarding issues since the recent Gerrit version upgrade to 3.2.
=== Plugin install error: TypeError: self.onAction is not a function ===
If you see this error please hard refresh your browser cache.
For some the Ctrl + F5 or Stift + Ctrl + F5 (or whatever
combination your browser wants) is not sufficient.
If you still run into the issue after pressing your browsers F5
combination, please try clearing your caches for good.
For example on Firefox follow steps 1-6 from
* https://support.mozilla.org/en-US/kb/how-clear-firefox-cache#w_clear-the-cache
If you use a different browser, it should allow you to clear cached
web content somewhere in the setting too. Please find that in your
browser's help pages and follow the instructions.
=== Can't upload any patches with git review ===
If you use [https://www.mediawiki.org/wiki/Gerrit/git-review git-review] to submit patches to gerrit, make sure you have 1.27 or newer (not 1.26).
git-review 1.26 does not work with the new gerrit version.
== See also ==
* [[Gerrit Notification Bot]]
* [[Gerrit replica]]


[[Category:Gerrit]]
[[Category:Gerrit]]

Revision as of 13:53, 17 May 2021

We use Gerrit for our code review system for Git https://www.gerritcodereview.com/

Gerrit is installed on gerrit1001 in the prefix /var/lib/gerrit2 and serves public request at https://gerrit.wikimedia.org/r/) . A replica runs on gerrit2001 which serves requests at https://gerrit-replica.wikimedia.org/r/ ), it is intended for a switch over and for various bots in order to offload the primary instance.

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

Since the Gerrit v3.2 upgrade in summer 2020, Gerrit no longer uses a conventional, relational database. So if you read somewhere about Gerrit's MySQL (or similar) database or "reviewdb", it is stale information. Instead of a relational database, Gerrit now stores the needed data directly in the git repositories (NoteDB). To speed up lookup, it creates indices also known has secondary index. These indices are Lucene backed indices and H2 (flat file database engine from the Java world).

Git repositories are stored at /srv/gerrit/git/.

Gerrit uses the LDAP instance shared with Wikimedia Cloud Services 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 Wikimedia developer account. See Help:Getting Started for the process of getting a developer account.

To find out what version of Gerrit is running, you can use either of the following two commands:

java -jar /var/lib/gerrit2/review_site/bin/gerrit.war version
ssh -p 29418 gerrit.wikimedia.org gerrit version

As of November 2020, Gerrit runs with Java 8 (upgrade to Java 11 is task T268225).

End users documentations

Alternatively, you can follow the Git & Gerrit codelab.