Skip to content

Commit ad352b1

Browse files
committed
Merge branch 'main' of github.com:elastic/elasticsearch into additional-migration-info-for-ds-reindex
2 parents b56522f + 4974336 commit ad352b1

File tree

227 files changed

+7723
-923
lines changed

Some content is hidden

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

227 files changed

+7723
-923
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/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"

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
),

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616
import org.gradle.api.Task;
1717
import org.gradle.api.artifacts.Configuration;
1818
import org.gradle.api.artifacts.component.ModuleComponentIdentifier;
19+
import org.gradle.api.file.FileCollection;
1920
import org.gradle.api.tasks.TaskProvider;
2021

2122
import java.io.File;
2223
import java.nio.file.Path;
2324

2425
import static org.elasticsearch.gradle.internal.util.DependenciesUtils.createFileCollectionFromNonTransitiveArtifactsView;
26+
import static org.elasticsearch.gradle.internal.util.DependenciesUtils.thirdPartyDependenciesView;
2527
import static org.elasticsearch.gradle.internal.util.ParamsUtils.loadBuildParams;
2628

2729
public class ThirdPartyAuditPrecommitPlugin extends PrecommitPlugin {
@@ -47,7 +49,6 @@ public TaskProvider<? extends Task> createTask(Project project) {
4749
project.getDependencies().add(JDK_JAR_HELL_CONFIG_NAME, elasticsearchCoreProject);
4850
}
4951
}
50-
5152
TaskProvider<ExportElasticsearchBuildResourcesTask> resourcesTask = project.getTasks()
5253
.register("thirdPartyAuditResources", ExportElasticsearchBuildResourcesTask.class);
5354
Path resourcesDir = project.getBuildDir().toPath().resolve("third-party-audit-config");
@@ -59,9 +60,11 @@ public TaskProvider<? extends Task> createTask(Project project) {
5960
// usually only one task is created. but this construct makes our integTests easier to setup
6061
project.getTasks().withType(ThirdPartyAuditTask.class).configureEach(t -> {
6162
Configuration runtimeConfiguration = project.getConfigurations().getByName("runtimeClasspath");
63+
FileCollection runtimeThirdParty = thirdPartyDependenciesView(runtimeConfiguration);
6264
Configuration compileOnly = project.getConfigurations()
6365
.getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME);
64-
t.setClasspath(runtimeConfiguration.plus(compileOnly));
66+
FileCollection compileOnlyThirdParty = thirdPartyDependenciesView(compileOnly);
67+
t.getThirdPartyClasspath().from(runtimeThirdParty, compileOnlyThirdParty);
6568
t.getJarsToScan()
6669
.from(
6770
createFileCollectionFromNonTransitiveArtifactsView(
@@ -78,7 +81,7 @@ public TaskProvider<? extends Task> createTask(Project project) {
7881
t.getJavaHome().set(buildParams.flatMap(params -> params.getRuntimeJavaHome()).map(File::getPath));
7982
t.setSignatureFile(resourcesDir.resolve("forbidden/third-party-audit.txt").toFile());
8083
t.getJdkJarHellClasspath().from(jdkJarHellConfig);
81-
t.getForbiddenAPIsClasspath().from(project.getConfigurations().getByName("forbiddenApisCliJar").plus(compileOnly));
84+
t.getForbiddenAPIsClasspath().from(project.getConfigurations().getByName("forbiddenApisCliJar").plus(compileOnlyThirdParty));
8285
});
8386
return audit;
8487
}

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import org.gradle.api.JavaVersion;
1818
import org.gradle.api.file.ArchiveOperations;
1919
import org.gradle.api.file.ConfigurableFileCollection;
20-
import org.gradle.api.file.FileCollection;
2120
import org.gradle.api.file.FileSystemOperations;
2221
import org.gradle.api.file.FileTree;
2322
import org.gradle.api.file.ProjectLayout;
@@ -96,8 +95,6 @@ public abstract class ThirdPartyAuditTask extends DefaultTask {
9695

9796
private final ProjectLayout projectLayout;
9897

99-
private FileCollection classpath;
100-
10198
@Inject
10299
public ThirdPartyAuditTask(
103100
ArchiveOperations archiveOperations,
@@ -198,9 +195,7 @@ public Set<String> getMissingClassExcludes() {
198195
public abstract Property<JavaVersion> getRuntimeJavaVersion();
199196

200197
@Classpath
201-
public FileCollection getClasspath() {
202-
return classpath;
203-
}
198+
public abstract ConfigurableFileCollection getThirdPartyClasspath();
204199

205200
@TaskAction
206201
public void runThirdPartyAudit() throws IOException {
@@ -345,7 +340,7 @@ private String runForbiddenAPIsCli() throws IOException {
345340
if (javaHome.isPresent()) {
346341
spec.setExecutable(javaHome.get() + "/bin/java");
347342
}
348-
spec.classpath(getForbiddenAPIsClasspath(), classpath);
343+
spec.classpath(getForbiddenAPIsClasspath(), getThirdPartyClasspath());
349344
// Enable explicitly for each release as appropriate. Just JDK 20/21/22/23 for now, and just the vector module.
350345
if (isJavaVersion(VERSION_20) || isJavaVersion(VERSION_21) || isJavaVersion(VERSION_22) || isJavaVersion(VERSION_23)) {
351346
spec.jvmArgs("--add-modules", "jdk.incubator.vector");
@@ -383,7 +378,7 @@ private boolean isJavaVersion(JavaVersion version) {
383378
private Set<String> runJdkJarHellCheck() throws IOException {
384379
ByteArrayOutputStream standardOut = new ByteArrayOutputStream();
385380
ExecResult execResult = execOperations.javaexec(spec -> {
386-
spec.classpath(getJdkJarHellClasspath(), classpath);
381+
spec.classpath(getJdkJarHellClasspath(), getThirdPartyClasspath());
387382
spec.getMainClass().set(JDK_JAR_HELL_MAIN_CLASS);
388383
spec.args(getJarExpandDir());
389384
spec.setIgnoreExitValue(true);
@@ -402,8 +397,4 @@ private Set<String> runJdkJarHellCheck() throws IOException {
402397
return new TreeSet<>(Arrays.asList(jdkJarHellCheckList.split("\\r?\\n")));
403398
}
404399

405-
public void setClasspath(FileCollection classpath) {
406-
this.classpath = classpath;
407-
}
408-
409400
}

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

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@
99

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

12+
import com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin;
13+
1214
import org.gradle.api.artifacts.Configuration;
1315
import org.gradle.api.artifacts.ResolvableDependencies;
1416
import org.gradle.api.artifacts.component.ComponentIdentifier;
17+
import org.gradle.api.artifacts.component.ProjectComponentIdentifier;
1518
import org.gradle.api.artifacts.result.ResolvedComponentResult;
1619
import org.gradle.api.artifacts.result.ResolvedDependencyResult;
1720
import org.gradle.api.file.FileCollection;
21+
import org.gradle.api.provider.Provider;
1822
import org.gradle.api.specs.AndSpec;
1923
import org.gradle.api.specs.Spec;
2024

@@ -29,7 +33,7 @@ public static FileCollection createFileCollectionFromNonTransitiveArtifactsView(
2933
) {
3034
ResolvableDependencies incoming = configuration.getIncoming();
3135
return incoming.artifactView(viewConfiguration -> {
32-
Set<ComponentIdentifier> firstLevelDependencyComponents = incoming.getResolutionResult()
36+
Provider<Set<ComponentIdentifier>> firstLevelDependencyComponents = incoming.getResolutionResult()
3337
.getRootComponent()
3438
.map(
3539
rootComponent -> rootComponent.getDependencies()
@@ -39,12 +43,36 @@ public static FileCollection createFileCollectionFromNonTransitiveArtifactsView(
3943
.filter(dependency -> dependency.getSelected() instanceof ResolvedComponentResult)
4044
.map(dependency -> dependency.getSelected().getId())
4145
.collect(Collectors.toSet())
42-
)
43-
.get();
46+
);
4447
viewConfiguration.componentFilter(
45-
new AndSpec<>(identifier -> firstLevelDependencyComponents.contains(identifier), componentFilter)
48+
new AndSpec<>(identifier -> firstLevelDependencyComponents.get().contains(identifier), componentFilter)
4649
);
4750
}).getFiles();
4851
}
4952

53+
/**
54+
* This method gives us an artifact view of a configuration that filters out all
55+
* project dependencies that are not shadowed jars.
56+
* Basically a thirdparty only view of the dependency tree.
57+
*/
58+
public static FileCollection thirdPartyDependenciesView(Configuration configuration) {
59+
ResolvableDependencies incoming = configuration.getIncoming();
60+
return incoming.artifactView(v -> {
61+
// resolve componentIdentifier for all shadowed project dependencies
62+
Provider<Set<ComponentIdentifier>> shadowedDependencies = incoming.getResolutionResult()
63+
.getRootComponent()
64+
.map(
65+
root -> root.getDependencies()
66+
.stream()
67+
.filter(dep -> dep instanceof ResolvedDependencyResult)
68+
.map(dep -> (ResolvedDependencyResult) dep)
69+
.filter(dep -> dep.getResolvedVariant().getDisplayName() == ShadowBasePlugin.COMPONENT_NAME)
70+
.filter(dep -> dep.getSelected() instanceof ResolvedComponentResult)
71+
.map(dep -> dep.getSelected().getId())
72+
.collect(Collectors.toSet())
73+
);
74+
// filter out project dependencies if they are not a shadowed dependency
75+
v.componentFilter(i -> (i instanceof ProjectComponentIdentifier == false || shadowedDependencies.get().contains(i)));
76+
}).getFiles();
77+
}
5078
}

0 commit comments

Comments
 (0)