From fcc5d37dcfc9310e34d50cde110e4aa8aed7cfe3 Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Wed, 7 Aug 2024 19:33:29 +0200 Subject: [PATCH] [Gradle] Add buildkite ci validation script for configuration cache (#110269) We see gradle cache incompatibilities sneaking into our code base. Until we can enable this feature by default we should regular run checks existing configuration cache achievements are not degrading. This change includes: - updating spotless gradle plugin to configuration cache compatible version (its still BETA but imo good enough for our needs) --- ...on.sh => gradle-build-cache-validation.sh} | 5 ++-- .../gradle-configuration-cache-validation.sh | 27 +++++++++++++++++++ .../ElasticsearchBuildCompletePlugin.java | 12 ++++++++- x-pack/plugin/esql/build.gradle | 6 +++-- x-pack/plugin/esql/compute/build.gradle | 4 ++- 5 files changed, 48 insertions(+), 6 deletions(-) rename .buildkite/scripts/{gradle-cache-validation.sh => gradle-build-cache-validation.sh} (97%) create mode 100755 .buildkite/scripts/gradle-configuration-cache-validation.sh diff --git a/.buildkite/scripts/gradle-cache-validation.sh b/.buildkite/scripts/gradle-build-cache-validation.sh similarity index 97% rename from .buildkite/scripts/gradle-cache-validation.sh rename to .buildkite/scripts/gradle-build-cache-validation.sh index fbb957bc3b26b..75dc9b264b8bc 100755 --- a/.buildkite/scripts/gradle-cache-validation.sh +++ b/.buildkite/scripts/gradle-build-cache-validation.sh @@ -12,17 +12,18 @@ curl -s -L -O https://github.com/gradle/gradle-enterprise-build-validation-scrip tmpOutputFile=$(mktemp) trap "rm $tmpOutputFile" EXIT +set +e gradle-enterprise-gradle-build-validation/03-validate-local-build-caching-different-locations.sh -r https://github.com/elastic/elasticsearch.git -b $BUILDKITE_BRANCH --gradle-enterprise-server https://gradle-enterprise.elastic.co -t precommit --fail-if-not-fully-cacheable | tee $tmpOutputFile - # Capture the return value retval=$? +set -e # Now read the content from the temporary file into a variable perfOutput=$(cat $tmpOutputFile | sed -n '/Performance Characteristics/,/See https:\/\/gradle.com\/bvs\/main\/Gradle.md#performance-characteristics for details./p' | sed '$d' | sed 's/\x1b\[[0-9;]*m//g') investigationOutput=$(cat $tmpOutputFile | sed -n '/Investigation Quick Links/,$p' | sed 's/\x1b\[[0-9;]*m//g') # Initialize HTML output variable -summaryHtml="

Performance Characteristics

" +summaryHtml="

Build Cache Performance Characteristics

" summaryHtml+="