This is an automated email from the ASF dual-hosted git repository.

bbannier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 3618d79  Added early exit in reviewbot if nothing to review.
3618d79 is described below

commit 3618d799987284980d1048ebfe70a71ffae5df85
Author: Benjamin Bannier <[email protected]>
AuthorDate: Mon Sep 30 15:01:35 2019 +0200

    Added early exit in reviewbot if nothing to review.
    
    The current reviewbot setup always makes sure that the `master` branch
    can be built before verifying any reviews. This takes considerable time.
    
    With this patch we now avoid any builds if no reviews need to be
    verified. While detecting reviews requiring verification takes some
    time, it is currently much faster than building Mesos. With this setup
    we should now finish this job much faster in the usual case (nothing
    needs verification) while taking only on the order of a minute longer
    otherwise.
    
    Review: https://reviews.apache.org/r/71559
---
 support/jenkins/reviewbot.sh | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/support/jenkins/reviewbot.sh b/support/jenkins/reviewbot.sh
index c5b4976..349e18d 100755
--- a/support/jenkins/reviewbot.sh
+++ b/support/jenkins/reviewbot.sh
@@ -24,6 +24,24 @@ MESOS_DIR=$(git rev-parse --show-toplevel)
 : "${USERNAME:?"Environment variable 'USERNAME' must be set to the username of 
the 'Mesos Reviewbot' Reviewboard account."}"
 : "${PASSWORD:?"Environment variable 'PASSWORD' must be set to the password of 
the 'Mesos Reviewbot' Reviewboard account."}"
 
+. "$MESOS_DIR"/support/atexit.sh
+
+REVIEWS=$(mktemp -t reviewbot.XXXXXX)
+atexit "rm ${REVIEWS}"
+
+# Early exit if no reviews require validation.
+"${MESOS_DIR}"/support/verify-reviews.py \
+  -u "${USERNAME}" \
+  -p "${PASSWORD}" \
+  -r 1 \
+  --skip-verify \
+  --out-file "${REVIEWS}"
+
+if [ ! -s "${REVIEWS}" ]; then
+  echo "No reviews require verification"
+  exit 0
+fi
+
 # Build the HEAD first to ensure that there are no errors prior to applying
 # the review chain. We do not run tests at this stage.
 export OS='ubuntu:16.04'
@@ -34,4 +52,7 @@ export ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1 GTEST_FILTER='
 "${MESOS_DIR}"/support/jenkins/buildbot.sh
 
 # NOTE: The script sets up its own environment.
-"${MESOS_DIR}"/support/verify-reviews.py -u "${USERNAME}" -p "${PASSWORD}" -r 1
+"${MESOS_DIR}"/support/verify-reviews.py \
+  -u "${USERNAME}" \
+  -p "${PASSWORD}" \
+  -r 1

Reply via email to