Jeremy Stanley 69e247d873 Make ATC lists sort E-mails with preferred first
* tools/atc/email-stats.py: Adjust the order in which Gerrit E-mail
addresses are returned so that the one listed as the preferred
address is sorted to the beginning of the set.

Change-Id: I95b5817ada58f4059df4f5c0b406183f1c1e5b74
2014-06-24 20:37:40 +00:00
..
2013-11-12 11:30:34 -05:00
2014-06-24 19:38:03 +00:00
2014-06-24 19:38:03 +00:00

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

0) Write a patch to email_stats.py so steps 1-2 are not necessary.
1) Edit email_stats.py to set your gerrit username.
2) Edit email_stats.py to set the start_date and end_date.
3) Run the following queries on review.openstack.org:

  SELECT * FROM accounts
  INTO OUTFILE '/tmp/accounts.csv'
  FIELDS TERMINATED BY ','
  ENCLOSED BY '"'
  LINES TERMINATED BY '\n';

  SELECT * FROM account_external_ids
  INTO OUTFILE '/tmp/emails.csv'
  FIELDS TERMINATED BY ','
  ENCLOSED BY '"'
  LINES TERMINATED BY '\n';

4) Copy those files to this directory.
5) Run:

  mkdir out
  ./email-stats.sh
  DATE=`date --iso`
  mkdir $DATE
  for f in out/*.csv ; do
      fromdos $f
      iconv -f ISO-8859-1 -t UTF-8 -o $DATE/`basename $f` $f
  done
  cat $DATE/*.csv | sort | uniq > $DATE/all.csv

6) 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