Include contributors to repos for SIGs in TC rolls

It's been the intent ever since the TC started keeping a record of
what Git repositories are controlled by official SIGs, that the
contributors to those repositories should be eligible to vote in TC
elections. Add that feature, along with a command-line option for
specifying a non-default file in the event the official one needs to
be overridden, and use the same zeroing logic as is used for
skipping the legacy file for retired repositories, for the same
reasons.

Change-Id: I65d2a620a0e4b81d0ef685a7fedb0e7800cbff9f
This commit is contained in:
Jeremy Stanley 2019-09-20 20:19:52 +00:00
parent 8b8f98aa45
commit e963ab662d
2 changed files with 30 additions and 0 deletions

View File

@ -108,6 +108,7 @@ def usage(argv=sys.argv):
parser.add_argument("-a", "--after", help="Start date for matching merges")
parser.add_argument("-b", "--before", help="End date for matching merges")
parser.add_argument("-c", "--config", help="Path to script configuration")
parser.add_argument("-g", "--sigs", help="Path to SIGs repos file")
parser.add_argument("-m", "--nonmember",
help="include non-foundation-members in electorate",
action="store_true")

View File

@ -130,6 +130,14 @@ def main(options):
else:
legacy_file = None
# SIGs projects file path
if options.sigs:
sigs_file = options.sigs
elif 'sigs' in config:
sigs_file = config['sigs']
else:
sigs_file = None
# Whether to omit "extra ATCs"
if options.no_extra_atcs:
no_extra_atcs = options.no_extra_atcs
@ -217,6 +225,27 @@ def main(options):
gov_projects[project]['deliverables'][deliverable] = \
old_projects[project]['deliverables'][deliverable]
# The set of repositories managed by special interest groups
# are added to the main dict as they're part of the technical
# committee electorate
if sigs_file:
sigs_repos = utils.load_yaml(open(sigs_file).read())
elif projects_file:
sigs_repos = []
else:
sigs_repos = utils.get_from_git('openstack/governance',
'reference/sigs-repos.yaml',
{'h': ref})
for sig in sigs_repos:
for repo in sigs_repos[sig]:
if 'sigs' not in gov_projects:
gov_projects['sigs'] = {'deliverables': {}}
if sig not in gov_projects['sigs']['deliverables']:
gov_projects['sigs']['deliverables'][sig] = {'repos': []}
for repo in sigs_repos[sig]:
gov_projects['sigs']['deliverables'][sig]['repos'].append(
repo['repo'])
# A cache of full repo names existing in Gerrit, used to filter out repos
# listed in governance which don't actually exist
ger_repos = utils.query_gerrit('projects/', verbose=options.verbose)