Skip to content

Commit b0a99be

Browse files
committed
Merge branch 'main' into port-qa-legacy-projects
# Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/RestrictedBuildApiService.java
2 parents fa60625 + 13110d7 commit b0a99be

File tree

99 files changed

+1919
-429
lines changed

Some content is hidden

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

99 files changed

+1919
-429
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
5656
map.put(LegacyRestTestBasePlugin.class, ":qa:remote-clusters");
5757
map.put(LegacyRestTestBasePlugin.class, ":qa:repository-multi-version");
5858
map.put(LegacyRestTestBasePlugin.class, ":qa:rolling-upgrade-legacy");
59-
map.put(LegacyRestTestBasePlugin.class, ":qa:verify-version-constants");
6059
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-apm-integration");
6160
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-delayed-aggs");
6261
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-die-with-dignity");

docs/build.gradle

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import org.elasticsearch.gradle.Version
2+
import org.elasticsearch.gradle.VersionProperties
23
import org.elasticsearch.gradle.internal.doc.DocSnippetTask
34
import static org.elasticsearch.gradle.testclusters.TestDistribution.DEFAULT
45

@@ -2059,3 +2060,29 @@ setups['setup-snapshots'] = setups['setup-repository'] + '''
20592060
setups['atomic_red_regsvr32'].replace('#atomic_red_data#', events)
20602061
}
20612062
}
2063+
2064+
tasks.register('verifyDocsLuceneVersion') {
2065+
doFirst {
2066+
File docsVersionsFile = file('Versions.asciidoc')
2067+
List<String> versionLines = docsVersionsFile.readLines('UTF-8')
2068+
String docsLuceneVersion = null
2069+
for (String line : versionLines) {
2070+
if (line.startsWith(':lucene_version:')) {
2071+
docsLuceneVersion = line.split()[1]
2072+
}
2073+
}
2074+
if (docsLuceneVersion == null) {
2075+
throw new GradleException('Could not find lucene version in docs version file')
2076+
}
2077+
String expectedLuceneVersion = VersionProperties.lucene
2078+
// remove potential -snapshot-{gitrev} suffix
2079+
expectedLuceneVersion -= ~/-snapshot-[0-9a-f]+$/
2080+
if (docsLuceneVersion != expectedLuceneVersion) {
2081+
throw new GradleException("Lucene version in docs [${docsLuceneVersion}] does not match version.properties [${expectedLuceneVersion}]")
2082+
}
2083+
}
2084+
}
2085+
2086+
tasks.named('check') {
2087+
dependsOn 'verifyDocsLuceneVersion'
2088+
}

docs/changelog/125239.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 125239
2+
summary: Adding common rerank options to Perform Inference API
3+
area: Machine Learning
4+
type: enhancement
5+
issues:
6+
- 111273

docs/changelog/125529.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 125529
2+
summary: Store arrays offsets for boolean fields natively with synthetic source
3+
area: Mapping
4+
type: enhancement
5+
issues: []

docs/changelog/125595.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 125595
2+
summary: Esql - Fix lucene push down behavior when a range contains nanos and millis
3+
area: ES|QL
4+
type: bug
5+
issues: []

docs/changelog/125606.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
pr: 125606
2+
summary: Rename deprecation index template
3+
area: Infra/Logging
4+
type: breaking
5+
issues:
6+
- 125445
7+
breaking:
8+
title: Rename deprecation index template
9+
area: Logging
10+
details: The deprecation datastream contains log entries for deprecations that
11+
occured while Elasticsearch is running. The deprecation log entries had a
12+
mismatch in their dataset name. In order to avoid changing the dataset
13+
name in the existing datastream, a new datastream now exists.
14+
impact: If querying for deprecations previously using the
15+
`.logs-deprecation.elasticsearch-default` datastream, you should now use the
16+
`.logs-elasticsearch.deprecation-default` datastream.
17+
notable: false

qa/smoke-test-ingest-with-all-dependencies/src/yamlRestTest/resources/rest-api-spec/test/ingest/80_ingest_simulate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,9 +840,9 @@ setup:
840840

841841
- do:
842842
allowed_warnings:
843-
- "index template [test-composable-1] has index patterns [foo*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [test-composable-1] will take precedence during new index creation"
843+
- "index template [foo_index_template] has index patterns [foo*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [foo_index_template] will take precedence during new index creation"
844844
indices.put_index_template:
845-
name: test-composable-1
845+
name: foo_index_template
846846
body:
847847
index_patterns:
848848
- foo*

qa/verify-version-constants/build.gradle

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

10-
import org.elasticsearch.gradle.VersionProperties
1110
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
1211

13-
apply plugin: 'elasticsearch.internal-testclusters'
14-
apply plugin: 'elasticsearch.standalone-rest-test'
12+
apply plugin: 'elasticsearch.internal-java-rest-test'
1513
apply plugin: 'elasticsearch.bwc-test'
1614

17-
dependencies {
18-
testImplementation project(':modules:rest-root')
19-
}
20-
2115
buildParams.bwcVersions.withIndexCompatible { bwcVersion, baseName ->
22-
def baseCluster = testClusters.register(baseName) {
23-
version = bwcVersion.toString()
24-
setting 'xpack.security.enabled', 'true'
25-
user username: 'admin', password: 'admin-password', role: 'superuser'
26-
}
27-
28-
tasks.register("${baseName}#integTest", StandaloneRestIntegTestTask) {
29-
useCluster baseCluster
30-
nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c -> c.allHttpSocketURI.join(",")))
31-
nonInputProperties.systemProperty('tests.clustername', "${->baseCluster.get().getName()}")
32-
}
33-
34-
tasks.register(bwcTaskName(bwcVersion)) {
35-
dependsOn "${baseName}#integTest"
16+
tasks.register(bwcTaskName(bwcVersion), StandaloneRestIntegTestTask) {
17+
usesBwcDistribution(bwcVersion)
18+
systemProperty 'tests.cluster_version', bwcVersion
3619
}
3720
}
38-
39-
tasks.register("verifyDocsLuceneVersion") {
40-
doFirst {
41-
File docsVersionsFile = layout.settingsDirectory.file('docs/Versions.asciidoc').asFile
42-
List<String> versionLines = docsVersionsFile.readLines('UTF-8')
43-
String docsLuceneVersion = null
44-
for (String line : versionLines) {
45-
if (line.startsWith(':lucene_version:')) {
46-
docsLuceneVersion = line.split()[1]
47-
}
48-
}
49-
if (docsLuceneVersion == null) {
50-
throw new GradleException('Could not find lucene version in docs version file')
51-
}
52-
String expectedLuceneVersion = VersionProperties.lucene
53-
// remove potential -snapshot-{gitrev} suffix
54-
expectedLuceneVersion -= ~/-snapshot-[0-9a-f]+$/
55-
if (docsLuceneVersion != expectedLuceneVersion) {
56-
throw new GradleException("Lucene version in docs [${docsLuceneVersion}] does not match version.properties [${expectedLuceneVersion}]")
57-
}
58-
}
59-
}
60-
61-
tasks.named("check").configure {
62-
dependsOn "verifyDocsLuceneVersion"
63-
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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.qa.verify_version_constants;
11+
12+
import org.elasticsearch.client.Request;
13+
import org.elasticsearch.client.Response;
14+
import org.elasticsearch.index.IndexVersion;
15+
import org.elasticsearch.index.IndexVersions;
16+
import org.elasticsearch.test.cluster.ElasticsearchCluster;
17+
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
18+
import org.elasticsearch.test.rest.ESRestTestCase;
19+
import org.elasticsearch.test.rest.ObjectPath;
20+
import org.hamcrest.Matchers;
21+
import org.junit.ClassRule;
22+
23+
import java.io.IOException;
24+
import java.text.ParseException;
25+
import java.util.Map;
26+
27+
import static org.hamcrest.CoreMatchers.equalTo;
28+
import static org.hamcrest.Matchers.notNullValue;
29+
30+
public class VerifyVersionConstantsIT extends ESRestTestCase {
31+
32+
@ClassRule
33+
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
34+
.distribution(DistributionType.DEFAULT)
35+
.version(System.getProperty("tests.cluster_version"))
36+
.setting("xpack.security.enabled", "false")
37+
.build();
38+
39+
public void testLuceneVersionConstant() throws IOException, ParseException {
40+
Response response = client().performRequest(new Request("GET", "/"));
41+
assertThat(response.getStatusLine().getStatusCode(), equalTo(200));
42+
ObjectPath objectPath = ObjectPath.createFromResponse(response);
43+
44+
String luceneVersionString = objectPath.evaluate("version.lucene_version").toString();
45+
org.apache.lucene.util.Version luceneVersion = org.apache.lucene.util.Version.parse(luceneVersionString);
46+
47+
IndexVersion indexVersion = getIndexVersion();
48+
assertThat(indexVersion.luceneVersion(), equalTo(luceneVersion));
49+
}
50+
51+
private IndexVersion getIndexVersion() throws IOException {
52+
IndexVersion indexVersion = null;
53+
54+
Request request = new Request("GET", "_nodes");
55+
request.addParameter("filter_path", "nodes.*.index_version,nodes.*.name");
56+
Response response = client().performRequest(request);
57+
ObjectPath objectPath = ObjectPath.createFromResponse(response);
58+
Map<String, Object> nodeMap = objectPath.evaluate("nodes");
59+
for (String id : nodeMap.keySet()) {
60+
Number ix = objectPath.evaluate("nodes." + id + ".index_version");
61+
IndexVersion version;
62+
if (ix != null) {
63+
version = IndexVersion.fromId(ix.intValue());
64+
} else {
65+
// it doesn't have index version (pre 8.11) - just infer it from the release version
66+
version = parseLegacyVersion(System.getProperty("tests.cluster_version")).map(x -> IndexVersion.fromId(x.id()))
67+
.orElse(IndexVersions.MINIMUM_COMPATIBLE);
68+
}
69+
70+
if (indexVersion == null) {
71+
indexVersion = version;
72+
} else {
73+
String name = objectPath.evaluate("nodes." + id + ".name");
74+
assertThat("Node " + name + " has a different index version to other nodes", version, Matchers.equalTo(indexVersion));
75+
}
76+
}
77+
78+
assertThat("Index version could not be read", indexVersion, notNullValue());
79+
return indexVersion;
80+
}
81+
82+
@Override
83+
public boolean preserveClusterUponCompletion() {
84+
/*
85+
* We don't perform any writes to the cluster so there won't be anything
86+
* to clean up. Also, our cleanup code is really only compatible with
87+
* *write* compatible versions but this runs with *index* compatible
88+
* versions.
89+
*/
90+
return true;
91+
}
92+
93+
@Override
94+
protected String getTestRestCluster() {
95+
return cluster.getHttpAddresses();
96+
}
97+
}

qa/verify-version-constants/src/test/java/org/elasticsearch/qa/verify_version_constants/VerifyVersionConstantsIT.java

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)