Skip to content

Commit 8c5f744

Browse files
authored
Merge branch 'main' into migrate-docs
2 parents 341ba7c + 731a412 commit 8c5f744

File tree

1,310 files changed

+40484
-16173
lines changed

Some content is hidden

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

1,310 files changed

+40484
-16173
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
steps:
2+
- label: $FWC_VERSION / fwc
3+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v$FWC_VERSION#fwcTest -Dtests.bwc.snapshot=false
4+
timeout_in_minutes: 300
5+
agents:
6+
provider: gcp
7+
image: family/elasticsearch-ubuntu-2004
8+
machineType: n1-standard-32
9+
buildDirectory: /dev/shm/bk
10+
preemptible: true
11+
matrix:
12+
setup:
13+
FWC_VERSION: $FWC_LIST
14+
env:
15+
FWC_VERSION: $FWC_VERSION
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is auto-generated. See .buildkite/pipelines/periodic-fwc.template.yml
2+
steps:
3+
- label: "{{matrix.FWC_VERSION}} / fwc"
4+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v$$FWC_VERSION#fwcTest -Dtests.bwc.snapshot=false
5+
timeout_in_minutes: 300
6+
agents:
7+
provider: gcp
8+
image: family/elasticsearch-ubuntu-2004
9+
machineType: n1-standard-32
10+
buildDirectory: /dev/shm/bk
11+
preemptible: true
12+
matrix:
13+
setup:
14+
FWC_VERSION: []
15+
env:
16+
FWC_VERSION: "{{matrix.FWC_VERSION}}"

.buildkite/scripts/branches.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22

33
# This determines which branches will have pipelines triggered periodically, for dra workflows.
44
BRANCHES=( $(cat branches.json | jq -r '.branches[].branch') )
5+
6+
# Sort them to make ordering predictable
7+
IFS=$'\n' BRANCHES=($(sort <<<"${BRANCHES[*]}"))
8+
unset IFS

.buildkite/scripts/periodic.trigger.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,15 @@ EOF
4646
branch: "$BRANCH"
4747
commit: "$LAST_GOOD_COMMIT"
4848
EOF
49+
# Include forward compatibility tests only for the bugfix branch
50+
if [[ "${BRANCH}" == "${BRANCHES[2]}" ]]; then
51+
cat <<EOF
52+
- trigger: elasticsearch-periodic-fwc
53+
label: Trigger periodic-fwc pipeline for $BRANCH
54+
async: true
55+
build:
56+
branch: "$BRANCH"
57+
commit: "$LAST_GOOD_COMMIT"
58+
EOF
59+
fi
4960
done

benchmarks/src/main/java/org/elasticsearch/benchmark/indices/resolution/IndexNameExpressionResolverBenchmark.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.elasticsearch.cluster.metadata.IndexMetadata;
1818
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
1919
import org.elasticsearch.cluster.metadata.Metadata;
20+
import org.elasticsearch.cluster.project.DefaultProjectResolver;
2021
import org.elasticsearch.common.settings.Settings;
2122
import org.elasticsearch.common.util.concurrent.ThreadContext;
2223
import org.elasticsearch.index.Index;
@@ -84,7 +85,11 @@ public void setUp() {
8485
}
8586
int mid = indices.length / 2;
8687
clusterState = ClusterState.builder(ClusterName.DEFAULT).metadata(mb).build();
87-
resolver = new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY), new SystemIndices(List.of()));
88+
resolver = new IndexNameExpressionResolver(
89+
new ThreadContext(Settings.EMPTY),
90+
new SystemIndices(List.of()),
91+
DefaultProjectResolver.INSTANCE
92+
);
8893
indexListRequest = new Request(IndicesOptions.lenientExpandOpenHidden(), indices);
8994
starRequest = new Request(IndicesOptions.lenientExpandOpenHidden(), "*");
9095
String[] mixed = indices.clone();

benchmarks/src/main/java/org/elasticsearch/benchmark/routing/allocation/AllocationBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public void setUp() throws Exception {
138138
Metadata metadata = mb.build();
139139
RoutingTable.Builder rb = RoutingTable.builder(TestShardRoutingRoleStrategies.DEFAULT_ROLE_ONLY);
140140
for (int i = 1; i <= numIndices; i++) {
141-
rb.addAsNew(metadata.index("test_" + i));
141+
rb.addAsNew(metadata.getProject().index("test_" + i));
142142
}
143143
RoutingTable routingTable = rb.build();
144144
DiscoveryNodes.Builder nb = DiscoveryNodes.builder();
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
import org.elasticsearch.gradle.VersionProperties
11+
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
12+
13+
def fwcVersions = buildParams.bwcVersions.released.findAll { it.major == VersionProperties.elasticsearchVersion.major && it.minor == VersionProperties.elasticsearchVersion.minor }
14+
def previousMinorSnapshot = buildParams.bwcVersions.unreleased.find { it.major == VersionProperties.elasticsearchVersion.major && it.minor == VersionProperties.elasticsearchVersion.minor - 1 }
15+
16+
fwcVersions.each { fwcVersion ->
17+
tasks.register("v${fwcVersion}#fwcTest", StandaloneRestIntegTestTask) {
18+
usesBwcDistribution(previousMinorSnapshot)
19+
usesBwcDistribution(fwcVersion)
20+
systemProperty("tests.old_cluster_version", previousMinorSnapshot)
21+
systemProperty("tests.new_cluster_version", fwcVersion)
22+
nonInputProperties.systemProperty 'tests.fwc', 'true'
23+
}
24+
}
25+
26+
gradle.taskGraph.whenReady { graph ->
27+
if (graph.allTasks.any { it.name.endsWith('#fwcTest') } && Boolean.parseBoolean(System.getProperty("tests.bwc.snapshot", "true"))) {
28+
throw new GradleException("Running forward compatibility tests requires passing `-Dtests.bwc.snapshot=false`.")
29+
}
30+
31+
if (graph.allTasks.any { it.name.endsWith('#fwcTest') } && graph.allTasks.any { it.name.endsWith('#bwcTest') }) {
32+
throw new GradleException("Backward compatibility and forward compatibility tests cannot be executed in the same build.")
33+
}
34+
}

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,23 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
145145
}
146146
}
147147

148-
// modifies the idea module config to enable preview features on ':libs:native' module
148+
// modifies the idea module config to enable preview features on module that need them
149149
tasks.register("enablePreviewFeatures", EnablePreviewFeaturesTask) {
150150
group = 'ide'
151-
description = 'Enables preview features on native library module'
151+
description = 'Enables preview features on modules that need them'
152152
dependsOn tasks.named("enableExternalConfiguration")
153153
doLast {
154154
enablePreview('.idea/modules/libs/native/elasticsearch.libs.native.main.iml', 'JDK_21_PREVIEW')
155155
enablePreview('.idea/modules/libs/native/elasticsearch.libs.native.test.iml', 'JDK_21_PREVIEW')
156+
// due to org.elasticsearch.plugins.PluginsLoader
157+
enablePreview('.idea/modules/server/elasticsearch.server.main.iml', 'JDK_21_PREVIEW')
158+
enablePreview('.idea/modules/server/elasticsearch.server.test.iml', 'JDK_21_PREVIEW')
156159
enablePreview('.idea/modules/libs/entitlement/elasticsearch.libs.entitlement.main.iml', 'JDK_21_PREVIEW')
157160
enablePreview('.idea/modules/libs/entitlement/elasticsearch.libs.entitlement.test.iml', 'JDK_21_PREVIEW')
158161
enablePreview('.idea/modules/libs/entitlement/bridge/elasticsearch.libs.entitlement.bridge.main.iml', 'JDK_21_PREVIEW')
159162
enablePreview('.idea/modules/libs/entitlement/bridge/elasticsearch.libs.entitlement.bridge.test.iml', 'JDK_21_PREVIEW')
163+
enablePreview('.idea/modules/libs/entitlement/qa/entitlement-test-plugin/elasticsearch.libs.entitlement.qa.entitlement-test-plugin.main.iml', 'JDK_21_PREVIEW')
164+
enablePreview('.idea/modules/libs/entitlement/qa/entitlement-test-plugin/elasticsearch.libs.entitlement.qa.entitlement-test-plugin.test.iml', 'JDK_21_PREVIEW')
160165
}
161166
}
162167

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,14 @@ public void execute(Task task) {
145145
loggedExec.args("-DisCI");
146146
}
147147

148-
loggedExec.args("-Dbuild.snapshot=true", "-Dscan.tag.NESTED");
148+
loggedExec.args("-Dscan.tag.NESTED");
149+
150+
if (System.getProperty("tests.bwc.snapshot", "true").equals("false")) {
151+
loggedExec.args("-Dbuild.snapshot=false", "-Dlicense.key=x-pack/plugin/core/snapshot.key");
152+
} else {
153+
loggedExec.args("-Dbuild.snapshot=true");
154+
}
155+
149156
final LogLevel logLevel = project.getGradle().getStartParameter().getLogLevel();
150157
List<LogLevel> nonDefaultLogLevels = Arrays.asList(LogLevel.QUIET, LogLevel.WARN, LogLevel.INFO, LogLevel.DEBUG);
151158
if (nonDefaultLogLevels.contains(logLevel)) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,9 @@ static void createBuildBwcTask(
355355
String bwcTaskName = buildBwcTaskName(projectName);
356356
bwcSetupExtension.bwcTask(bwcTaskName, c -> {
357357
boolean useNativeExpanded = projectArtifact.expandedDistDir != null;
358+
boolean isReleaseBuild = System.getProperty("tests.bwc.snapshot", "true").equals("false");
358359
File expectedOutputFile = useNativeExpanded
359-
? new File(projectArtifact.expandedDistDir, "elasticsearch-" + bwcVersion.get() + "-SNAPSHOT")
360+
? new File(projectArtifact.expandedDistDir, "elasticsearch-" + bwcVersion.get() + (isReleaseBuild ? "" : "-SNAPSHOT"))
360361
: projectArtifact.distFile;
361362
c.getInputs().file(new File(project.getBuildDir(), "refspec")).withPathSensitivity(PathSensitivity.RELATIVE);
362363
if (useNativeExpanded) {

0 commit comments

Comments
 (0)