aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject incubator-aurora git commit: Fix review bot to use correct latest diff time.
Date Thu, 13 Nov 2014 00:05:55 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master 0077a0c9a -> 2e2c4b37f


Fix review bot to use correct latest diff time.

Reviewed at https://reviews.apache.org/r/27941/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/2e2c4b37
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/2e2c4b37
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/2e2c4b37

Branch: refs/heads/master
Commit: 2e2c4b37f8139a51e934e05548557ca1583c4615
Parents: 0077a0c
Author: Bill Farner <wfarner@apache.org>
Authored: Wed Nov 12 16:05:25 2014 -0800
Committer: Bill Farner <wfarner@apache.org>
Committed: Wed Nov 12 16:05:29 2014 -0800

----------------------------------------------------------------------
 build-support/jenkins/review_feedback.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/2e2c4b37/build-support/jenkins/review_feedback.py
----------------------------------------------------------------------
diff --git a/build-support/jenkins/review_feedback.py b/build-support/jenkins/review_feedback.py
index d59818e..eaccfa8 100755
--- a/build-support/jenkins/review_feedback.py
+++ b/build-support/jenkins/review_feedback.py
@@ -69,10 +69,9 @@ def _apply_patch(patch_data, clean_excludes):
     raise PatchApplyError()
 
 
-def _get_latest_diff_time(server, request, reviews):
-  feedback_reviews = [r for r in reviews if r['links']['user']['title'] == server.user]
-  if feedback_reviews:
-    return feedback_reviews[-1]['timestamp']
+def _get_latest_diff_time(server, request):
+  diffs = server.get_resource(request['links']['diffs']['href'])['diffs']
+  return diffs[-1]['timestamp']
 
 
 REPLY_REQUEST = '@ReviewBot retry'
@@ -92,7 +91,7 @@ def _needs_reply(server, request):
     # Determine whether another round of feedback is necessary.
     latest_feedback_time = feedback_reviews[-1]['timestamp']
     latest_request = _get_latest_user_request(reviews)
-    latest_diff = _get_latest_diff_time(server, request, reviews)
+    latest_diff = _get_latest_diff_time(server, request)
     return ((latest_request and (latest_request > latest_feedback_time))
             or (latest_diff and (latest_diff > latest_feedback_time)))
   return True


Mime
View raw message