From 56ad6cbfb37dfdff94a1f3bb7c3f64ec8bcf8823 Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Thu, 9 Oct 2025 13:35:52 +0200 Subject: [PATCH] [CI] Tag es-pr-check serverless build scans with original PR (#136257) These are serverless builds that run in the context of an elasticsearch PR. Therfore we want to keep the context in the generated build scans. --- .../groovy/elasticsearch.build-scan.gradle | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/build-tools-internal/src/main/groovy/elasticsearch.build-scan.gradle b/build-tools-internal/src/main/groovy/elasticsearch.build-scan.gradle index ebb33dbe06884..c6496d89dc642 100644 --- a/build-tools-internal/src/main/groovy/elasticsearch.build-scan.gradle +++ b/build-tools-internal/src/main/groovy/elasticsearch.build-scan.gradle @@ -7,15 +7,13 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import java.lang.management.ManagementFactory; -import java.time.LocalDateTime; -import org.elasticsearch.gradle.Architecture import org.elasticsearch.gradle.OS -import static org.elasticsearch.gradle.internal.util.CiUtils.safeName - import java.lang.management.ManagementFactory import java.time.LocalDateTime +import org.elasticsearch.gradle.Architecture + +import static org.elasticsearch.gradle.internal.util.CiUtils.safeName // Resolving this early to avoid issues with the build scan plugin in combination with the configuration cache usage def taskNames = gradle.startParameter.taskNames.join(' ') @@ -32,10 +30,10 @@ develocity { // Automatically publish scans from Elasticsearch CI if (onCI) { publishing.onlyIf { true } - if(server.isPresent() == false) { + if (server.isPresent() == false) { server = 'https://gradle-enterprise.elastic.co' } - } else if( server.isPresent() == false) { + } else if (server.isPresent() == false) { publishing.onlyIf { false } } @@ -99,6 +97,15 @@ develocity { tag 'pull-request' link 'Source', "${prBaseUrl}/tree/${System.getenv('BUILDKITE_COMMIT')}" link 'Pull Request', "https://github.com/${repository}/pull/${prId}" + } else if (System.getenv('ELASTICSEARCH_PR_NUMBER')) { + // For tracking es-pr-check failures in the serverless repo caused by elasticsearch PRs + def esPr = System.getenv('ELASTICSEARCH_PR_NUMBER') + def esCommit = System.getenv('ELASTICSEARCH_SUBMODULE_COMMIT') + value 'Git Commit ID', esCommit + tag "pr/${esPr}" + tag 'pull-request' + link 'Source', "https://github.com/elastic/elasticsearch/pull/${esPr}/commits/${esCommit}" + link 'Pull Request', "https://github.com/elastic/elasticsearch/pull/${esPr}" } else { value 'Git Commit ID', gitRevision.get() link 'Source', "https://github.com/${repository}/tree/${gitRevision.get()}"