Skip to content

Commit 6d81b01

Browse files
authored
[CI] Tag es-pr-check serverless build scans with original PR (#136257) (#136276)
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.
1 parent faf2695 commit 6d81b01

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

build-tools-internal/src/main/groovy/elasticsearch.build-scan.gradle

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import java.lang.management.ManagementFactory;
11-
import java.time.LocalDateTime;
1210

13-
import org.elasticsearch.gradle.Architecture
1411
import org.elasticsearch.gradle.OS
15-
import static org.elasticsearch.gradle.internal.util.CiUtils.safeName
16-
1712
import java.lang.management.ManagementFactory
1813
import java.time.LocalDateTime
14+
import org.elasticsearch.gradle.Architecture
15+
16+
import static org.elasticsearch.gradle.internal.util.CiUtils.safeName
1917

2018
// Resolving this early to avoid issues with the build scan plugin in combination with the configuration cache usage
2119
def taskNames = gradle.startParameter.taskNames.join(' ')
@@ -32,10 +30,10 @@ develocity {
3230
// Automatically publish scans from Elasticsearch CI
3331
if (onCI) {
3432
publishing.onlyIf { true }
35-
if(server.isPresent() == false) {
33+
if (server.isPresent() == false) {
3634
server = 'https://gradle-enterprise.elastic.co'
3735
}
38-
} else if( server.isPresent() == false) {
36+
} else if (server.isPresent() == false) {
3937
publishing.onlyIf { false }
4038
}
4139

@@ -99,6 +97,15 @@ develocity {
9997
tag 'pull-request'
10098
link 'Source', "${prBaseUrl}/tree/${System.getenv('BUILDKITE_COMMIT')}"
10199
link 'Pull Request', "https://github.com/${repository}/pull/${prId}"
100+
} else if (System.getenv('ELASTICSEARCH_PR_NUMBER')) {
101+
// For tracking es-pr-check failures in the serverless repo caused by elasticsearch PRs
102+
def esPr = System.getenv('ELASTICSEARCH_PR_NUMBER')
103+
def esCommit = System.getenv('ELASTICSEARCH_SUBMODULE_COMMIT')
104+
value 'Git Commit ID', esCommit
105+
tag "pr/${esPr}"
106+
tag 'pull-request'
107+
link 'Source', "https://github.com/elastic/elasticsearch/pull/${esPr}/commits/${esCommit}"
108+
link 'Pull Request', "https://github.com/elastic/elasticsearch/pull/${esPr}"
102109
} else {
103110
value 'Git Commit ID', gitRevision.get()
104111
link 'Source', "https://github.com/${repository}/tree/${gitRevision.get()}"

0 commit comments

Comments
 (0)