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

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


The following commit(s) were added to refs/heads/master by this push:
     new 090b71802bb Add artifact validation to run_rc_validation (#26407)
090b71802bb is described below

commit 090b71802bb9626877b1e590f63003c74cd8258e
Author: Danny McCormick <dannymccorm...@google.com>
AuthorDate: Thu Apr 27 13:08:00 2023 -0400

    Add artifact validation to run_rc_validation (#26407)
    
    * Add artifact validation to run_rc_validation
    
    * config file for artifacts
    
    * use java bom contents for validation
---
 release/src/main/scripts/run_rc_validation.sh | 28 ++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/release/src/main/scripts/run_rc_validation.sh 
b/release/src/main/scripts/run_rc_validation.sh
index 997525ef800..6d9e5aa783a 100755
--- a/release/src/main/scripts/run_rc_validation.sh
+++ b/release/src/main/scripts/run_rc_validation.sh
@@ -100,7 +100,6 @@ HUB_ARTIFACTS_NAME=hub-linux-amd64-${HUB_VERSION}
 BACKUP_BASHRC=.bashrc_backup_$(date +"%Y%m%d%H%M%S")
 BACKUP_M2=settings_backup_$(date +"%Y%m%d%H%M%S").xml
 declare -a PYTHON_VERSIONS_TO_VALIDATE=("python3.8")
-
 echo ""
 echo "====================Checking Environment & Variables================="
 echo "PLEASE update RC_VALIDATE_CONFIGS in file script.config first."
@@ -123,6 +122,33 @@ if [[ $confirmation != "y" ]]; then
   exit
 fi
 
+echo "----------------- Checking published Java artifacts (should take ~1 
minute) -----------------"
+
+java_bom=$(curl 
"${REPO_URL}/org/apache/beam/beam-sdks-java-bom/${RELEASE_VER}/beam-sdks-java-bom-${RELEASE_VER}.pom")
+artifacts=( $(echo $java_bom | grep -Eo "<artifactId>\S+?</artifactId>" | grep 
-Eo "beam-[a-zA-Z0-9.-]+") )
+if [ ${#artifacts[@]} == 0 ];
+then
+    echo "Couldn't find beam-sdks-java-bom in the generated java artifact."
+    echo "Please check ${REPO_URL} and try regenerating the java artifacts in 
the build_rc step."
+    exit 1
+fi
+
+FAILED=()
+for i in "${artifacts[@]}"
+do
+    curl "${REPO_URL}/org/apache/beam/${i}/${RELEASE_VER}" -f || FAILED+=($i)
+done
+if [ ${#FAILED[@]} != 0 ];
+then
+    echo "Failed to find the following artifacts in the generated java 
artifact, but they were present as dependencies in beam-sdks-java-bom:"
+    for i in "${FAILED[@]}"
+    do
+        echo "Artifact: ${i} - url: 
${REPO_URL}/org/apache/beam/${i}/${RELEASE_VER}"
+    done
+    echo "Please check ${REPO_URL} and try regenerating the java artifacts in 
the build_rc step."
+    exit 1
+fi
+
 echo "----------------- Checking git -----------------"
 if [[ -z ${GITHUB_TOKEN} ]]; then
   echo "Error: A Github personal access token is required to perform git push "

Reply via email to