diff --git a/openstack_election/cmds/change_owners.py b/openstack_election/cmds/change_owners.py index 7300963e..28902830 100644 --- a/openstack_election/cmds/change_owners.py +++ b/openstack_election/cmds/change_owners.py @@ -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") diff --git a/openstack_election/owners.py b/openstack_election/owners.py index 82da16e1..08c65504 100644 --- a/openstack_election/owners.py +++ b/openstack_election/owners.py @@ -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)