From c6ba468dd3e57541a0bdf8533fc335afabf3d162 Mon Sep 17 00:00:00 2001 From: piyush kumar sadangi Date: Thu, 14 Mar 2024 15:38:37 +0530 Subject: [PATCH] test: shallowClone in checkstyle-tester with SHA checkout --- .ci/validation.sh | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/.ci/validation.sh b/.ci/validation.sh index a07dd2c81ce..5a7da8b3e52 100755 --- a/.ci/validation.sh +++ b/.ci/validation.sh @@ -889,12 +889,26 @@ no-exception-struts) CS_POM_VERSION="$(getCheckstylePomVersion)" BRANCH=$(git rev-parse --abbrev-ref HEAD) echo CS_version: "${CS_POM_VERSION}" - checkout_from https://github.com/checkstyle/contribution - cd .ci-temp/contribution/checkstyle-tester + checkout_from https://github.com/relentless-pursuit/contribution + cd .ci-temp/contribution + echo "Current directory: $(pwd)" + echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" + echo "Fetching remote branches..." + git fetch origin + echo "Available remote branches:" + git branch -r + echo "Fetching shallowClone branch..." + git fetch origin refs/heads/shallowClone:refs/remotes/origin/shallowClone + echo "Checking out shallowClone branch..." + git checkout shallowClone + echo "Current branch after checkout: $(git rev-parse --abbrev-ref HEAD)" + cd checkstyle-tester + echo "Current directory: $(pwd)" sed -i'' 's/^guava/#guava/' projects-to-test-on.properties sed -i'' 's/#apache-struts/apache-struts/' projects-to-test-on.properties groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \ --patchConfig checks-nonjavadoc-error.xml -p "$BRANCH" -r ../../.. \ + --useShallowClone \ --allowExcludes --mode single -xm "-Dcheckstyle.failsOnError=false" cd ../../ removeFolderWithProtectedFiles contribution @@ -1030,8 +1044,21 @@ no-exception-Pmd-elasticsearch-lombok-ast) CS_POM_VERSION="$(getCheckstylePomVersion)" BRANCH=$(git rev-parse --abbrev-ref HEAD) echo CS_version: "${CS_POM_VERSION}" - checkout_from https://github.com/checkstyle/contribution - cd .ci-temp/contribution/checkstyle-tester + checkout_from https://github.com/relentless-pursuit/contribution + cd .ci-temp/contribution + echo "Current directory: $(pwd)" + echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" + echo "Fetching remote branches..." + git fetch origin + echo "Available remote branches:" + git branch -r + echo "Fetching shallowClone branch..." + git fetch origin refs/heads/shallowClone:refs/remotes/origin/shallowClone + echo "Checking out shallowClone branch..." + git checkout shallowClone + echo "Current branch after checkout: $(git rev-parse --abbrev-ref HEAD)" + cd checkstyle-tester + echo "Current directory: $(pwd)" sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties sed -i.'' 's/#pmd/pmd/' projects-to-test-on.properties sed -i.'' 's/#elasticsearch/elasticsearch/' projects-to-test-on.properties