Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: skip heavy checks in Release Please SNAPSHOT pull requests #11323

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ case ${JOB_TYPE} in
;;
integration)
generate_modified_modules_list
if [[ ${#modified_module_list[@]} -gt 0 ]]; then
if [[ "$(release_please_snapshot_pull_request)" == "true" ]]; then
echo "Skipping integration tests as this is Release Please SNAPSHOT pull request."
elif [[ ${#modified_module_list[@]} -gt 0 ]]; then
module_list=$(
IFS=,
echo "${modified_module_list[*]}"
Expand All @@ -68,14 +70,20 @@ case ${JOB_TYPE} in
;;
graalvm-presubmit)
generate_graalvm_presubmit_modules_list
printf "Running GraalVM presubmit checks for:\n%s\n" "${module_list}"
setup_cloud "$module_list"
install_modules "$module_list"
run_graalvm_tests "$module_list"
if [[ "$(release_please_snapshot_pull_request)" == "true" ]]; then
echo "Not running GraalVM checks -- this is Release Please SNAPSHOT pull request."
else
printf "Running GraalVM presubmit checks for:\n%s\n" "${module_list}"
setup_cloud "$module_list"
install_modules "$module_list"
run_graalvm_tests "$module_list"
fi
;;
graalvm)
generate_graalvm_modules_list
if [ ! -z "${module_list}" ]; then
if [[ "$(release_please_snapshot_pull_request)" == "true" ]]; then
echo "Not running GraalVM checks -- this is Release Please SNAPSHOT pull request."
elif [ ! -z "${module_list}" ]; then
printf "Running GraalVM checks for:\n%s\n" "${module_list}"
setup_cloud "$module_list"
install_modules "$module_list"
Expand Down
15 changes: 15 additions & 0 deletions .kokoro/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,21 @@ function setup_cloud() {
trap destroy EXIT
}

# Prints "true" if this pull pull request is made by Release Please
# SNAPSHOT pull request.
# If a CI runs on a Release Please SNAPSHOT pull request, there's no point in running
# integration tests because it only changes the versions in pom.xml and we merge
# the pull requests without any additional changes (b/370011322).
function release_please_snapshot_pull_request() {
# Example value: "+google-cloud-java:1.48.0:1.49.0-SNAPSHOT"
changedLine=$(git diff origin/main -- versions.txt 2>/dev/null | grep '^+google-cloud-java:')
if [[ "$changedLine" =~ "SNAPSHOT"$ ]]; then
echo "true"
else
echo "false"
fi
}

function generate_modified_modules_list() {
# Find the files changed from when the PR branched to the last commit
# Filter for java modules and get all the unique elements
Expand Down
Loading