Skip to content

Commit b1be14b

Browse files
committed
Merge remote-tracking branch 'elastic/main' into skip-disi-metric-field
2 parents d8e66d4 + 0a5a74c commit b1be14b

File tree

756 files changed

+7956
-4906
lines changed

Some content is hidden

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

756 files changed

+7956
-4906
lines changed

.buildkite/pipelines/intake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ steps:
6565
timeout_in_minutes: 300
6666
matrix:
6767
setup:
68-
BWC_VERSION: ["8.18.6", "8.19.3", "9.0.6", "9.1.3", "9.2.0"]
68+
BWC_VERSION: ["8.18.6", "8.19.4", "9.0.6", "9.1.3", "9.2.0"]
6969
agents:
7070
provider: gcp
7171
image: family/elasticsearch-ubuntu-2404

.buildkite/pipelines/periodic-packaging.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ steps:
334334
env:
335335
BWC_VERSION: 8.18.6
336336

337-
- label: "{{matrix.image}} / 8.19.3 / packaging-tests-upgrade"
338-
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.19.3
337+
- label: "{{matrix.image}} / 8.19.4 / packaging-tests-upgrade"
338+
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.19.4
339339
timeout_in_minutes: 300
340340
matrix:
341341
setup:
@@ -348,7 +348,7 @@ steps:
348348
machineType: custom-16-32768
349349
buildDirectory: /dev/shm/bk
350350
env:
351-
BWC_VERSION: 8.19.3
351+
BWC_VERSION: 8.19.4
352352

353353
- label: "{{matrix.image}} / 9.0.6 / packaging-tests-upgrade"
354354
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v9.0.6

.buildkite/pipelines/periodic.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ steps:
363363
- signal_reason: agent_stop
364364
limit: 3
365365

366-
- label: 8.19.3 / bwc
367-
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.19.3#bwcTest
366+
- label: 8.19.4 / bwc
367+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.19.4#bwcTest
368368
timeout_in_minutes: 300
369369
agents:
370370
provider: gcp
@@ -373,7 +373,7 @@ steps:
373373
buildDirectory: /dev/shm/bk
374374
preemptible: true
375375
env:
376-
BWC_VERSION: 8.19.3
376+
BWC_VERSION: 8.19.4
377377
retry:
378378
automatic:
379379
- exit_status: "-1"
@@ -506,7 +506,7 @@ steps:
506506
setup:
507507
ES_RUNTIME_JAVA:
508508
- openjdk21
509-
BWC_VERSION: ["8.18.6", "8.19.3", "9.0.6", "9.1.3", "9.2.0"]
509+
BWC_VERSION: ["8.18.6", "8.19.4", "9.0.6", "9.1.3", "9.2.0"]
510510
agents:
511511
provider: gcp
512512
image: family/elasticsearch-ubuntu-2404
@@ -550,7 +550,7 @@ steps:
550550
ES_RUNTIME_JAVA:
551551
- openjdk21
552552
- openjdk23
553-
BWC_VERSION: ["8.18.6", "8.19.3", "9.0.6", "9.1.3", "9.2.0"]
553+
BWC_VERSION: ["8.18.6", "8.19.4", "9.0.6", "9.1.3", "9.2.0"]
554554
agents:
555555
provider: gcp
556556
image: family/elasticsearch-ubuntu-2404

.ci/bwcVersions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ BWC_VERSION:
1818
- "8.16.6"
1919
- "8.17.10"
2020
- "8.18.6"
21-
- "8.19.3"
21+
- "8.19.4"
2222
- "9.0.6"
2323
- "9.1.3"
2424
- "9.2.0"

.ci/snapshotBwcVersions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BWC_VERSION:
22
- "8.18.6"
3-
- "8.19.3"
3+
- "8.19.4"
44
- "9.0.6"
55
- "9.1.3"
66
- "9.2.0"

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

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -330,24 +330,22 @@ private static void configureEntitlements(Project project) {
330330
.matching(test -> TEST_TASKS_WITH_ENTITLEMENTS.contains(test.getName()))
331331
.configureEach(test -> {
332332
// See also SystemJvmOptions.maybeAttachEntitlementAgent.
333+
SystemPropertyCommandLineArgumentProvider nonInputSystemProperties = test.getExtensions()
334+
.getByType(SystemPropertyCommandLineArgumentProvider.class);
333335

334336
// Agent
335-
if (agentFiles.isEmpty() == false) {
336-
test.getInputs().files(agentFiles);
337-
test.systemProperty("es.entitlement.agentJar", agentFiles.getAsPath());
338-
test.systemProperty("jdk.attach.allowAttachSelf", true);
339-
}
337+
test.getInputs().files(agentFiles).optional(true);
338+
nonInputSystemProperties.systemProperty("es.entitlement.agentJar", agentFiles::getAsPath);
339+
nonInputSystemProperties.systemProperty("jdk.attach.allowAttachSelf", () -> agentFiles.isEmpty() ? "false" : "true");
340340

341341
// Bridge
342-
if (bridgeFiles.isEmpty() == false) {
343-
String modulesContainingEntitlementInstrumentation = "java.logging,java.net.http,java.naming,jdk.net";
344-
test.getInputs().files(bridgeFiles);
345-
// Tests may not be modular, but the JDK still is
346-
test.jvmArgs(
347-
"--add-exports=java.base/org.elasticsearch.entitlement.bridge=ALL-UNNAMED,"
348-
+ modulesContainingEntitlementInstrumentation
349-
);
350-
}
342+
String modulesContainingEntitlementInstrumentation = "java.logging,java.net.http,java.naming,jdk.net";
343+
test.getInputs().files(bridgeFiles).optional(true);
344+
// Tests may not be modular, but the JDK still is
345+
test.jvmArgs(
346+
"--add-exports=java.base/org.elasticsearch.entitlement.bridge=ALL-UNNAMED,"
347+
+ modulesContainingEntitlementInstrumentation
348+
);
351349
});
352350
}
353351

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.gradle.internal;
11+
12+
import org.gradle.api.Project;
13+
import org.gradle.api.provider.Provider;
14+
import org.gradle.api.provider.ProviderFactory;
15+
import org.gradle.api.services.BuildService;
16+
import org.gradle.api.services.BuildServiceParameters;
17+
18+
import java.util.Collection;
19+
import java.util.HashMap;
20+
import java.util.Map;
21+
22+
import javax.inject.Inject;
23+
24+
public abstract class ProjectSubscribeBuildService implements BuildService<BuildServiceParameters.None> {
25+
26+
private final ProviderFactory providerFactory;
27+
28+
/**
29+
* The filling of this map depends on the order of #registerProjectForTopic being called.
30+
* This is usually done during configuration phase, but we do not enforce yet the time of this method call.
31+
* The values are LinkedHashSet to preserve the order of registration mostly to provide a predicatable order
32+
* when running consecutive builds.
33+
* */
34+
private final Map<String, Collection<String>> versionsByTopic = new HashMap<>();
35+
36+
@Inject
37+
public ProjectSubscribeBuildService(ProviderFactory providerFactory) {
38+
this.providerFactory = providerFactory;
39+
}
40+
41+
/**
42+
* Returning a provider so the evaluation of the map value is deferred to when the provider is queried.
43+
* */
44+
public Provider<Collection<String>> getProjectsByTopic(String topic) {
45+
return providerFactory.provider(() -> versionsByTopic.computeIfAbsent(topic, k -> new java.util.LinkedHashSet<>()));
46+
}
47+
48+
public void registerProjectForTopic(String topic, Project project) {
49+
versionsByTopic.computeIfAbsent(topic, k -> new java.util.LinkedHashSet<>()).add(project.getPath());
50+
}
51+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.gradle.internal;
11+
12+
import org.gradle.api.Plugin;
13+
import org.gradle.api.Project;
14+
import org.gradle.api.provider.Provider;
15+
16+
/**
17+
* This plugin registers a {@link ProjectSubscribeBuildService} to allow projects to
18+
* communicate with each other during the configuration phase.
19+
*
20+
* For example, a project can register itself as a publisher of a topic, and other
21+
* projects can resolve projects that have registered as publishers of that topic.
22+
*
23+
* The actual resolution of whatever data is usually done using dependency declarations.
24+
* Be aware the state of the list depends on the order of project configuration and
25+
* consuming on configuration phase before task graph calculation phase should be avoided.
26+
*
27+
* We want to avoid discouraged plugin api usage like project.allprojects or project.subprojects
28+
* in plugins to avoid unnecessary configuration of projects and not break project isolation and break
29+
* See https://docs.gradle.org/current/userguide/isolated_projects.html
30+
* */
31+
public class ProjectSubscribeServicePlugin implements Plugin<Project> {
32+
33+
private Provider<ProjectSubscribeBuildService> publishSubscribe;
34+
35+
@Override
36+
public void apply(Project project) {
37+
publishSubscribe = project.getGradle().getSharedServices().registerIfAbsent("publishSubscribe", ProjectSubscribeBuildService.class);
38+
}
39+
40+
public Provider<ProjectSubscribeBuildService> getService() {
41+
return publishSubscribe;
42+
}
43+
44+
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public Path getDefinitionsDirectory() {
4444

4545
@TaskAction
4646
public void generateTransportVersionManifest() throws IOException {
47-
4847
Path definitionsDir = getDefinitionsDirectory();
4948
Path manifestFile = getManifestFile().get().getAsFile().toPath();
5049
try (var writer = Files.newBufferedWriter(manifestFile)) {

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,27 @@
99

1010
package org.elasticsearch.gradle.internal.transport;
1111

12+
import org.elasticsearch.gradle.internal.ProjectSubscribeServicePlugin;
1213
import org.elasticsearch.gradle.util.GradleUtils;
1314
import org.gradle.api.Plugin;
1415
import org.gradle.api.Project;
15-
import org.gradle.api.artifacts.Configuration;
1616
import org.gradle.api.tasks.SourceSet;
1717
import org.gradle.language.base.plugins.LifecycleBasePlugin;
1818

19+
import static org.elasticsearch.gradle.internal.transport.TransportVersionResourcesPlugin.TRANSPORT_REFERENCES_TOPIC;
20+
1921
public class TransportVersionReferencesPlugin implements Plugin<Project> {
2022

2123
@Override
2224
public void apply(Project project) {
2325
project.getPluginManager().apply(LifecycleBasePlugin.class);
2426

27+
project.getPlugins()
28+
.apply(ProjectSubscribeServicePlugin.class)
29+
.getService()
30+
.get()
31+
.registerProjectForTopic(TRANSPORT_REFERENCES_TOPIC, project);
32+
2533
var collectTask = project.getTasks()
2634
.register("collectTransportVersionReferences", CollectTransportVersionReferencesTask.class, t -> {
2735
t.setGroup("Transport Versions");
@@ -31,9 +39,7 @@ public void apply(Project project) {
3139
t.getOutputFile().set(project.getLayout().getBuildDirectory().file("transport-version/references.txt"));
3240
});
3341

34-
Configuration tvReferencesConfig = project.getConfigurations().create("transportVersionReferences", c -> {
35-
c.setCanBeConsumed(true);
36-
c.setCanBeResolved(false);
42+
var tvReferencesConfig = project.getConfigurations().consumable("transportVersionReferences", c -> {
3743
c.attributes(TransportVersionReference::addArtifactAttribute);
3844
});
3945
project.getArtifacts().add(tvReferencesConfig.getName(), collectTask);

0 commit comments

Comments
 (0)