You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by wf...@apache.org on 2015/01/15 20:33:12 UTC
incubator-aurora git commit: Paginate when necessary in review bot.
Repository: incubator-aurora
Updated Branches:
refs/heads/master a350982ee -> 1acb428a1
Paginate when necessary in review bot.
Bugs closed: AURORA-1018
Reviewed at https://reviews.apache.org/r/29940/
Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/1acb428a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/1acb428a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/1acb428a
Branch: refs/heads/master
Commit: 1acb428a134fc51b3710871340cad0a053d954dd
Parents: a350982
Author: Bill Farner <wf...@apache.org>
Authored: Thu Jan 15 11:32:34 2015 -0800
Committer: Bill Farner <wf...@apache.org>
Committed: Thu Jan 15 11:32:34 2015 -0800
----------------------------------------------------------------------
build-support/jenkins/review_feedback.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/1acb428a/build-support/jenkins/review_feedback.py
----------------------------------------------------------------------
diff --git a/build-support/jenkins/review_feedback.py b/build-support/jenkins/review_feedback.py
index 66a8877..fcf574a 100755
--- a/build-support/jenkins/review_feedback.py
+++ b/build-support/jenkins/review_feedback.py
@@ -85,13 +85,23 @@ def _get_latest_user_request(reviews):
def _needs_reply(server, request):
print('Inspecting review %d: %s' % (request['id'], request['summary']))
- reviews = server.get_resource(request['links']['reviews']['href'])['reviews']
+ reviews_response = server.get_resource(request['links']['reviews']['href'])
+ reviews = reviews_response['reviews']
+ # The default response limit is 25. When the responses are limited, a 'next' link will be
+ # included. When that happens, continue to walk until there are no reviews left.
+ while 'next' in reviews_response['links']:
+ print('Fetching next page of reviews.')
+ reviews_response = server.get_resource(reviews_response['links']['next']['href'])
+ reviews.extend(reviews_response['reviews'])
feedback_reviews = [r for r in reviews if r['links']['user']['title'] == server.user]
if feedback_reviews:
# 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)
+ print('Latest feedback was given at %s' % latest_feedback_time)
+ print('Latest build request from a user at %s' % latest_request)
+ print('Latest diff was posted at %s' % latest_diff)
return ((latest_request and (latest_request > latest_feedback_time))
or (latest_diff and (latest_diff > latest_feedback_time)))
return True