Stop hard coding core team member lists

All of the project json files had lists of the core review team
members.  Since this was originally written, gerrit has added a REST
API and this information is available through that API.  Get the info
from there instead when we can.

There are a few project files I didn't convert because the equivalent
gerrit team wasn't immediately obvious.

Change-Id: Ie7ae19d9a58a5148002676604fd6962ea1438786
Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
Russell Bryant 2015-06-01 13:06:08 -04:00
parent 8f5484e317
commit dd0211ab85
43 changed files with 157 additions and 402 deletions

View File

@ -16,6 +16,10 @@ if [ -n "${GERRIT_USER}" ] ; then
EXTRA_ARGS="-u ${GERRIT_USER}"
fi
if [ -n "${GERRIT_PASS}" ] ; then
EXTRA_ARGS="-P ${GERRIT_PASS}"
fi
if [ -n "${GERRIT_KEY}" ] ; then
EXTRA_ARGS="${EXTRA_ARGS} -k ${GERRIT_KEY}"
fi

View File

@ -4,10 +4,5 @@
"subprojects": [
"stackforge/barbican"
],
"core-team": [
"dougmendizabal",
"woodster",
"reaperhulk",
"john.vrbanac"
]
"core-team-gerrit-group": "barbican-core"
}

View File

@ -1 +1,8 @@
{"name": "ceilometer", "subprojects": ["openstack/ceilometer", "openstack/python-ceilometerclient"], "core-team": ["jdanjou", "doug-hellmann", "chungg", "lianhao-lu", "asalkeld", "eglynn", "nijaba", "corvus", "ildikov", "nprivalova"]}
{
"name": "ceilometer",
"subprojects": [
"openstack/ceilometer",
"openstack/python-ceilometerclient"
],
"core-team-gerrit-group": "ceilometer-core"
}

View File

@ -1 +1,9 @@
{"name": "cinder", "subprojects": ["openstack/cinder", "openstack/python-cinderclient", "openstack/volume-api"], "core-team": ["john-griffith", "avishay-il", "zhiteng-huang", "eharney", "duncan-thomas", "thingee", "walter-boring", "jdurgin", "jsbryant"]}
{
"name": "cinder",
"subprojects": [
"openstack/cinder",
"openstack/python-cinderclient",
"openstack/volume-api"
],
"core-team-gerrit-group": "cinder-core"
}

View File

@ -1,15 +1,5 @@
{
"name": "devstack",
"subprojects": ["openstack-dev/devstack"],
"core-team": [
"sdague",
"dtroyer",
"garyk",
"danwent",
"anotherjesse",
"vishvananda",
"corvus",
"bcwaldon",
"termie"
]
"core-team-gerrit-group": "devstack-core"
}

View File

@ -3,10 +3,5 @@
"subprojects": [
"openstack/docs-specs"
],
"core-team": [
"annegentle",
"bdpayne",
"jaegerandi",
"sroberts"
]
"core-team-gerrit-group": "openstack-doc-specs-core"
}

View File

@ -7,21 +7,5 @@
"openstack/openstack-doc-tools",
"openstack/openstackdocstheme"
],
"core-team": [
"Alexander",
"annegentle",
"bdpayne",
"berendt",
"diane-fleming",
"fifieldt",
"gpocentek",
"ionosphere80",
"jaegerandi",
"loquacity",
"mzlatkova",
"Olga",
"sgordon",
"shillasaebi",
"slong"
]
"core-team-gerrit-group": "openstack-doc-core"
}

View File

@ -11,16 +11,5 @@
"stackforge/fuel-ostf",
"stackforge/fuel-provision"
],
"core-team": [
"mihgen",
"NastyaUrlapova",
"evgeniyl",
"aleksey",
"r0mikiam",
"vkramskikh",
"aglarendil",
"dpyzhov",
"tatyana-leontovich",
"angdraug"
]
"core-team-gerrit-group": "fuel-core"
}

View File

@ -1 +1,9 @@
{"name": "glance", "subprojects": ["openstack/glance", "openstack/python-glanceclient", "openstack/image-api"], "core-team": ["markwash", "bcwaldon", "eglynn", "dan-prince", "flaper87", "alex-meade", "jbresnah", "iccha-sethi", "flwang", "lzy-dev"]}
{
"name": "glance",
"subprojects": [
"openstack/glance",
"openstack/python-glanceclient",
"openstack/image-api"
],
"core-team-gerrit-group": "glance-core"
}

View File

@ -1,8 +1,5 @@
{
"name": "grenade",
"subprojects": ["openstack-dev/grenade"],
"core-team": [
"sdague",
"dtroyer"
]
"core-team-gerrit-group": "grenade-core"
}

View File

@ -6,18 +6,5 @@
"openstack/heat-cfntools",
"openstack/python-heatclient"
],
"core-team": [
"asalkeld",
"huangtianhua",
"jbd",
"pshchelo",
"randall-burt",
"steve-stevebaker",
"shardy",
"skraynev",
"tengqm",
"therve",
"thomasspatzier",
"zaneb"
]
"core-team-gerrit-group": "heat-core"
}

View File

@ -4,18 +4,5 @@
"openstack/horizon",
"openstack/tripleo-ui"
],
"core-team": [
"akrivoka",
"amotoki",
"clu-m",
"david-lyle",
"jpichon",
"lin-hua-cheng",
"mrunge",
"niu-zglinux",
"thesheep",
"tmazur",
"tqtran",
"ttrifonov"
]
"core-team-gerrit-group": "horizon-core"
}

View File

@ -115,12 +115,6 @@
"openstack-infra/zuul",
"openstack-infra/zuul-packaging",
"openstack/openstack-planet"
], "core-team": [
"cboylan",
"corvus",
"fungi",
"jhesketh",
"lyz",
"mordred",
"slukjanov"
]}
],
"core-team-gerrit-group": "infra-core"
}

View File

@ -1,7 +1,7 @@
{"name": "ironic-discoverd", "subprojects": [
"stackforge/ironic-discoverd"
], "core-team": [
"lucasagomes",
"ifarkas",
"dtantsur"
]}
{
"name": "ironic-discoverd",
"subprojects": [
"stackforge/ironic-discoverd"
],
"core-team-gerrit-group": "ironic-discoverd-core"
}

View File

@ -1,10 +1,7 @@
{"name": "ironic-specs", "subprojects": [
"openstack/ironic-specs"
], "core-team": [
"devananda",
"nobodycam",
"lucasagomes",
"dtantsur",
"JayF",
"jimrollenhagen"
]}
{
"name": "ironic-specs",
"subprojects": [
"openstack/ironic-specs"
],
"core-team-gerrit-group": "ironic-specs-core"
}

View File

@ -1,17 +1,9 @@
{"name": "ironic", "subprojects": [
"openstack/ironic",
"openstack/python-ironicclient",
"openstack/ironic-python-agent"
], "core-team": [
"devananda",
"lucasagomes",
"nobodycam",
"JayF",
"jimrollenhagen",
"rloo",
"yuriyz",
"whaom",
"dtantsur",
"dshrews",
"JoshNang"
]}
{
"name": "ironic",
"subprojects": [
"openstack/ironic",
"openstack/python-ironicclient",
"openstack/ironic-python-agent"
],
"core-team-gerrit-group": "ironic-core"
}

View File

@ -1,12 +1,7 @@
{"name": "jjb", "subprojects": [
"openstack-infra/jenkins-job-builder"
], "core-team": [
"arnaud.fabre",
"cboylan",
"corvus",
"fungi",
"hashar",
"mgagne",
"mordred",
"zaro0508"
]}
{
"name": "jjb",
"subprojects": [
"openstack-infra/jenkins-job-builder"
],
"core-team-gerrit-group": "jenkins-job-builder-core"
}

View File

@ -9,18 +9,6 @@
"openstack/python-keystoneclient-kerberos",
"openstack/identity-api"
],
"core-team": [
"ayoung",
"blk-u",
"dolph",
"dstanek",
"guang-yee",
"henry-nash",
"jamielennox",
"ldbragst",
"marek-denis",
"mdrnstm",
"stevemar"
]
"core-team-gerrit-group": "keystone-core"
}

View File

@ -4,9 +4,5 @@
"subprojects": [
"stackforge/magnetodb"
],
"core-team": [
"isviridov",
"dukhlov",
"ikhudoshyn"
]
"core-team-gerrit-group": "magnetodb-core"
}

View File

@ -6,7 +6,5 @@
"stackforge/mistral-extra",
"stackforge/python-mistralclient"
],
"core-team": [
"rakhmerov"
]
"core-team-gerrit-group": "mistral-core"
}

View File

@ -9,11 +9,5 @@
"stackforge/murano-docs",
"stackforge/python-muranoclient"
],
"core-team": [
"ativelkov",
"dteselkin",
"tsufiev",
"istalker2",
"ruhe"
]
"core-team-gerrit-group": "murano-core"
}

View File

@ -9,20 +9,5 @@
"openstack/netconn-api",
"openstack/neutron-specs"
],
"core-team": [
"arosen",
"amotoki",
"armando-migliaccio",
"carl-baldwin",
"dougw",
"emagana",
"garyk",
"HenryG",
"kevinbenton",
"markmcclain",
"maru",
"mestery",
"obondarev",
"salvatore-orlando"
]
"core-team-gerrit-group": "neutron-core"
}

View File

@ -3,12 +3,5 @@
"subprojects": [
"openstack/nova-specs"
],
"core-team": [
"alaski",
"berrange",
"danms",
"jogo",
"johngarbutt",
"mikalstill"
]
"core-team-gerrit-group": "nova-specs-core"
}

View File

@ -6,21 +6,6 @@
"openstack/python-novaclient",
"openstack/compute-api"
],
"core-team": [
"alaski",
"berrange",
"cerberus",
"danms",
"jaypipes",
"jogo",
"johngarbutt",
"klmitch",
"mikalstill",
"melwitt",
"mriedem",
"ndipanov",
"oomichi",
"sdague"
],
"core-team-gerrit-group": "nova-core",
"lp_projects": ["nova", "python-novaclient"]
}

View File

@ -22,16 +22,5 @@
"openstack/taskflow",
"openstack/requirements"
],
"core-team": [
"bnemec",
"dims-v",
"doug-hellmann",
"flaper87",
"haypo",
"jdanjou",
"markmc",
"mikalstill",
"russellb",
"zyluo"
]
"core-team-gerrit-group": "oslo-core"
}

View File

@ -3,15 +3,5 @@
"subprojects": [
"openstack/oslo.messaging"
],
"core-team": [
"bnemec",
"dims-v",
"doug-hellmann",
"flaper87",
"jdanjou",
"markmc",
"mikalstill",
"russellb",
"zyluo"
]
"core-team-gerrit-group": "oslo-messaging-core"
}

View File

@ -1,15 +1,5 @@
{
"name": "qa-specs",
"subprojects": ["openstack/qa-specs"],
"core-team": [
"afazekas",
"cyeoh-0",
"andrea-frittoli",
"david-kranz",
"igawa",
"mkoderer",
"oomichi",
"treinish",
"sdague"
]
"core-team-gerrit-group": "qa-specs-core"
}

View File

@ -1,24 +1,8 @@
{"name": "requirements", "subprojects": [
"openstack/requirements"
], "core-team": [
"alex_gaynor",
"cboylan",
"corvus",
"dan-prince",
"davewalker",
"doug-hellmann",
"ewindisch",
"fungi",
"gabriel-hurley",
"ghe.rivero",
"heckj",
"jdanjou",
"markmc",
"markmcclain",
"mordred",
"sdague",
"slukjanov",
"ttx",
"zulcss"
]}
{
"name": "requirements",
"subprojects": [
"openstack/requirements"
],
"core-team-gerrit-group": "requirements-core"
}

View File

@ -4,8 +4,5 @@
"subprojects": [
"stackforge/rubick"
],
"core-team": [
"mkulkin",
"gelbuhos"
]
"core-team-gerrit-group": "rubick-core"
}

View File

@ -8,14 +8,5 @@
"openstack/sahara-image-elements",
"stackforge/puppet-sahara"
],
"core-team": [
"slukjanov",
"aignatov",
"farrellee",
"jspeidel",
"alazarev",
"tmckay",
"mimccune",
"sreshetniak"
]
"core-team-gerrit-group": "sahara-core"
}

View File

@ -3,13 +3,5 @@
"subprojects": [
"openstack/security-doc"
],
"core-team": [
"annegentle",
"bdpayne",
"berendt",
"hyakuhei",
"jaegerandi",
"sicarie",
"nkinder"
]
"core-team-gerrit-group": "security-doc-core"
}

View File

@ -5,13 +5,5 @@
"stackforge/solum",
"stackforge/python-solumclient"
],
"core-team": [
"aotto",
"lifeless",
"noorul",
"asalkeld",
"devdatta-kulkarni",
"gokrokve",
"julienvey"
]
"core-team-gerrit-group": "solum-core"
}

View File

@ -12,31 +12,5 @@
"openstack/neutron",
"openstack/horizon"
],
"core-team": [
"arosen",
"gandelman-a",
"apevec",
"zulcss",
"danms",
"davewalker",
"david-lyle",
"dolph",
"doug-hellmann",
"eglynn",
"flaper87",
"gabriel-hurley",
"john-griffith",
"jdanjou",
"markmc",
"markwash",
"treinish",
"mrunge",
"russellb",
"stevebaker",
"shardy",
"vishvananda",
"garyk",
"markmcclain",
"p-draigbrady"
]
"core-team-gerrit-group": "stable-maint-core"
}

View File

@ -4,12 +4,5 @@
"openstack-infra/storyboard",
"openstack-infra/storyboard-webclient"
],
"core-team": [
"ttx",
"cboylan",
"fungi",
"corvus",
"mordred",
"krotscheck"
]
"core-team-gerrit-group": "storyboard-core"
}

View File

@ -1 +1,9 @@
{"name": "swift", "subprojects": ["openstack/swift", "openstack/python-swiftclient", "openstack/swift-bench"], "core-team": ["darrellb", "torgomatic", "notmyname", "clay-gerrard", "david-goetz", "redbo", "greglange", "zaitcev", "acoles", "peluse", "mattoliverau", "cschwede"]}
{
"name": "swift",
"subprojects": [
"openstack/swift",
"openstack/python-swiftclient",
"openstack/swift-bench"
],
"core-team-gerrit-group": "swift-core"
}

View File

@ -3,12 +3,5 @@
"subprojects": [
"openstack/taskflow"
],
"core-team": [
"doug-hellmann",
"changbl",
"imelnikov",
"harlowja",
"pran1990",
"dankrause"
]
"core-team-gerrit-group": "taskflow-core"
}

View File

@ -1,15 +1,5 @@
{
"name": "tempest",
"subprojects": ["openstack/tempest"],
"core-team": [
"afazekas",
"cyeoh-0",
"andrea-frittoli",
"david-kranz",
"igawa",
"mkoderer",
"oomichi",
"treinish",
"sdague"
]
"core-team-gerrit-group": "tempest-core"
}

View File

@ -3,11 +3,5 @@
"subprojects": [
"openstack/training-guides"
],
"core-team": [
"colinmcnamara",
"dguitarbite",
"rluethi",
"matjazp",
"seanrob"
]
"core-team-gerrit-group": "openstack-training-guides-core"
}

View File

@ -15,29 +15,9 @@
"openstack/tripleo-incubator",
"openstack/tripleo-specs",
"openstack/tuskar"
], "core-team": [
"bnemec",
"clint-fewbar",
"cmsj",
"derekh",
"dan-prince",
"ghe.rivero",
"greghaynes",
"jdob",
"jistr",
"jonpaul-sullivan",
"jprovazn",
"lsmola",
"lxsli",
"marios",
"mtaylor",
"pblaho",
"rdopieralski",
"slagle",
"stevenk",
"tchaypo",
"tomas-8c8"
], "lp_projects": [
],
"core-team-gerrit-group": "tripleo-core",
"lp_projects": [
"diskimage-builder",
"os-apply-config",
"os-cloud-config",

View File

@ -6,15 +6,5 @@
"openstack/trove-specs",
"openstack/python-troveclient"
],
"core-team": [
"amcreynolds",
"amrith",
"cp16net",
"ekotowski",
"iccha-sethi",
"peterstac",
"slicknik",
"vipuls",
"vkmc"
]
"core-team-gerrit-group": "trove-core"
}

View File

@ -4,4 +4,5 @@ pbr>=0.5.21,<1.0
prettytable
Babel>=1.3
pytz>=2010h
requests>=2.2.0,!=2.4.0
six>=1.7.0

View File

@ -47,7 +47,7 @@ def set_defaults(reviewer, reviewers):
reviewers[reviewer].setdefault('received', 0)
def process_patchset(project, patchset, reviewers, ts):
def process_patchset(project, patchset, reviewers, ts, options):
latest_core_neg_vote = 0
latest_core_pos_vote = 0
@ -58,7 +58,8 @@ def process_patchset(project, patchset, reviewers, ts):
# Only count code reviews. Don't add another for Approved, which
# is type 'Approved' or 'Workflow'
continue
core_team = utils.get_core_team(project)
core_team = utils.get_core_team(project, options.server, options.user,
options.password)
if review['by'].get('username', 'unknown') not in core_team:
# Only checking for disagreements from core team members
continue
@ -170,7 +171,8 @@ def write_pretty(reviewer_data, file_obj, options, reviewers, projects,
if num_reviewers else 0))
file_obj.write('Total reviews by core team: %d (%.1f/day)\n' % (
totals['core'], float(totals['core']) / options.days))
core_team_size = sum([len(utils.get_core_team(project))
core_team_size = sum([len(utils.get_core_team(project, options.server,
options.user, options.password))
for project in projects])
file_obj.write('Core team size: %d (avg %.1f reviews/day)\n' % (
core_team_size,
@ -253,6 +255,9 @@ def main(argv=None):
help='Number of days to consider')
optparser.add_option(
'-u', '--user', default=getpass.getuser(), help='gerrit user')
optparser.add_option(
'-P', '--password', default=getpass.getuser(),
help='gerrit HTTP password')
optparser.add_option(
'-k', '--key', default=None, help='ssh key for gerrit')
optparser.add_option(
@ -297,7 +302,7 @@ def main(argv=None):
patch_for_change = False
first_patchset = True
for patchset in change.get('patchSets', []):
process_patchset(project, patchset, reviewers, ts)
process_patchset(project, patchset, reviewers, ts, options)
age = utils.get_age_of_patch(patchset, now_ts)
if (now_ts - age) > ts:
change_stats['patches'] += 1
@ -326,7 +331,8 @@ def main(argv=None):
for k, v in reviewers:
in_core_team = False
for project in projects:
if v in utils.get_core_team(project):
if v in utils.get_core_team(project, options.server, options.user,
options.password):
in_core_team = True
break
name = '%s%s' % (v, ' **' if in_core_team else '')

View File

@ -21,6 +21,8 @@ import glob
import json
import logging
import os
import requests
import requests.auth
from six.moves import cPickle as pickle
import time
@ -297,5 +299,36 @@ def get_age_of_patch(patch, now_ts):
return now_ts - patch['createdOn']
def get_core_team(project):
return project['core-team']
TEAM_MEMBERS = {}
def get_team_members(team_name, server, user, pw):
global TEAM_MEMBERS
if team_name in TEAM_MEMBERS:
return TEAM_MEMBERS[team_name]
auth = requests.auth.HTTPDigestAuth(user, pw)
groups_request = requests.get('http://%s/a/groups/' % server, auth=auth)
if groups_request.status_code != 200:
raise Exception('Please provide your Gerrit HTTP Password.')
text = groups_request.text
teams = json.loads(text[text.find('{'):])
text = requests.get('http://%s/a/groups/%s/detail' % (server,
teams[team_name]['id']), auth=auth).text
team = json.loads(text[text.find('{'):])
members_list = [n['username'] for n in team['members']]
if 'hudson-openstack' in members_list:
# This is a review.openstack.org specific hack. This user is
# automatically included in core teams, but we don't want to include it
# in the stats.
members_list.remove('hudson-openstack')
TEAM_MEMBERS[team_name] = members_list
return members_list
def get_core_team(project, server, user, pw):
if 'core-team' in project:
return project['core-team']
if 'core-team-gerrit-group' in project:
return get_team_members(project['core-team-gerrit-group'],
server, user, pw)
return []