From d7645d2a8e7bdfee948473992cef2c436bf47c58 Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Tue, 31 Jul 2018 10:01:10 +1000 Subject: [PATCH] Lookup gerrit username and use that for looking for changes In the situation that a candidate has registered an email address with the Foundation and that address is a secondary address in gerrit we'll fail to fin any validating changes. So fix that by finding an account that matches the email address under review and use that gerrit account for looking for change owners. Change-Id: I588463e5527c4ebfd24dc8f0d94d56d18f5d5673 --- openstack_election/check_candidacy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openstack_election/check_candidacy.py b/openstack_election/check_candidacy.py index da7254e2..88d3feed 100755 --- a/openstack_election/check_candidacy.py +++ b/openstack_election/check_candidacy.py @@ -32,6 +32,7 @@ def check_candidate(project_name, email, projects, limit=1): found = 0 branch = None timeframe = utils.conf['timeframe'] + owner = utils.get_gerrit_account(email)['username'] if project_name in ['Stable branch maintenance']: project_list = projects.values() @@ -53,7 +54,7 @@ def check_candidate(project_name, email, projects, limit=1): 'owner:%s project:%s' % (utils.gerrit_datetime(timeframe['start']), utils.gerrit_datetime(timeframe['end']), - email, repo_name)) + owner, repo_name)) if branch: query += (' branch:%s' % (branch)) print('Checking %s for merged changes by %s' %