summaryrefslogtreecommitdiff
path: root/zuul/driver/github/githubmodel.py
diff options
context:
space:
mode:
authorAdam Gandelman <adamg@ubuntu.com>2017-02-09 15:15:49 -0800
committerJesse Keating <omgjlk@us.ibm.com>2017-05-23 21:47:49 -0700
commitd81dd7646f98b454eb088a516607cc77316a5a18 (patch)
treedb22949d3719c3a84dc48803f2910ba448ec671e /zuul/driver/github/githubmodel.py
parentae4cd274b1a194999cc7feabc8d0bff6ce0eb32b (diff)
downloadzuul-d81dd7646f98b454eb088a516607cc77316a5a18.tar.gz
Ensure PRs arent rejected for stale negative reviews
This updates the github source to only use the most recent review from each user reviewing a PR. This avoids having obsolete negative reviews trump a newer positive review. I've added a new test for good measure to ensure it works for the github case, where we are doing some conversion of github formatted timestamps to internal timestamps. Change-Id: I5607901def856c9363ec786a4116bfec19c9c97c Co-Authored-By: Jesse Keating <omgjlk@us.ibm.com> Signed-off-by: Adam Gandelman <adamg@ubuntu.com>
Diffstat (limited to 'zuul/driver/github/githubmodel.py')
-rw-r--r--zuul/driver/github/githubmodel.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/zuul/driver/github/githubmodel.py b/zuul/driver/github/githubmodel.py
index 27e7d3913..bbacc9b1b 100644
--- a/zuul/driver/github/githubmodel.py
+++ b/zuul/driver/github/githubmodel.py
@@ -90,11 +90,11 @@ class GithubReviewFilter(object):
return False
elif k == 'newer-than':
t = now - v
- if (review['provided'] < t):
+ if (review['grantedOn'] < t):
return False
elif k == 'older-than':
t = now - v
- if (review['provided'] >= t):
+ if (review['grantedOn'] >= t):
return False
elif k == 'type':
if review['type'] != v: