zentol commented on a change in pull request #12708: URL: https://github.com/apache/flink/pull/12708#discussion_r442363712
########## File path: tools/azure-pipelines/build_properties.sh ########## @@ -0,0 +1,44 @@ +#!/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. + + +# +# Returns 0 if the change is a documentation-only pull request +# +function is_docs_only_pullrequest() { + # check if it is a pull request: + if [[ ! $BUILD_SOURCEBRANCHNAME == ci_* ]] ; then + return 1 + fi + PR_ID=`echo "$BUILD_SOURCEBRANCHNAME" | cut -f2 -d_` + if ! [[ "$PR_ID" =~ ^[0-9]+$ ]] ; then + echo "ERROR: Extracted PR_ID is not a number, but this: '$PR_ID'" + return 1 + fi + # check if it is docs only pull request: + CHANGES=`curl --silent "https://api.github.com/repos/apache/flink/pulls/$PR_ID/files" | jq -r ".[].filename"` Review comment: This can fail in surprising ways if the GitHub view of the machines that this script and ci-bot run on differ. E.g., PR contains commit only changing docs, another commit is added that changes something else -> ci-bot mirrors PR -> the CI machines sees the old state, before the new commit was added. This doesn't even seem that unlikely given that the machines are located in different continents. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org