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
This commit is contained in:
Tony Breeds 2020-04-08 15:48:59 +10:00
parent 3191762ef8
commit 2c297994e0
7 changed files with 58 additions and 2 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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