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

rhoughton pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 3a08e47  change CI to use merge not rebase (#7285)
3a08e47 is described below

commit 3a08e47e7c0a9051be142ad240660aef2aab689d
Author: Robert Houghton <[email protected]>
AuthorDate: Sat Mar 5 16:15:18 2022 -0800

    change CI to use merge not rebase (#7285)
    
    * change CI to use merge not rebase
    * apply shellchecks
---
 ci/pipelines/pull-request/jinja.template.yml |  6 ++-
 ci/scripts/repeat-new-tests.sh               | 16 +++----
 ci/scripts/shared_utilities.sh               | 71 +++++++++++++++++-----------
 3 files changed, 56 insertions(+), 37 deletions(-)

diff --git a/ci/pipelines/pull-request/jinja.template.yml 
b/ci/pipelines/pull-request/jinja.template.yml
index 8a3074b..834dbdb 100644
--- a/ci/pipelines/pull-request/jinja.template.yml
+++ b/ci/pipelines/pull-request/jinja.template.yml
@@ -130,7 +130,8 @@ jobs:
         version: every
         attempts: 2
         params:
-          integration_tool: rebase
+          integration_tool: merge
+          list_changed_files: true
       - get: geode-ci
         attempts: 2
       - get: {{ build_test.PLATFORM }}-builder-image-family
@@ -306,7 +307,8 @@ jobs:
         version: every
         attempts: 2
         params:
-          integration_tool: rebase
+          integration_tool: merge
+          list_changed_files: true
       - get: geode-ci
         attempts: 2
       - get: {{ test.PLATFORM }}-builder-image-family
diff --git a/ci/scripts/repeat-new-tests.sh b/ci/scripts/repeat-new-tests.sh
index 73fa648..7c34858 100755
--- a/ci/scripts/repeat-new-tests.sh
+++ b/ci/scripts/repeat-new-tests.sh
@@ -17,7 +17,7 @@
 # limitations under the License.
 #
 
-set -e
+set -eu
 
 SOURCE="${BASH_SOURCE[0]}"
 while [[ -h "$SOURCE" ]]; do # resolve $SOURCE until the file is no longer a 
symlink
@@ -27,7 +27,7 @@ while [[ -h "$SOURCE" ]]; do # resolve $SOURCE until the file 
is no longer a sym
 done
 SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
 
-. ${SCRIPTDIR}/shared_utilities.sh
+. "${SCRIPTDIR}/shared_utilities.sh"
 
 is_source_from_pr_testable "geode" "$(get_geode_pr_exclusion_dirs)" || exit 0
 
@@ -39,10 +39,10 @@ function changes_for_path() {
                       jq -r -c '.[]| select(.name == "base_sha") | .value') || 
exit $?
 
     if [[ "${mergeBase}" == "" ]]; then
-      echo "Could not determine merge base. Exiting..."
+      >&2 echo "Could not determine merge base. Exiting..."
       exit 1
     fi
-    git diff --name-only --diff-filter=ACMR ${mergeBase} -- $path
+    git diff --name-only --diff-filter=ACMR "${mergeBase}" -- $path
   popd >> /dev/null
 }
 
@@ -70,7 +70,7 @@ CHANGED_FILES_ARRAY=( $UNIT_TEST_CHANGES 
$INTEGRATION_TEST_CHANGES $DISTRIBUTED_
 NUM_CHANGED_FILES=${#CHANGED_FILES_ARRAY[@]}
 
 echo "${NUM_CHANGED_FILES} changed test files"
-for T in ${CHANGED_FILES_ARRAY[@]}; do
+for T in "${CHANGED_FILES_ARRAY[@]}"; do
   echo "  ${T}"
 done
 
@@ -82,8 +82,8 @@ fi
 
 save_classpath
 
-TEST_TARGETS=$(create_gradle_test_targets ${CHANGED_FILES_ARRAY[@]})
-TEST_COUNT=$(echo ${TEST_TARGETS} | sed -e 's/.*testCount=\([0-9]*\).*/\1/g')
+TEST_TARGETS=$(create_gradle_test_targets "${CHANGED_FILES_ARRAY[@]}")
+TEST_COUNT=$(echo "${TEST_TARGETS}" | sed -e 's/.*testCount=\([0-9]*\).*/\1/g')
 
 if [[ "${NUM_CHANGED_FILES}" -ne "${TEST_COUNT}" ]]
 then
@@ -103,5 +103,5 @@ export GRADLE_TASK_OPTIONS="-Prepeat=50 
-PfailOnNoMatchingTests=false"
 echo "GRADLE_TASK_OPTIONS=${GRADLE_TASK_OPTIONS}"
 echo "GRADLE_TASK=${GRADLE_TASK}"
 
-${SCRIPTDIR}/execute_tests.sh
+"${SCRIPTDIR}/execute_tests.sh"
 
diff --git a/ci/scripts/shared_utilities.sh b/ci/scripts/shared_utilities.sh
index 9283986..c3ca492 100644
--- a/ci/scripts/shared_utilities.sh
+++ b/ci/scripts/shared_utilities.sh
@@ -19,15 +19,16 @@
 find-here-test-reports() {
   output_directories_file=${1}
   set +e
-  find . -type d -name "reports" > ${output_directories_file}
-  find .  -type d -name "test-results" >> ${output_directories_file}
-  (find . -type d -name "*Test" | grep "build/[^/]*Test$") >> 
${output_directories_file}
-  find . -name "*-progress*txt" >> ${output_directories_file}
-  find . -name "*.hprof" -o -name "hs_err*.log" -o -name "replay*.log" >> 
${output_directories_file}
-  find . -type d -name "callstacks" >> ${output_directories_file}
-  find .gradle_logs -name '*.log' >> ${output_directories_file}
+  find . -type d -name "reports" > "${output_directories_file}"
+  # shellcheck disable=SC2129
+  find .  -type d -name "test-results" >> "${output_directories_file}"
+  (find . -type d -name "*Test" | grep "build/[^/]*Test$") >> 
"${output_directories_file}"
+  find . -name "*-progress*txt" >> "${output_directories_file}"
+  find . -name "*.hprof" -o -name "hs_err*.log" -o -name "replay*.log" >> 
"${output_directories_file}"
+  find . -type d -name "callstacks" >> "${output_directories_file}"
+  find .gradle_logs -name '*.log' >> "${output_directories_file}"
   echo "Collecting the following artifacts..."
-  cat ${output_directories_file}
+  cat "${output_directories_file}"
   echo ""
 }
 
@@ -38,7 +39,7 @@ get-geode-version() {
   # Prune all after '-', yielding e.g., "1.14.0"
   local GEODE_PRODUCT_VERSION=${CONCOURSE_VERSION%%-*}
   (>&2 echo "Geode product VERSION is ${GEODE_PRODUCT_VERSION}")
-  echo ${GEODE_PRODUCT_VERSION}
+  echo "${GEODE_PRODUCT_VERSION}"
 }
 
 get-geode-version-qualifier-slug() {
@@ -47,38 +48,43 @@ get-geode-version-qualifier-slug() {
   local CONCOURSE_BUILD_SLUG=${CONCOURSE_VERSION##*-}
   # Prune all before '.', yielding e.g., "build"
   local QUALIFIER_SLUG=${CONCOURSE_BUILD_SLUG%%.*}
-  echo ${QUALIFIER_SLUG}
+  echo "${QUALIFIER_SLUG}"
 }
 
 get-geode-build-id() {
   local CONCOURSE_VERSION=$1
   # Prune all before the last '.', yielding e.g., "325"
   local BUILD_ID=${CONCOURSE_VERSION##*.}
-  echo ${BUILD_ID}
+  echo "${BUILD_ID}"
 }
 
 get-geode-build-id-padded() {
-  local CONCOURSE_VERSION=$1
-  local BUILD_ID=$(get-geode-build-id ${CONCOURSE_VERSION})
+  local CONCOURSE_VERSION="${1}"
+  local BUILD_ID;
+  BUILD_ID=$(get-geode-build-id "${CONCOURSE_VERSION}")
   # Prune all before the last '.', yielding e.g., "325", then zero-pad, e.g., 
"0325"
-  local PADDED_BUILD_ID=$(printf "%04d" ${BUILD_ID})
+  local PADDED_BUILD_ID
+  PADDED_BUILD_ID=$(printf "%04d" "${BUILD_ID}")
   (>&2 echo "Build ID is ${PADDED_BUILD_ID}")
-  echo ${PADDED_BUILD_ID}
+  echo "${PADDED_BUILD_ID}"
 }
 
 get-full-version() {
   # Extract each component so that the BuildId can be zero-padded, then 
reassembled.
   local CONCOURSE_VERSION=$1
-  local GEODE_PRODUCT_VERSION=$(get-geode-version ${CONCOURSE_VERSION})
-  local QUALIFIER_SLUG=$(get-geode-version-qualifier-slug ${CONCOURSE_VERSION})
-  local PADDED_BUILD_ID=$(get-geode-build-id-padded ${CONCOURSE_VERSION})
+  local GEODE_PRODUCT_VERSION
+  GEODE_PRODUCT_VERSION=$(get-geode-version "${CONCOURSE_VERSION}")
+  local QUALIFIER_SLUG
+  QUALIFIER_SLUG=$(get-geode-version-qualifier-slug "${CONCOURSE_VERSION}")
+  local PADDED_BUILD_ID
+  PADDED_BUILD_ID=$(get-geode-build-id-padded "${CONCOURSE_VERSION}")
   local 
FULL_PRODUCT_VERSION="${GEODE_PRODUCT_VERSION}-${QUALIFIER_SLUG}.${PADDED_BUILD_ID}"
   (>&2 echo "Full product VERSION is ${FULL_PRODUCT_VERSION}")
-  echo ${FULL_PRODUCT_VERSION}
+  echo "${FULL_PRODUCT_VERSION}"
 }
 
 get_geode_pr_exclusion_dirs() {
-  local exclude_dirs="ci dev-tools etc geode-book geode-docs"
+  local exclude_dirs="ci dev-tools etc geode-book geode-docs CODEOWNERS"
   echo "${exclude_dirs}"
 }
 
@@ -93,20 +99,29 @@ is_source_from_pr_testable() {
     return 0;
   fi
 
+  # shellcheck disable=SC2164
   pushd "${repo_dir}" 2>&1 >> /dev/null
-    local base_dir=$(git rev-parse --show-toplevel)
-    local github_pr_dir="${base_dir}/.git/resource"
-    pushd ${base_dir} 2>&1 >> /dev/null
+    local base_dir
+    base_dir=$(git rev-parse --show-toplevel)
+    local github_pr_dir
+    github_pr_dir="${base_dir}/.git/resource"
+    # shellcheck disable=SC2164
+    pushd "${base_dir}" 2>&1 >> /dev/null
       local return_code=0
       if [ -d "${github_pr_dir}" ]; then
         # Modify this path list with directories to exclude
         local exclude_dirs="${2}"
+        local exclude_pathspec=""
         for d in $(echo ${exclude_dirs}); do
-          local exclude_pathspec="${exclude_pathspec} :(exclude,glob)${d}/**"
+          exclude_pathspec="${exclude_pathspec} :(exclude,glob)${d}/**"
         done
-        pushd ${base_dir} &> /dev/null
-          local files=$(git diff --name-only $(cat 
"${github_pr_dir}/base_sha") $(cat "${github_pr_dir}/head_sha") -- . $(echo 
${exclude_pathspec}))
-        popd &> /dev/null
+        # shellcheck disable=SC2164
+        pushd "${base_dir}" 2>&1 >> /dev/null
+          local files
+          # shellcheck disable=SC2046
+          files=$(git diff --name-only "$(cat "${github_pr_dir}/base_sha")" -- 
. $(echo "${exclude_pathspec}"))
+        # shellcheck disable=SC2164
+        popd 2>&1 >> /dev/null
         if [[ -z "${files}" ]]; then
           >&2 echo "CI changes only, skipping tests..."
           return_code=1
@@ -116,7 +131,9 @@ is_source_from_pr_testable() {
       else
         >&2 echo "Running tests..."
       fi
+    # shellcheck disable=SC2164
     popd 2>&1 >> /dev/null
+  # shellcheck disable=SC2164
   popd 2>&1 >> /dev/null
   return ${return_code}
 }

Reply via email to