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
This commit is contained in:
Jean-Philippe Evrard 2020-04-21 14:48:09 +02:00
parent 7415600241
commit aa64673fe4

View File

@ -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