adoroszlai commented on a change in pull request #2479:
URL: https://github.com/apache/ozone/pull/2479#discussion_r683186329



##########
File path: dev-support/ci/selective_ci_checks.sh
##########
@@ -0,0 +1,470 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# shellcheck source=dev-support/ci/lib/_script_init.sh
+. dev-support/ci/lib/_script_init.sh
+
+# Parameter:
+#
+# $1 - COMMIT SHA of the incoming commit. If this parameter is missing, this 
script does not check anything,
+#      it simply sets all the version outputs that determine that all tests 
should be run.
+#      This happens in case the event triggering the workflow is 'schedule' or 
'push'.
+#
+# The logic of retrieving changes works by comparing the incoming commit with 
the target branch
+# the commit addresses.
+#
+#
+declare -a pattern_array ignore_array
+
+ignore_array=(
+    "/README.md" # exclude root README
+)
+
+function check_for_full_tests_needed_label() {
+    start_end::group_start "Check for PR label"
+    if [[ ${PR_LABELS=} == *"full tests needed"* ]]; then
+        echo
+        echo "Found PR label 'full tests needed' in '${PR_LABELS=}'"
+        echo
+        FULL_TESTS_NEEDED_LABEL="true"
+    else
+        echo
+        echo "Did not find PR label 'full tests needed' in '${PR_LABELS=}'"
+        echo
+        FULL_TESTS_NEEDED_LABEL="false"
+    fi
+    start_end::group_end
+}
+
+function get_changed_files() {
+    start_end::group_start "Get changed files"
+
+    echo
+    echo "Incoming commit SHA: ${INCOMING_COMMIT_SHA}"
+    echo
+
+    CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r \
+        "${INCOMING_COMMIT_SHA}~1" "${INCOMING_COMMIT_SHA}" || true)

Review comment:
       Yes, they are the same.  `^` is a special char for zsh, so I tend to 
prefer `~1`, although it does not matter in this script, as it uses bash.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to