From 859b4e7a4796a097f5ab73dcecffabb7d385218b Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Fri, 3 Jul 2020 17:29:48 -0500 Subject: [PATCH] Cleanup the remaining osf repos and their data With the depends-on patch, last remaining osf repo is also moved to osf/ namespace. Interop repos have been already moved - https://review.opendev.org/#/c/734669/ This remove the foundation-board-repos.yaml as no repo are there (after depends-on) and its data calculation too. Depends-On: https://review.opendev.org/#/c/739286/ Change-Id: I1aa375e2c30ba2071b25e7ff2490b2b07a392b58 --- openstack_governance/governance.py | 45 ++----------------- openstack_governance/tests/test_governance.py | 33 ++------------ reference/foundation-board-repos.yaml | 4 -- 3 files changed, 6 insertions(+), 76 deletions(-) delete mode 100644 reference/foundation-board-repos.yaml diff --git a/openstack_governance/governance.py b/openstack_governance/governance.py index 116a31104..fa3519fcb 100644 --- a/openstack_governance/governance.py +++ b/openstack_governance/governance.py @@ -12,7 +12,6 @@ """Work with the governance repository.""" -import collections import logging import os.path import weakref @@ -98,13 +97,11 @@ class Governance(object): _projects_filename = 'reference/projects.yaml' _tc_repos_filename = 'reference/technical-committee-repos.yaml' _sigs_repos_filename = 'reference/sigs-repos.yaml' - _wgs_repos_filename = 'reference/foundation-board-repos.yaml' - def __init__(self, team_data, tc_data, sigs_data, wgs_data): + def __init__(self, team_data, tc_data, sigs_data): self._team_data = team_data self._tc_data = tc_data self._sigs_data = sigs_data - self._wgs_data = wgs_data team_data['Technical Committee'] = { 'deliverables': { @@ -119,35 +116,9 @@ class Governance(object): for repo in sig_info } } - for wg_name, wg_info in wgs_data.items(): - team_data[wg_name] = { - 'deliverables': { - repo['repo'].partition('/')[-1]: {'repos': [repo['repo']]} - for repo in wg_info - } - } self._teams = [Team(n, i) for n, i in self._team_data.items()] - @classmethod - def _fixup_wgs_data(cls, wgs_data): - # For some period of time reference/foundation-board-repos.yaml - # was the wrong data structure. Each WG should be a list of dict()s - # where each dict has a single key 'repo' and a str() value. - # The incorrect format is a list of dict()s with a single key 'repo' - # but the value is a list of strings. - # Transform the incorrect format into the correct one so callers don't - # notice. - for wg_name in list(wgs_data.keys()): - wg_info = wgs_data[wg_name] - _tmp = [] - for idx in range(len(wg_info)): - if isinstance(wg_info[idx].get('repo', ''), list): - for repo in wg_info[idx]['repo']: - _tmp.append(collections.OrderedDict(repo=repo)) - if _tmp: - wgs_data[wg_name] = _tmp - @classmethod def from_local_repo(cls, repo_dir='.'): team_filename = os.path.join(repo_dir, cls._projects_filename) @@ -159,11 +130,7 @@ class Governance(object): sigs_filename = os.path.join(repo_dir, cls._sigs_repos_filename) sigs_data = _yamlutils.load_from_file(sigs_filename) - wgs_filename = os.path.join(repo_dir, cls._wgs_repos_filename) - wgs_data = _yamlutils.load_from_file(wgs_filename) - cls._fixup_wgs_data(wgs_data) - - return cls(team_data, tc_data, sigs_data, wgs_data) + return cls(team_data, tc_data, sigs_data) @classmethod def from_remote_repo(cls, repo_url_base=REPO_URL_BASE, gittag=None): @@ -185,13 +152,7 @@ class Governance(object): r = requests.get(sigs_url, params=query_options) sigs_data = _yamlutils.loads(r.text) - wgs_url = REPO_URL_BASE + '/reference/foundation-board-repos.yaml' - LOG.debug('fetching WGs data from %s', wgs_url) - r = requests.get(wgs_url, params=query_options) - wgs_data = _yamlutils.loads(r.text) - cls._fixup_wgs_data(wgs_data) - - return cls(team_data, tc_data, sigs_data, wgs_data) + return cls(team_data, tc_data, sigs_data) def get_team(self, name): for team in self._teams: diff --git a/openstack_governance/tests/test_governance.py b/openstack_governance/tests/test_governance.py index 3298e36a9..0d68172f5 100644 --- a/openstack_governance/tests/test_governance.py +++ b/openstack_governance/tests/test_governance.py @@ -76,27 +76,16 @@ api: - repo: openstack/api-sig """ -_wgs_data_yaml = """ ---- -# List of repositories owned by Foundation board and subcommittes -Interop Working Group: - - repo: openstack/interop - - repo: openstack/refstack-client - - repo: openstack/refstack - - repo: openstack/python-tempestconf -""" - TEAM_DATA = _yamlutils.loads(_team_data_yaml) TC_DATA = _yamlutils.loads(_tc_data_yaml) SIGS_DATA = _yamlutils.loads(_sigs_data_yaml) -WGS_DATA = _yamlutils.loads(_wgs_data_yaml) class TestGetRepoOwner(base.BaseTestCase): def setUp(self): super().setUp() - self.gov = governance.Governance(TEAM_DATA, TC_DATA, SIGS_DATA, WGS_DATA) + self.gov = governance.Governance(TEAM_DATA, TC_DATA, SIGS_DATA) def test_repo_exists(self): owner = self.gov.get_repo_owner( @@ -133,7 +122,7 @@ class TestGetRepositories(base.BaseTestCase): def setUp(self): super().setUp() - self.gov = governance.Governance(TEAM_DATA, TC_DATA, SIGS_DATA, WGS_DATA) + self.gov = governance.Governance(TEAM_DATA, TC_DATA, SIGS_DATA) def test_by_team(self): repos = self.gov.get_repositories( @@ -202,7 +191,7 @@ class TestGetTeam(base.BaseTestCase): def setUp(self): super().setUp() - self.gov = governance.Governance(TEAM_DATA, TC_DATA, SIGS_DATA, WGS_DATA) + self.gov = governance.Governance(TEAM_DATA, TC_DATA, SIGS_DATA) def test_found(self): team = self.gov.get_team('meta SIG') @@ -237,19 +226,3 @@ class TestTeamProperties(base.BaseTestCase): def test_mission(self): self.assertEqual('mission statement', self.team_with.mission) self.assertIsNone(self.team_without.mission) - - -class TestFixupWGData(base.BaseTestCase): - def test_incorrect_format(self): - _wgs_data = _yamlutils.loads(""" ---- -# List of repositories owned by Foundation board and subcommittes -Interop Working Group: - - repo: - - openstack/interop - - openstack/refstack-client - - openstack/refstack - - openstack/python-tempestconf -""") - governance.Governance._fixup_wgs_data(_wgs_data) - self.assertEqual(WGS_DATA, _wgs_data) diff --git a/reference/foundation-board-repos.yaml b/reference/foundation-board-repos.yaml deleted file mode 100644 index 9548f4d27..000000000 --- a/reference/foundation-board-repos.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# List of repositories owned by Foundation board and subcommittes -Transparency subcommittee: - - repo: openstack/transparency-policy