From f83f2a79fbdb8eabd176e7d0a2eb90679bcd947c Mon Sep 17 00:00:00 2001 From: AJ Schmidt Date: Mon, 16 May 2022 16:12:32 -0400 Subject: [PATCH 1/3] update rapids-build-type for new pattern --- tools/rapids-build-type | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/tools/rapids-build-type b/tools/rapids-build-type index 5019023..9093091 100755 --- a/tools/rapids-build-type +++ b/tools/rapids-build-type @@ -16,19 +16,12 @@ if [[ "${IS_NIGHTLY}" = "true" ]]; then echo_build_type "nightly" fi -# PR build from organization members: -# For these builds, GIT_BRANCH is equal to "PR-" -# i.e. PR-784 -if [[ "${GIT_BRANCH}" =~ ^PR-[0-9]+$ ]]; then - echo_build_type "pull-request" -fi - -# PR build from external contributors (non-organization members): -# For these builds, GIT_BRANCH is equal to "external-pr-" -# i.e. external-pr-784 +# PR builds: +# For these builds, GIT_BRANCH is equal to "pull-request/" +# i.e. pull-request/784 # Technically these builds are branch builds since we copy the # forked code to the source repository. -if [[ "${GIT_BRANCH}" =~ ^external-pr-[0-9]+$ ]]; then +if [[ "${GIT_BRANCH}" =~ ^pull-request/[0-9]+$ ]]; then echo_build_type "pull-request" fi From f2af5cb352d22ceeac0b219f91643f4ac8b5e577 Mon Sep 17 00:00:00 2001 From: AJ Schmidt Date: Mon, 23 May 2022 16:47:36 -0400 Subject: [PATCH 2/3] update rapids-s3-path for new pattern --- tools/rapids-s3-path | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/rapids-s3-path b/tools/rapids-s3-path index 2b36e0a..9b39d07 100755 --- a/tools/rapids-s3-path +++ b/tools/rapids-s3-path @@ -22,9 +22,9 @@ esac BUILD_TYPE=$(rapids-build-type) case "${BUILD_TYPE}" in pull-request) - # For PRs, $GIT_BRANCH is either like: - # PR-989 or external-pr-989 - S3_DIRECTORY_ID="${GIT_BRANCH##*-}" + # For PRs, $GIT_BRANCH is like: + # pull-request/989 + S3_DIRECTORY_ID="${GIT_BRANCH##*/}" S3_PREFIX="ci" ;; branch) From 78f3e840428be2cb08df8b143a1e5ef9469be95e Mon Sep 17 00:00:00 2001 From: AJ Schmidt Date: Mon, 23 May 2022 16:47:47 -0400 Subject: [PATCH 3/3] update rapids-size-checker for new pattern --- tools/rapids-size-checker | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/tools/rapids-size-checker b/tools/rapids-size-checker index e9fb790..daa4292 100755 --- a/tools/rapids-size-checker +++ b/tools/rapids-size-checker @@ -1,26 +1,21 @@ #!/bin/bash set -e -# CHANGE_TARGET is provided by PR builds. -# It's not set for branch builds (i.e. external PRs) -BASE_BRANCH=${CHANGE_TARGET:-""} REPO_NAME=$(basename "${GIT_URL}" .git) ORG_NAME=$(basename "$(dirname "${GIT_URL}")") -if [ -z "$BASE_BRANCH" ]; then - echo "Retrieving base branch from GitHub API:" - # For PRs, $GIT_BRANCH is either like: - # PR-989 or external-pr-989 - PR_NUM="${GIT_BRANCH##*-}" - [[ -n "$GH_TOKEN" ]] && CURL_HEADERS=('-H' "Authorization: token ${GH_TOKEN}") - RESP=$( - curl \ - -H "Accept: application/vnd.github.v3+json" \ - "${CURL_HEADERS[@]}" \ - "https://api.github.com/repos/${ORG_NAME}/${REPO_NAME}/pulls/${PR_NUM}" - ) - BASE_BRANCH=$(echo "${RESP}" | jq -r '.base.ref') -fi +echo "Retrieving base branch from GitHub API:" +# For PRs, $GIT_BRANCH is like: +# pull-request/989 +PR_NUM="${GIT_BRANCH##*/}" +[[ -n "$GH_TOKEN" ]] && CURL_HEADERS=('-H' "Authorization: token ${GH_TOKEN}") +RESP=$( +curl \ + -H "Accept: application/vnd.github.v3+json" \ + "${CURL_HEADERS[@]}" \ + "https://api.github.com/repos/${ORG_NAME}/${REPO_NAME}/pulls/${PR_NUM}" +) +BASE_BRANCH=$(echo "${RESP}" | jq -r '.base.ref') DIFF_FILES=$(mktemp) LARGE_FILES=$(mktemp) @@ -37,6 +32,7 @@ conda activate rapids git fetch origin git diff --name-only origin/"${BASE_BRANCH}"..HEAD > "${DIFF_FILES}" +echo "### Comparing ${BASE_BRANCH} to HEAD:" echo '### Files modified in current PR' while read -r FILE; do echo "Size check ${FILE}"