From df4385efe0bf0a7eff35ae31a6dadaff3299fa22 Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Mon, 16 Oct 2023 19:55:45 +0000 Subject: [PATCH] chore: add java-shared-config to safe.directory and mark docker validation check as required (#688) * test: troubleshoot kokoro docker image for validate docker check * add git config command as recommended * remove unused arg * remove debugging statements; mark check as required --- .github/sync-repo-settings.yaml | 1 + .kokoro/verify-docker-images.sh | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index cda3df63..c7db3648 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -36,6 +36,7 @@ branchProtectionRules: - "Kokoro - Test: Integration" - "Kokoro - Test: Java GraalVM Native Image" - "Kokoro - Test: Java 17 GraalVM Native Image" + - "Kokoro - Test: Docker Image Validation" - "dependencies (11, java-bigquery)" - "dependencies (11, java-spanner)" - "dependencies (11, java-storage)" diff --git a/.kokoro/verify-docker-images.sh b/.kokoro/verify-docker-images.sh index 3f15d3a2..794f7a8d 100755 --- a/.kokoro/verify-docker-images.sh +++ b/.kokoro/verify-docker-images.sh @@ -8,6 +8,8 @@ function fetch_image_names() { echo "$imageNames" } +git config --global --add safe.directory /tmpfs/src/github/java-shared-config + # Get the directory of the build script scriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")") # cd to the parent directory, i.e. the root of the git repo @@ -16,8 +18,8 @@ cd ${scriptDir}/.. || exit # Fetch the java-shared-config version in source of the current commit. javaSharedConfigVersion="$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" -branchName=$(git name-rev "$KOKORO_GIT_COMMIT" | sed 's/.* //') -gitCommitMessage=$(git log -1 "$(git rev-parse --short "$KOKORO_GIT_COMMIT")" | grep "chore(main): release *") +branchName=$(git name-rev "${KOKORO_GIT_COMMIT}" | sed 's/.* //') +gitCommitMessage=$(git log -1 "$(git rev-parse --short "${KOKORO_GIT_COMMIT}")" | grep "chore(main): release *") # GraalVM docker images are not tagged with SNAPSHOT versions. if [[ "${branchName}" == *"release-please--branches--main"* ]] && [[ ! $gitCommitMessage =~ "SNAPSHOT" ]]; then