yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [yetus] branch master updated: YETUS-867. Circle CI's master failing pull
Date Thu, 02 May 2019 17:37:51 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new f24f66e  YETUS-867. Circle CI's master failing pull
f24f66e is described below

commit f24f66eac3af21028bcd8f273b5334f230b3c66d
Author: Your Name <you@example.com>
AuthorDate: Wed May 1 12:13:28 2019 -0700

    YETUS-867. Circle CI's master failing pull
    
    Signed-off-by: Roman Shaposhnik <rvs@apache.org>
---
 precommit/src/main/shell/robots.d/circleci.sh | 13 ++++++++++++-
 precommit/src/main/shell/test-patch.sh        |  6 ++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/precommit/src/main/shell/robots.d/circleci.sh b/precommit/src/main/shell/robots.d/circleci.sh
index 9b9c2eb..3e74d34 100755
--- a/precommit/src/main/shell/robots.d/circleci.sh
+++ b/precommit/src/main/shell/robots.d/circleci.sh
@@ -39,7 +39,9 @@ if [[ "${CIRCLECI}" = true ]] &&
       USER_PARAMS+=("--empty-patch")
       PATCH_BRANCH="${CIRCLE_BRANCH}"
       pushd "${BASEDIR}" >/dev/null || exit 1
-      "${GIT}" branch --set-upstream-to=origin/"${CIRCLE_BRANCH}" "${CIRCLE_BRANCH}"
+      echo "Attempting to reset Circle CI's understanding of ${CIRCLE_BRANCH}"
+      "${GIT}" branch --set-upstream-to=origin/"${CIRCLE_BRANCH}" "${CIRCLE_BRANCH}" || true
+      "${GIT}" branch -f  "${CIRCLE_BRANCH}" origin/"${CIRCLE_BRANCH}" || true
       popd >/dev/null || exit 1
     else
       PATCH_OR_ISSUE="${CIRCLE_PULL_REQUEST}"
@@ -99,6 +101,15 @@ function circleci_finalreport
   add_footer_table "Console output" "${BUILD_URL}"
 }
 
+function circleci_pre_git_checkout
+{
+  pushd "${BASEDIR}" >/dev/null || exit 1
+  echo "Attempting to reset Circle CI's understanding of ${PATCH_BRANCH_DEFAULT}"
+  "${GIT}" branch --set-upstream-to=origin/"${PATCH_BRANCH_DEFAULT}" "${PATCH_BRANCH_DEFAULT}"
|| true
+  "${GIT}" branch -f "${PATCH_BRANCH_DEFAULT}" origin/"${PATCH_BRANCH_DEFAULT}" || true
+  popd >/dev/null || exit 1
+}
+
 #function circleci_unittest_footer
 #{
 #  declare statusjdk=$1
diff --git a/precommit/src/main/shell/test-patch.sh b/precommit/src/main/shell/test-patch.sh
index 05c6889..259d362 100755
--- a/precommit/src/main/shell/test-patch.sh
+++ b/precommit/src/main/shell/test-patch.sh
@@ -1107,6 +1107,12 @@ function git_checkout
 
   git_requires_creds
 
+  if [[ ${ROBOT} == true ]]; then
+    if declare -f "${ROBOTTYPE}"_pre_git_checkout >/dev/null; then
+      "${ROBOTTYPE}"_pre_git_checkout
+    fi
+  fi
+
   cd "${BASEDIR}" || cleanup_and_exit 1
   if [[ ! -e .git ]]; then
     yetus_error "ERROR: ${BASEDIR} is not a git repo."


Mime
View raw message