Skip to content

Commit 8c4a4e3

Browse files
authored
Merge branch 'main' into api-redirects
2 parents 0a55e2a + 74f37d1 commit 8c4a4e3

File tree

764 files changed

+19523
-3981
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

764 files changed

+19523
-3981
lines changed

.buildkite/pipelines/intake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ steps:
5656
timeout_in_minutes: 300
5757
matrix:
5858
setup:
59-
BWC_VERSION: ["8.16.2", "8.17.1", "8.18.0", "9.0.0"]
59+
BWC_VERSION: ["8.16.3", "8.17.1", "8.18.0", "9.0.0"]
6060
agents:
6161
provider: gcp
6262
image: family/elasticsearch-ubuntu-2004

.buildkite/pipelines/periodic-packaging.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ steps:
287287
env:
288288
BWC_VERSION: 8.15.5
289289

290-
- label: "{{matrix.image}} / 8.16.2 / packaging-tests-upgrade"
291-
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.16.2
290+
- label: "{{matrix.image}} / 8.16.3 / packaging-tests-upgrade"
291+
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.16.3
292292
timeout_in_minutes: 300
293293
matrix:
294294
setup:
@@ -301,7 +301,7 @@ steps:
301301
machineType: custom-16-32768
302302
buildDirectory: /dev/shm/bk
303303
env:
304-
BWC_VERSION: 8.16.2
304+
BWC_VERSION: 8.16.3
305305

306306
- label: "{{matrix.image}} / 8.17.1 / packaging-tests-upgrade"
307307
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.17.1

.buildkite/pipelines/periodic-platform-support.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ steps:
6363
image:
6464
- almalinux-8-aarch64
6565
- ubuntu-2004-aarch64
66+
- ubuntu-2404-aarch64
6667
GRADLE_TASK:
6768
- checkPart1
6869
- checkPart2

.buildkite/pipelines/periodic.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ steps:
306306
- signal_reason: agent_stop
307307
limit: 3
308308

309-
- label: 8.16.2 / bwc
310-
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.16.2#bwcTest
309+
- label: 8.16.3 / bwc
310+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.16.3#bwcTest
311311
timeout_in_minutes: 300
312312
agents:
313313
provider: gcp
@@ -316,7 +316,7 @@ steps:
316316
buildDirectory: /dev/shm/bk
317317
preemptible: true
318318
env:
319-
BWC_VERSION: 8.16.2
319+
BWC_VERSION: 8.16.3
320320
retry:
321321
automatic:
322322
- exit_status: "-1"
@@ -448,7 +448,7 @@ steps:
448448
setup:
449449
ES_RUNTIME_JAVA:
450450
- openjdk21
451-
BWC_VERSION: ["8.16.2", "8.17.1", "8.18.0", "9.0.0"]
451+
BWC_VERSION: ["8.16.3", "8.17.1", "8.18.0", "9.0.0"]
452452
agents:
453453
provider: gcp
454454
image: family/elasticsearch-ubuntu-2004
@@ -490,7 +490,7 @@ steps:
490490
ES_RUNTIME_JAVA:
491491
- openjdk21
492492
- openjdk23
493-
BWC_VERSION: ["8.16.2", "8.17.1", "8.18.0", "9.0.0"]
493+
BWC_VERSION: ["8.16.3", "8.17.1", "8.18.0", "9.0.0"]
494494
agents:
495495
provider: gcp
496496
image: family/elasticsearch-ubuntu-2004

.ci/bwcVersions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ BWC_VERSION:
1515
- "8.13.4"
1616
- "8.14.3"
1717
- "8.15.5"
18-
- "8.16.2"
18+
- "8.16.3"
1919
- "8.17.1"
2020
- "8.18.0"
2121
- "9.0.0"

.ci/init.gradle

Lines changed: 2 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,3 @@
1-
import com.bettercloud.vault.VaultConfig
2-
import com.bettercloud.vault.Vault
3-
4-
initscript {
5-
repositories {
6-
mavenCentral()
7-
}
8-
dependencies {
9-
classpath 'com.bettercloud:vault-java-driver:4.1.0'
10-
}
11-
}
12-
13-
boolean USE_ARTIFACTORY = false
14-
15-
if (System.getenv('VAULT_ADDR') == null) {
16-
// When trying to reproduce errors outside of CI, it can be useful to allow this to just return rather than blowing up
17-
if (System.getenv('CI') == null) {
18-
return
19-
}
20-
21-
throw new GradleException("You must set the VAULT_ADDR environment variable to use this init script.")
22-
}
23-
24-
if (System.getenv('VAULT_ROLE_ID') == null && System.getenv('VAULT_SECRET_ID') == null && System.getenv('VAULT_TOKEN') == null) {
25-
// When trying to reproduce errors outside of CI, it can be useful to allow this to just return rather than blowing up
26-
if (System.getenv('CI') == null) {
27-
return
28-
}
29-
30-
throw new GradleException("You must set either the VAULT_ROLE_ID and VAULT_SECRET_ID environment variables, " +
31-
"or the VAULT_TOKEN environment variable to use this init script.")
32-
}
33-
34-
final String vaultPathPrefix = System.getenv('VAULT_ADDR') ==~ /.+vault-ci.+\.dev.*/ ? "secret/ci/elastic-elasticsearch/migrated" : "secret/elasticsearch-ci"
35-
36-
final String vaultToken = System.getenv('VAULT_TOKEN') ?: new Vault(
37-
new VaultConfig()
38-
.address(System.env.VAULT_ADDR)
39-
.engineVersion(1)
40-
.build()
41-
)
42-
.withRetries(5, 1000)
43-
.auth()
44-
.loginByAppRole("approle", System.env.VAULT_ROLE_ID, System.env.VAULT_SECRET_ID)
45-
.getAuthClientToken()
46-
47-
final Vault vault = new Vault(
48-
new VaultConfig()
49-
.address(System.env.VAULT_ADDR)
50-
.engineVersion(1)
51-
.token(vaultToken)
52-
.build()
53-
)
54-
.withRetries(5, 1000)
55-
56-
57-
if (USE_ARTIFACTORY) {
58-
final Map<String, String> artifactoryCredentials = vault.logical()
59-
.read("${vaultPathPrefix}/artifactory.elstc.co")
60-
.getData()
61-
logger.info("Using elastic artifactory repos")
62-
Closure configCache = {
63-
return {
64-
name "artifactory-gradle-release"
65-
url "https://artifactory.elstc.co/artifactory/gradle-release"
66-
credentials {
67-
username artifactoryCredentials.get("username")
68-
password artifactoryCredentials.get("token")
69-
}
70-
}
71-
}
72-
settingsEvaluated { settings ->
73-
settings.pluginManagement {
74-
repositories {
75-
maven configCache()
76-
}
77-
}
78-
}
79-
projectsLoaded {
80-
allprojects {
81-
buildscript {
82-
repositories {
83-
maven configCache()
84-
}
85-
}
86-
repositories {
87-
maven configCache()
88-
}
89-
}
90-
}
91-
}
92-
931
gradle.settingsEvaluated { settings ->
942
settings.pluginManager.withPlugin("com.gradle.develocity") {
953
settings.develocity {
@@ -98,14 +6,10 @@ gradle.settingsEvaluated { settings ->
986
}
997
}
1008

101-
1029
final String buildCacheUrl = System.getProperty('org.elasticsearch.build.cache.url')
10310
final boolean buildCachePush = Boolean.valueOf(System.getProperty('org.elasticsearch.build.cache.push', 'false'))
10411

10512
if (buildCacheUrl) {
106-
final Map<String, String> buildCacheCredentials = System.getenv("GRADLE_BUILD_CACHE_USERNAME") ? [:] : vault.logical()
107-
.read("${vaultPathPrefix}/gradle-build-cache")
108-
.getData()
10913
gradle.settingsEvaluated { settings ->
11014
settings.buildCache {
11115
local {
@@ -116,11 +20,10 @@ if (buildCacheUrl) {
11620
url = buildCacheUrl
11721
push = buildCachePush
11822
credentials {
119-
username = System.getenv("GRADLE_BUILD_CACHE_USERNAME") ?: buildCacheCredentials.get("username")
120-
password = System.getenv("GRADLE_BUILD_CACHE_PASSWORD") ?: buildCacheCredentials.get("password")
23+
username = System.getenv("GRADLE_BUILD_CACHE_USERNAME")
24+
password = System.getenv("GRADLE_BUILD_CACHE_PASSWORD")
12125
}
12226
}
12327
}
12428
}
12529
}
126-

.ci/snapshotBwcVersions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
BWC_VERSION:
2-
- "8.16.2"
2+
- "8.16.3"
33
- "8.17.1"
44
- "8.18.0"
55
- "9.0.0"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,6 @@ testfixtures_shared/
6969
# Generated
7070
checkstyle_ide.xml
7171
x-pack/plugin/esql/src/main/generated-src/generated/
72+
73+
# JEnv
74+
.java-version

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

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@ allprojects {
2424
}
2525
}
2626

27+
interface Injected {
28+
@Inject FileSystemOperations getFs()
29+
}
30+
2731
// Applying this stuff, particularly the idea-ext plugin, has a cost so avoid it unless we're running in the IDE
2832
if (providers.systemProperty('idea.active').getOrNull() == 'true') {
2933
project.apply(plugin: org.jetbrains.gradle.ext.IdeaExtPlugin)
3034

3135
def elasticsearchProject = locateElasticsearchWorkspace(gradle)
3236

37+
def rootFolder = project.rootDir
3338
tasks.register('configureIdeCheckstyle') {
3439
group = 'ide'
3540
description = 'Generated a suitable checkstyle config for IDEs'
@@ -39,10 +44,10 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
3944
String checkstyleConfig = "${resources}/checkstyle.xml"
4045
String checkstyleSuppressions = "${resources}/checkstyle_suppressions.xml"
4146
String checkstyleIdeFragment = "${resources}/checkstyle_ide_fragment.xml"
42-
String checkstyleIdeConfig = "${rootDir}/checkstyle_ide.xml"
47+
String checkstyleIdeConfig = "${rootFolder}/checkstyle_ide.xml"
4348

4449
String checkstylePluginConfigTemplate = "${resources}/checkstyle-idea.xml"
45-
String checkstylePluginConfig = "${rootDir}/.idea/checkstyle-idea.xml"
50+
String checkstylePluginConfig = "${rootFolder}/.idea/checkstyle-idea.xml"
4651

4752
inputs.files(
4853
file(checkstyleConfig),
@@ -53,31 +58,33 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
5358
file(checkstyleIdeConfig),
5459
file(checkstylePluginConfig)
5560
)
61+
def injected = project.objects.newInstance(Injected)
5662

63+
def projectFolder = project.layout.projectDirectory.asFile
5764
doLast {
5865
// Configure the IntelliJ Checkstyle plugin by copying a standard file. We don't simply commit
5966
// the result to version control, because the plugin has a habit of modifying the file and
6067
// replacing the `$PROJECT_DIR$` placeholders, which developers must then revert.
61-
project.copy {
68+
injected.fs.copy {
6269
from(checkstylePluginConfigTemplate)
63-
into("${rootDir}/.idea")
70+
into("${rootFolder}/.idea")
6471
expand(jarLocation: buildConventionsJar, configLocation: checkstyleIdeConfig)
6572
}
6673

6774
// Create an IDE-specific checkstyle config by first copying the standard config
6875
Files.copy(
69-
Paths.get(file(checkstyleConfig).getPath()),
70-
Paths.get(file(checkstyleIdeConfig).getPath()),
76+
Paths.get(new File(checkstyleConfig).getPath()),
77+
Paths.get(new File(checkstyleIdeConfig).getPath()),
7178
StandardCopyOption.REPLACE_EXISTING
7279
)
7380

7481
// There are some rules that we only want to enable in an IDE. These
7582
// are extracted to a separate file, and merged into the IDE-specific
7683
// Checkstyle config.
77-
Node xmlFragment = parseXml(checkstyleIdeFragment)
84+
Node xmlFragment = IdeaXmlUtil.parseXml(checkstyleIdeFragment)
7885

7986
// Edit the copy so that IntelliJ can copy with it
80-
modifyXml(checkstyleIdeConfig, { xml ->
87+
IdeaXmlUtil.modifyXml(checkstyleIdeConfig, { xml ->
8188
// Add all the nodes from the fragment file
8289
Node treeWalker = xml.module.find { it.'@name' == 'TreeWalker' }
8390
xmlFragment.module.each { treeWalker.append(it) }
@@ -103,7 +110,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
103110
description = 'Configures the appropriate JVM for Gradle'
104111

105112
doLast {
106-
modifyXml('.idea/gradle.xml') { xml ->
113+
IdeaXmlUtil.modifyXml('.idea/gradle.xml') { xml ->
107114
def gradleSettings = xml.component.find { it.'@name' == 'GradleSettings' }.option[0].GradleProjectSettings
108115
// Remove configured JVM option to force IntelliJ to use the project JDK for Gradle
109116
gradleSettings.option.findAll { it.'@name' == 'gradleJvm' }.each { it.parent().remove(it) }
@@ -127,7 +134,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
127134
description = 'Enable per-module *.iml files'
128135

129136
doLast {
130-
modifyXml('.idea/misc.xml') {xml ->
137+
IdeaXmlUtil.modifyXml('.idea/misc.xml') {xml ->
131138
def externalStorageConfig = xml.component.find { it.'@name' == 'ExternalStorageConfigurationManager' }
132139
if (externalStorageConfig) {
133140
xml.remove(externalStorageConfig)
@@ -142,13 +149,13 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
142149
description = 'Enables preview features on native library module'
143150
dependsOn tasks.named("enableExternalConfiguration")
144151

145-
ext {
146-
enablePreview = { moduleFile, languageLevel ->
147-
modifyXml(moduleFile) { xml ->
152+
// ext {
153+
def enablePreview = { moduleFile, languageLevel ->
154+
IdeaXmlUtil.modifyXml(moduleFile) { xml ->
148155
xml.component.find { it.'@name' == 'NewModuleRootManager' }?.'@LANGUAGE_LEVEL' = languageLevel
149156
}
150157
}
151-
}
158+
// }
152159

153160
doLast {
154161
enablePreview('.idea/modules/libs/native/elasticsearch.libs.native.main.iml', 'JDK_21_PREVIEW')
@@ -278,33 +285,37 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
278285
* @param preface optional front matter to add after the XML declaration
279286
* but before the XML document, e.g. a doctype or comment
280287
*/
281-
void modifyXml(Object path, Action<? super Node> action, String preface = null) {
282-
if (project.file(path).exists()) {
283-
Node xml = parseXml(path)
284-
action.execute(xml)
285-
286-
File xmlFile = project.file(path)
287-
xmlFile.withPrintWriter { writer ->
288-
def printer = new XmlNodePrinter(writer)
289-
printer.namespaceAware = true
290-
printer.preserveWhitespace = true
291-
writer.write("<?xml version=\"1.0\"?>\n")
292-
293-
if (preface != null) {
294-
writer.write(preface)
288+
289+
class IdeaXmlUtil {
290+
static Node parseXml(Object xmlPath) {
291+
File xmlFile = new File(xmlPath)
292+
XmlParser xmlParser = new XmlParser(false, true, true)
293+
xmlParser.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false)
294+
Node xml = xmlParser.parse(xmlFile)
295+
return xml
296+
}
297+
298+
static void modifyXml(Object xmlPath, Action<? super Node> action, String preface = null) {
299+
File xmlFile = new File(xmlPath)
300+
if (xmlFile.exists()) {
301+
Node xml = parseXml(xmlPath)
302+
action.execute(xml)
303+
304+
xmlFile.withPrintWriter { writer ->
305+
def printer = new XmlNodePrinter(writer)
306+
printer.namespaceAware = true
307+
printer.preserveWhitespace = true
308+
writer.write("<?xml version=\"1.0\"?>\n")
309+
310+
if (preface != null) {
311+
writer.write(preface)
312+
}
313+
printer.print(xml)
295314
}
296-
printer.print(xml)
297315
}
298316
}
299317
}
300318

301-
Node parseXml(Object path) {
302-
File xmlFile = project.file(path)
303-
XmlParser xmlParser = new XmlParser(false, true, true)
304-
xmlParser.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false)
305-
Node xml = xmlParser.parse(xmlFile)
306-
return xml
307-
}
308319

309320
Pair<File, IncludedBuild> locateElasticsearchWorkspace(Gradle gradle) {
310321
if (gradle.parent == null) {

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/DockerBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public enum DockerBase {
2222
// Chainguard based wolfi image with latest jdk
2323
// This is usually updated via renovatebot
2424
// spotless:off
25-
WOLFI("docker.elastic.co/wolfi/chainguard-base:latest@sha256:1b51ff6dba78c98d3e02b0cd64a8ce3238c7a40408d21e3af12a329d44db6f23",
25+
WOLFI("docker.elastic.co/wolfi/chainguard-base:latest@sha256:bfdeddb33330a281950c2a54adef991dbbe6a42832bc505d13b11beaf50ae73f",
2626
"-wolfi",
2727
"apk"
2828
),

0 commit comments

Comments
 (0)