Reading/Web/ rebase tool

< Reading‎ | Web

Setup Edit

  • Setup a Gerrit account on wikitech and setup a labs instance
  • On the labs instance clone the repo that makes use of a build step e.g. Popups extension
  • Upgrade npm to 6
    • Install nvm
    • nvm install 6.11.0
      nvm use
      x ~/git/rebasebot $ node -v
  • Install git review (I recommend via the pip method on Linux)
    • Setup gerrit branch making sure you use ssh
      git remote add gerrit ssh://<username><project>.git
      git remote set-url gerrit ssh://<username><project>.git
    • Before going any further ensure you can run `git commit && git review` without errors.
      touch x.test
      git add x.test
      git commit
      git review
      In some repos you may find you need to add composer support for the precommit hook
      sudo php composer-setup.php --install-dir=/usr/bin --filename=composer
      composer install
      # possibly needed
      # sudo apt-get install php-mbstring
      # sudo apt-get install php-xml

    • If your labs instance differs from your Gerrit username edit ~/.ssh/config
    • Make sure your public key is valid for running:
      ssh -p 29418 gerrit stream-events
  • If in doubt, find your bot's username here:
  • You may need to update your bot's git email address via
    git config --global ""
  • If calling
    ssh -p 29418 gerrit stream-events
    reports "Capability streamEvents is required to access this resource" you'll need to get added to the correct Gerrit group by release engineering (use irc).

Running Edit

  • Clone on your labs instance
  • Save the following in a sh file e.g.
export PIXIES_HOME=/home/pixies/
cd $PIXIES_HOME/barrybot/Popups #this is the repo you want to auto-rebase for
screen -c $PIXIES_HOME/pixies.conf -dmSL pixie $PIXIES_HOME/barrybot/ --project mediawiki/extensions/Popups
  • Cross fingers!

In action Edit

If set up correctly:

  • Play Debaser by the pixies (adds to the magical effect)
  • Go to a patch in the repo you just setup your bot for that has a rebase conflict that Gerrit cannot take care of.
  • Either +2 it or comment with "rebase" (a bit like "recheck" for Jenkins)
  • Watch the magic unfold.

Rebooting Edit

An instance runs on under the pixies username. After sshing in there


sudo su mwvagrant
cd /home/pixies/
cd barrybot/
# check manually that the git repo is in a healthy state
cd /home/pixies/
./ # this launches a `screen` where Barry will watch for rebase commands

Folder structure Edit

Folder structure is

  • barrybot
    • Popups <working git repo to be targeted with git review setup>
  • pixies.conf

cd $HOME/barrybot/Popups #this is the repo you want to auto-rebase for
screen -c $HOME/pixies.conf -dmSL pixie $HOME/barrybot/ --project mediawiki/extensions/Popups


logfile pixiep.log
logfile flush 1
log on
logtstamp after 1
logtstamp string "[ %t: %Y-%m-%d %c:%s ]\012"
logtstamp on

Debugging Edit

  • Debugging information is passed to pixies.log
  • The bot should comment shortly after your rebase command with a "message received master!" to tell you that it's attempting to grant your request or reject swiftly if not possible.