Merge lp:~cjwatson/ols-jenkaas/ignore-hidden-votes into lp:~ols-jenkaas-admins/ols-jenkaas/trunk

Proposed by Colin Watson
Status: Merged
Merged at revision: 625
Proposed branch: lp:~cjwatson/ols-jenkaas/ignore-hidden-votes
Merge into: lp:~ols-jenkaas-admins/ols-jenkaas/trunk
Diff against target: 24 lines (+6/-1)
1 file modified
olsjenkaas/launchpad.py (+6/-1)
To merge this branch: bzr merge lp:~cjwatson/ols-jenkaas/ignore-hidden-votes
Reviewer Review Type Date Requested Status
Adam Collard (community) Approve
Review via email: mp+358681@code.launchpad.net

Commit message

Ignore hidden votes on merge proposals.

Description of the change

This otherwise greatly confused ols-jenkaas (e.g. https://jenkins.ols.canonical.com/online-services/job/software-center-agent-junit/606/console; I worked around that by unhiding the relevant vote comment on the MP).

To post a comment you must log in.
Revision history for this message
Adam Collard (adam-collard) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'olsjenkaas/launchpad.py'
2--- olsjenkaas/launchpad.py 2017-02-07 13:46:30 +0000
3+++ olsjenkaas/launchpad.py 2018-11-13 03:04:20 +0000
4@@ -16,6 +16,7 @@
5
6 from launchpadlib import (
7 credentials,
8+ errors,
9 launchpad,
10 )
11
12@@ -87,7 +88,11 @@
13 if vote.is_pending:
14 votes[u'Pending'] += 1
15 else:
16- comment = vote.comment
17+ try:
18+ comment = vote.comment
19+ except errors.NotFound:
20+ # Ignore hidden votes
21+ continue
22 if comment is not None and comment.vote != u'Abstain':
23 votes[comment.vote] += 1
24 approved = False

Subscribers

People subscribed via source and target branches