From 2c297994e00179ba7377b64bc482a7c2bc7578a6 Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Wed, 8 Apr 2020 15:48:59 +1000 Subject: [PATCH] Include Leaderless projects in the PTL series results Now that we allow an election to close with one or more leaderless projects it's worth tracking that on the results page. Change-Id: Ie6a5ae8302dcd3ef9645067ba5d7f7bbd1c451f7 --- doc/source/_exts/ptl_archive.jinja | 8 ++++++++ doc/source/results/stein/ptl.yaml | 10 ++++++++++ doc/source/results/train/ptl.yaml | 4 ++++ doc/source/results/ussuri/ptl.yaml | 8 ++++++++ doc/source/results/victoria/ptl.yaml | 17 +++++++++++++++++ openstack_election/tests/test_utils.py | 1 + openstack_election/utils.py | 12 ++++++++++-- 7 files changed, 58 insertions(+), 2 deletions(-) diff --git a/doc/source/_exts/ptl_archive.jinja b/doc/source/_exts/ptl_archive.jinja index 5276c5fc..1a1eb9c8 100644 --- a/doc/source/_exts/ptl_archive.jinja +++ b/doc/source/_exts/ptl_archive.jinja @@ -43,6 +43,14 @@ Election Results No elections were necessary. {% endif %} +{% if leaderless|length %} +Leaderless Projects +=================== +{% for project in leaderless|sort %} + +* {{ project }} +{% endfor %} +{% endif %} PTL Candidates ============== diff --git a/doc/source/results/stein/ptl.yaml b/doc/source/results/stein/ptl.yaml index a1d14b58..037d8acb 100644 --- a/doc/source/results/stein/ptl.yaml +++ b/doc/source/results/stein/ptl.yaml @@ -392,6 +392,16 @@ election_statistics: - Tacker: electorate: 54 votes_cast: 20 +leaderless: +- Dragonflow +- Freezer +- Loci +- Packaging_Rpm +- RefStack +- Searchlight +- Security +- Trove +- Winstackers projects: - Adjutant - Barbican diff --git a/doc/source/results/train/ptl.yaml b/doc/source/results/train/ptl.yaml index 26a0d5c9..5aab0983 100644 --- a/doc/source/results/train/ptl.yaml +++ b/doc/source/results/train/ptl.yaml @@ -373,6 +373,10 @@ election: train elections_results: Nova: https://civs.cs.cornell.edu/cgi-bin/results.pl?id=E_b03df704c3012e18 OpenStack_Charms: https://civs.cs.cornell.edu/cgi-bin/results.pl?id=E_ca2c11f0f83ce84d +leaderless: +- PowerVMStackers +- Telemetry +- Zaqar projects: - Ec2_Api - Sahara diff --git a/doc/source/results/ussuri/ptl.yaml b/doc/source/results/ussuri/ptl.yaml index 3f7714bc..14db0440 100644 --- a/doc/source/results/ussuri/ptl.yaml +++ b/doc/source/results/ussuri/ptl.yaml @@ -336,6 +336,14 @@ candidates: ircname: null url: https://git.openstack.org/cgit/openstack/election/plain/candidates/ussuri/Zun/feng.shengqin%40zte.com.cn election: ussuri +leaderless: +- Cyborg +- Designate +- I18n +- OpenStackSDK +- Placement +- PowerVMStackers +- Winstackers projects: - Adjutant - Rally diff --git a/doc/source/results/victoria/ptl.yaml b/doc/source/results/victoria/ptl.yaml index 24577548..5b73d297 100644 --- a/doc/source/results/victoria/ptl.yaml +++ b/doc/source/results/victoria/ptl.yaml @@ -264,6 +264,23 @@ candidates: ircname: '' url: https://opendev.org/openstack/election/raw/branch/master/candidates/victoria/Zun/feng.shengqin%40zte.com.cn election: victoria +leaderless: +- Congress +- Barbican +- Cloudkitty +- I18n +- Adjutant +- Loci +- Masakari +- Zaqar +- Swift +- Rally +- Tricircle +- Packaging_Rpm +- Oslo +- Infrastructure +- Tacker +- Placement projects: - Telemetry - Kolla diff --git a/openstack_election/tests/test_utils.py b/openstack_election/tests/test_utils.py index 171aaab1..a1b5c685 100644 --- a/openstack_election/tests/test_utils.py +++ b/openstack_election/tests/test_utils.py @@ -97,6 +97,7 @@ class TestBuildCandidatesList(base.ElectionTestCase): mock_lookup_member.return_value = dict(data=[member]) expected = dict(candidates=mock.ANY, election='fake', + leaderless=mock.ANY, projects=['SomeProject']) observed = utils.build_candidates_list('fake') self.assertEqual(expected, observed) diff --git a/openstack_election/utils.py b/openstack_election/utils.py index d9084866..ba10448a 100644 --- a/openstack_election/utils.py +++ b/openstack_election/utils.py @@ -304,14 +304,19 @@ def election_is_running(): return False -def find_candidate_files(election=conf['release']): +def find_all_projects(election=conf['release']): election_path = os.path.join(CANDIDATE_PATH, election) - election_type = conf.get('election_type', '').lower() if os.path.exists(election_path): project_list = os.listdir(election_path) else: project_list = [] + return project_list + + +def find_candidate_files(election=conf['release']): + project_list = find_all_projects(election) + election_type = conf.get('election_type', '').lower() if election_type == 'tc': project_list = list(filter( lambda p: p in ['TC'], @@ -323,6 +328,7 @@ def find_candidate_files(election=conf['release']): project_list )) + election_path = os.path.join(CANDIDATE_PATH, election) candidate_files = [] for project in project_list: project_prefix = os.path.join(election_path, project) @@ -361,6 +367,8 @@ def build_candidates_list(election=conf['release']): 'fullname': get_fullname(member, filepath=filepath) }) + leaderless = set(find_all_projects(election)) - projects return {'election': election, 'projects': list(projects), + 'leaderless': list(leaderless), 'candidates': candidates_lists}