tree: 8e8279d94bd9d2227a2e1cadfa33f83ae3544b72 [path history] [tgz]
  1. obmc/
  2. obmc-gerrit
  3. README.md
  4. requirements.txt
  5. setup.py
  6. split_maintainers.py
amboar/obmc-scripts/maintainers/README.md

A Collection of Python Tools to Manipulate MAINTAINERS Files

OpenBMC defines its own style of MAINTAINERS file that is almost but not entirely alike the Linux kernel's MAINTAINERS file.

Historically the MAINTAINERS file was kept in the openbmc/docs repository and described the maintainers for all repositories under the OpenBMC Github organisation. Due to its separation from the repositories it was describing, openbmc/docs:MAINTAINERS was both incomplete and out-of-date.

These scripts were developed to resolve unmaintained state of MAINTAINERS by distributing the information into each associated repository.

General Use Stuff

obmc-gerrit is a helper script for pushing changes to Gerrit. For a repository with an OpenBMC-compatible MAINTAINERS file at its top level, obmc-gerrit will parse the MAINTAINERS file and mangle the git push REFSPEC such that the maintainers and reviewers listed for the repository are automatically added to the changes pushed:

$ obmc-gerrit push gerrit HEAD:refs/for/master

Installation

obmc-gerrit requires Python3. If this is not available on your system (!), see the virtualenv section below.

To install obmc-gerrit:

$ pip3 install --user -r requirements.txt
$ python3 setup.py install --user

I don't have Python3

Well, hopefully you have virtualenv. If you do, then you can run the following commands:

$ virtualenv --python=python3 .venv
$ . .venv/bin/activate
$ pip install -r requirements.txt
$ python setup.py install

To exit the virtualenv, run deactivate. To run obmc-gerrit you will need to ensure you have activated your virtualenv first.

MAINTAINERS Library

maintainers.py is the core library that handles parsing and assembling MAINTAINERS files. An AST can be obtained with parse_block(), and the content of a MAINTAINERS file can be obtained by passing an AST to assemble_block()

Once-off Thingos

split_maintainers.py is the script used to split the monolithic MAINTAINERS file in openbmc/docs into per-repository MAINTAINERS files and post the patches to Gerrit. Do not use this, it's captured for posterity.