system-config/tools/atc
Jeremy Stanley 19c0ee2d3c Modernize ATCs script to Gerrit 2.8, programs.yaml
* tools/atc/README: Simplify instructions to use mysqlclient
tab-separated-values stdout, and remove obsolete manual steps which
have been automated.

* tools/atc/email-stats.sh: The functionality this shell script
previously provided has now been translated to Python and folded
into the inner script.

* tools/atc/email_stats.py: Implement the old email-stats.sh outer
loop, make it possible to run in a virtualenv, and make previously
hard-coded constants into command-line parameters with sane and
dynamically-determined defaults. Update field order and contents to
cope with differences in Gerrit 2.8, use a proper YAML parser on the
programs.yaml which has also changed format since the previous run,
and adjust for the improved extra-atcs file format as well.

Change-Id: I2deef2e6766ff998190e66737e7cec9cdcd5459c
2014-06-26 02:35:29 +00:00
..
diff.py Fix pep8 errors in modules dir 2013-11-12 11:30:34 -05:00
email_stats.py Modernize ATCs script to Gerrit 2.8, programs.yaml 2014-06-26 02:35:29 +00:00
README Modernize ATCs script to Gerrit 2.8, programs.yaml 2014-06-26 02:35:29 +00:00

These are the scripts used to create the ATC lists for use in PTL
elections and Summit invitations.

1) Run the following queries on review.openstack.org:

  sudo -H mysql -e 'SELECT * FROM accounts;' reviewdb > accounts.tab
  sudo -H mysql -e 'SELECT * FROM account_external_ids;' reviewdb > emails.tab

2) Copy those files to this directory.
3) Run:

  mkdir out
  virtualenv venv
  . venv/bin/activate
  pip install paramiko requests pyyaml
  ./email_stats.py --begin <BEGINDATE>
  # optionally specify --end, --keyfile and --user
  DATE=`date --iso`
  mv out $DATE
  cat $DATE/*.csv | sort | uniq > $DATE/all.csv

4) You can use diff.py to get the new ATCs since the previous run:

  ./diff.py $OLD-DATE/all.csv $DATE/all.csv $DATE/new.csv