Gerrit newcomer bot for Wikimedia Foundation’s Gerrit code collaboration tool.
It helps DevRel’s in two ways – providing a solution to welcome newcomers and adding a process to query newcomer patches. It typically does two things:
reviewer:Welcome, new contributor!
(https://gerrit.wikimedia.org/r/#/q/reviewer:%22Welcome%252C+new+contributor!%22)ownerin:newcomers
(https://gerrit.wikimedia.org/r/#/q/ownerin:newcomers)$ git clone git clone https://gerrit.wikimedia.org/r/labs/tools/gerrit-newcomer-bot.git $ cd gerrit-newcomer-bot $ pip3 install -r requirements Copy gerrit.conf.example as gerrit.conf and enter your details Drop your SSH host key in the project folder (name it as: ssh-host-key) $ python3 watch_newcomers.py
watch_newcomers.py
script is running in the background, clone a test repo and make some changes to it example repositorygit push origin HEAD:refs/for/<branch-name>
Note: If you want to use a different reviewer bot and not Welcome, new contributor!
, you will have to create one using the same process as in Step 1.
The bot is hosted here on Wikimedia's Toolforge: https://tools.wmflabs.org/admin/tool/gerrit-newcomer-bot. To make changes:
$ ssh username@login.tools.wmflabs.org $ become gerrit-newcomer-bot $ cd /www/python/src
This bot uses Kubernetes deployment process detailed here https://wikitech.wikimedia.org/wiki/Help:Toolforge/Kubernetes#Kubernetes_continuous_jobs. To restart the bot, delete the failing kubernetes pod and create the deployment following the steps below:
$ kubectl delete deployment gerrit-newcomer-bot.bot $ kubectl create -f /data/project/gerrit-newcomer-bot/etc/gerrit-newcomer-bot.yaml