gitdm/openstack-config
patrick-crews 7e071d1ecb Adding pcrews email to hp group
Change-Id: Ieda8a992848533d34172bb5e6d687fda5585955c
2014-05-23 17:44:07 -07:00
..
groups Adding pcrews email to hp group 2014-05-23 17:44:07 -07:00
aliases Update mtreinish's employment history 2014-04-25 14:22:04 -04:00
domain-map change my affiliation to Samsung 2013-11-19 16:11:32 -08:00
email-map Update mtreinish's employment history 2014-04-25 14:22:04 -04:00
essex Add some commits to ignore in nova 2012-04-06 07:44:49 +01:00
folsom Final folsom 2012-09-28 08:02:06 +01:00
folsom-with-libs Add folsom config 2012-09-26 23:05:41 +01:00
grizzly Grizzly updates 2013-04-01 11:31:58 -04:00
havana Close havana and add Icehouse release configuration 2013-10-23 12:58:29 -06:00
havana-all Quantum has been renamed to Neutron 2013-07-07 14:39:06 +00:00
havana-bucket Add several categories of OpenStack projects 2013-07-05 14:42:41 +00:00
havana-docs Add several categories of OpenStack projects 2013-07-05 14:42:41 +00:00
havana-gating Add several categories of OpenStack projects 2013-07-05 14:42:41 +00:00
havana-incubated Add several categories of OpenStack projects 2013-07-05 14:42:41 +00:00
havana-infra Add several categories of OpenStack projects 2013-07-05 14:42:41 +00:00
havana-integrated Quantum has been renamed to Neutron 2013-07-07 14:39:06 +00:00
havana-library Quantum has been renamed to Neutron 2013-07-07 14:39:06 +00:00
havana-libs Quantum has been renamed to Neutron 2013-07-07 14:39:06 +00:00
havana-unofficial Add several categories of OpenStack projects 2013-07-05 14:42:41 +00:00
icehouse Close havana and add Icehouse release configuration 2013-10-23 12:58:29 -06:00
launchpad-ids.txt Merge "Add myself to the email and launchpad maps" 2014-03-17 14:05:46 +00:00
other-aliases Add some launchpad user email addresses which aren't in git 2012-04-06 07:44:49 +01:00
README Add gerritdm 2012-04-06 07:44:49 +01:00
regen.sh add a script which regenerates the launchpad user list 2013-05-20 14:15:42 +00:00

To generate the log used for input:

  $> grep -v '^#' openstack-config/essex | \
      while read project revisions; do \
       (cd ~/git/openstack/$project; \
        git fetch origin 2>/dev/null; \
        git log --no-merges --numstat -M --find-copies-harder $revisions); \
      done > log.txt

I then manually deleted the translation imports from the
'OpenStack Jenkins' user.

The EmailAliases file was created with this horror:

  $> for p in nova glance swift horizon; do cat ~/git/openstack/$p/.mailmap; done | \
      grep -v '^#' | sed 's/^[^<]*<\([^>]*\)>/\1/' | \
      grep '<.*>' | sed -e 's/[<>]/ /g' | \
      awk '{if ($3 != "") { print $3" "$1 } else {print $2" "$1}}' | \
      sort | uniq > aliases

with the only exception that I've tweaked Soren's canonical
email address to be is linux2go one, to fix a git-dm traceback.

To generate the stats I did:

  $> python ./gitdm -l 20 -n < log.txt

== Launchpad ==

To get every email address we know about:

  $> grep -v '^#' openstack-config/essex | \
      while read project revisions; do \
        cd ~/git/openstack/$project; \
        git log | awk -F '[<>]' '/^Author:/ {print $2}'; \
      done | sort | uniq | grep -v '\((none)\|\.local\)$' > tmp
  $> sed 's/ /\n/' < openstack-config/aliases >> tmp
  $> sed 's/ /\n/' < openstack-config/other-aliases >> tmp
  $> (sort | uniq | grep -v '\((none)\|\.local\)$') < tmp > emails.txt

To map those to launchpad names:

  $> ./tools/with_venv.sh python launchpad/map-email-to-lp-name.py \
       $(cat emails.txt) > openstack-config/launchpad-ids.txt

To generate a list of bugs:

  $> grep -v '^#' openstack-config/essex | \
      while read project revisions; do \
        ./tools/with_venv.sh python ./launchpad/buglist.py $project essex; \
      done > buglist.txt

Then to include the email addresses in the buglist:

  $> while read id $date person; do \
       emails=$(awk "/^$person / {print \$2}" openstack-config/launchpad-ids.txt); \
       echo $id $person $date $emails; \
     done < buglist.txt > buglist-full.txt

To generate the stats, I did:

  $> grep -v '<unknown>' buglist-full.txt | python ./lpdm -l 20

Launchpad API docs are here:

  https://launchpad.net/+apidoc/1.0.html
  https://help.launchpad.net/API/launchpadlib

== Gerrit ==

First, generate a list of Change-Ids:

  $> grep -v '^#' openstack-config/essex | \
      while read project revisions; do \
       (cd ~/git/openstack/$project; \
        git fetch origin 2>/dev/null; \
        git log $revisions); \
      done | \
        awk '/^    Change-Id: / { print $2 }' | \
        split -l 100 -d - essex-change-ids-

The output is split across files of 100 lines each because gerrit's
query will only return 500 results at a time.

Now, we generate a raw json query result:

  $> for f in essex-change-ids-??; do
        ssh -p 29418 review.openstack.org \
            gerrit query --all-approvals --format=json \
                $(awk -v ORS=" OR "  '{print}' $f | sed 's/ OR $//') ; \
      done > essex-reviews.txt

Next, generate a list of commits:

  $> grep -v '^#' openstack-config/essex | \
      while read project revisions; do \
       (cd ~/git/openstack/$project; \
        git fetch origin 2>/dev/null; \
        git log --pretty=format:%H $revisions); \
      done > essex-commits.txt

Now parse the json into a list of reviewers:

  $> python gerrit/parse-reviews.py \
       essex-commits.txt openstack-config/launchpad-ids.txt \
       < essex-reviews.txt  > essex-reviewers.txt

Finally, generate the stats with:

  $> python ./gerritdm -l 20 < essex-reviewers.txt