From aa64673fe4ab4ab98183a8b8840f74f788ea6d33 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Tue, 21 Apr 2020 14:48:09 +0200 Subject: [PATCH] Add extra-ATCs from sigs-repos into the electorate Without this patch, extra-atcs that are defined in a SIG will not be taken into consideration for electorate rolls. This is a problem, as we intend to move i18n as a SIG, so we would lose their atc as part of the electorate. This fixes it by editing the spaghetti code for SIGs. It was already simulating the structure of a project named "SIG". So it made sense to extend it with 'extra-atcs'. Therefore to initialise extra-atcs for SIGs, we just have to have something like this in sigs-repos: ``` signame: - repo: repo_location extra-atcs: - name: extra_atc_fullname email: extra_atc_email expires-in: extra_atc_expiry comment: extra_atc_comment ``` Yes, it means that a SIG need to own a repo for this. This is not a problem at the moment, AFAIK. If this becomes a problem, we could think of removing the sigs-repos file, and just make SIGs some kind of project in governance, simplifying the code. Depends-On: https://review.opendev.org/721605 Change-Id: I5e1c42c64f5e76dafb9420aa1f3363890b1b9d65 --- openstack_election/owners.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openstack_election/owners.py b/openstack_election/owners.py index 9118d480..25a60cda 100644 --- a/openstack_election/owners.py +++ b/openstack_election/owners.py @@ -239,12 +239,14 @@ def main(options): for sig in sigs_repos: for repo in sigs_repos[sig]: if 'sigs' not in gov_projects: - gov_projects['sigs'] = {'deliverables': {}} + gov_projects['sigs'] = {'deliverables': {}, 'extra-atcs': []} 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']) + gov_projects['sigs']['deliverables'][sig]['repos'].append( + repo['repo']) + extra_atcs = repo.get('extra-atcs', []) + if extra_atcs: + gov_projects['sigs']['extra-atcs'].extend(extra_atcs) # A cache of full repo names existing in Gerrit, used to filter out repos # listed in governance which don't actually exist