Skip to content

Commit f24a2eb

Browse files
committed
Merge branch '6.x' into ccr-6.x
* 6.x: (62 commits) [DOCS] Adds new installation package details (#29590) Revert "Build: Move gradle wrapper jar to a dot dir (#30146)" [DOCS] Added 6.3.0 section to changelog [DOCS] Merge 6.x release notes into changelog (#30312) [DOCS] Removes broken link [DOCS] Adds file realm configuration details (#30221) [DOCS] Adds PKI realm configuration details (#30225) [DOCS] Fix 6.4-specific link in changelog (#30314) Remove RepositoriesMetaData variadic constructor (#29569) [DOCS] Adds changelog to Elasticsearch Reference (#30310) Test: increase authentication logging for debugging [DOCS] Removes redundant SAML realm settings (#30196) SQL: Teach the CLI to ignore empty commands (#30265) [DOCS] Fixes section error [DOCS] Adds Active Directory realm configuration details (#30223) [DOCS] Removes redundant file realm settings (#30192) [DOCS] Fixes users command name (#30275) Build: Move gradle wrapper jar to a dot dir (#30146) Build: Log a warning if disabling reindex-from-old (#30304) TEST: Add debug log to FlushIT ...
2 parents aaef32b + d237402 commit f24a2eb

File tree

207 files changed

+9898
-7655
lines changed

Some content is hidden

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

207 files changed

+9898
-7655
lines changed

Vagrantfile

+2
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ export BATS=/project/build/bats
337337
export BATS_UTILS=/project/build/packaging/bats/utils
338338
export BATS_TESTS=/project/build/packaging/bats/tests
339339
export PACKAGING_ARCHIVES=/project/build/packaging/archives
340+
export PACKAGING_TESTS=/project/build/packaging/tests
340341
VARS
341342
cat \<\<SUDOERS_VARS > /etc/sudoers.d/elasticsearch_vars
342343
Defaults env_keep += "ZIP"
@@ -347,6 +348,7 @@ Defaults env_keep += "BATS"
347348
Defaults env_keep += "BATS_UTILS"
348349
Defaults env_keep += "BATS_TESTS"
349350
Defaults env_keep += "PACKAGING_ARCHIVES"
351+
Defaults env_keep += "PACKAGING_TESTS"
350352
SUDOERS_VARS
351353
chmod 0440 /etc/sudoers.d/elasticsearch_vars
352354
SHELL

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

+16
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,22 @@ class BuildPlugin implements Plugin<Project> {
549549
javadoc.classpath = javadoc.getClasspath().filter { f ->
550550
return classes.contains(f) == false
551551
}
552+
/*
553+
* Force html5 on projects that support it to silence the warning
554+
* that `javadoc` will change its defaults in the future.
555+
*
556+
* But not all of our javadoc is actually valid html5. So we
557+
* have to become valid incrementally. We only set html5 on the
558+
* projects we have converted so that we still get the annoying
559+
* warning on the unconverted ones. That will give us an
560+
* incentive to convert them....
561+
*/
562+
List html4Projects = [
563+
':server',
564+
]
565+
if (false == html4Projects.contains(project.path)) {
566+
javadoc.options.addBooleanOption('html5', true)
567+
}
552568
}
553569
configureJavadocJar(project)
554570
}

buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantPropertiesExtension.groovy

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class VagrantPropertiesExtension {
4141
@Input
4242
Boolean inheritTestUtils
4343

44+
@Input
45+
String testClass
46+
4447
VagrantPropertiesExtension(List<String> availableBoxes) {
4548
this.boxes = availableBoxes
4649
this.batsDir = 'src/test/resources/packaging'

buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy

+41-15
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class VagrantTestPlugin implements Plugin<Project> {
5151
static List<String> UPGRADE_FROM_ARCHIVES = ['rpm', 'deb']
5252

5353
private static final PACKAGING_CONFIGURATION = 'packaging'
54+
private static final PACKAGING_TEST_CONFIGURATION = 'packagingTest'
5455
private static final BATS = 'bats'
5556
private static final String BATS_TEST_COMMAND ="cd \$PACKAGING_ARCHIVES && sudo bats --tap \$BATS_TESTS/*.$BATS"
5657
private static final String PLATFORM_TEST_COMMAND ="rm -rf ~/elasticsearch && rsync -r /elasticsearch/ ~/elasticsearch && cd ~/elasticsearch && ./gradlew test integTest"
@@ -66,6 +67,7 @@ class VagrantTestPlugin implements Plugin<Project> {
6667

6768
// Creates custom configurations for Bats testing files (and associated scripts and archives)
6869
createPackagingConfiguration(project)
70+
project.configurations.create(PACKAGING_TEST_CONFIGURATION)
6971

7072
// Creates all the main Vagrant tasks
7173
createVagrantTasks(project)
@@ -144,10 +146,12 @@ class VagrantTestPlugin implements Plugin<Project> {
144146
}
145147

146148
private static void createCleanTask(Project project) {
147-
project.tasks.create('clean', Delete.class) {
148-
description 'Clean the project build directory'
149-
group 'Build'
150-
delete project.buildDir
149+
if (project.tasks.findByName('clean') == null) {
150+
project.tasks.create('clean', Delete.class) {
151+
description 'Clean the project build directory'
152+
group 'Build'
153+
delete project.buildDir
154+
}
151155
}
152156
}
153157

@@ -174,6 +178,18 @@ class VagrantTestPlugin implements Plugin<Project> {
174178
from project.configurations[PACKAGING_CONFIGURATION]
175179
}
176180

181+
File testsDir = new File(packagingDir, 'tests')
182+
Copy copyPackagingTests = project.tasks.create('copyPackagingTests', Copy) {
183+
into testsDir
184+
from project.configurations[PACKAGING_TEST_CONFIGURATION]
185+
}
186+
187+
Task createTestRunnerScript = project.tasks.create('createTestRunnerScript', FileContentsTask) {
188+
dependsOn copyPackagingTests
189+
file "${testsDir}/run-tests.sh"
190+
contents "java -cp \"\$PACKAGING_TESTS/*\" org.junit.runner.JUnitCore ${-> project.extensions.esvagrant.testClass}"
191+
}
192+
177193
Task createVersionFile = project.tasks.create('createVersionFile', FileContentsTask) {
178194
dependsOn copyPackagingArchives
179195
file "${archivesDir}/version"
@@ -234,7 +250,8 @@ class VagrantTestPlugin implements Plugin<Project> {
234250

235251
Task vagrantSetUpTask = project.tasks.create('setupPackagingTest')
236252
vagrantSetUpTask.dependsOn 'vagrantCheckVersion'
237-
vagrantSetUpTask.dependsOn copyPackagingArchives, createVersionFile, createUpgradeFromFile, createUpgradeIsOssFile
253+
vagrantSetUpTask.dependsOn copyPackagingArchives, copyPackagingTests, createTestRunnerScript
254+
vagrantSetUpTask.dependsOn createVersionFile, createUpgradeFromFile, createUpgradeIsOssFile
238255
vagrantSetUpTask.dependsOn copyBatsTests, copyBatsUtils
239256
}
240257

@@ -393,20 +410,29 @@ class VagrantTestPlugin implements Plugin<Project> {
393410
packagingTest.dependsOn(batsPackagingTest)
394411
}
395412

396-
// This task doesn't do anything yet. In the future it will execute a jar containing tests on the vm
397-
Task groovyPackagingTest = project.tasks.create("vagrant${boxTask}#groovyPackagingTest")
398-
groovyPackagingTest.dependsOn(up)
399-
groovyPackagingTest.finalizedBy(halt)
413+
Task javaPackagingTest = project.tasks.create("vagrant${boxTask}#javaPackagingTest", VagrantCommandTask) {
414+
command 'ssh'
415+
boxName box
416+
environmentVars vagrantEnvVars
417+
dependsOn up, setupPackagingTest
418+
finalizedBy halt
419+
args '--command', "bash \"\$PACKAGING_TESTS/run-tests.sh\""
420+
}
421+
422+
// todo remove this onlyIf after all packaging tests are consolidated
423+
javaPackagingTest.onlyIf {
424+
project.extensions.esvagrant.testClass != null
425+
}
400426

401-
TaskExecutionAdapter groovyPackagingReproListener = createReproListener(project, groovyPackagingTest.path)
402-
groovyPackagingTest.doFirst {
403-
project.gradle.addListener(groovyPackagingReproListener)
427+
TaskExecutionAdapter javaPackagingReproListener = createReproListener(project, javaPackagingTest.path)
428+
javaPackagingTest.doFirst {
429+
project.gradle.addListener(javaPackagingReproListener)
404430
}
405-
groovyPackagingTest.doLast {
406-
project.gradle.removeListener(groovyPackagingReproListener)
431+
javaPackagingTest.doLast {
432+
project.gradle.removeListener(javaPackagingReproListener)
407433
}
408434
if (project.extensions.esvagrant.boxes.contains(box)) {
409-
packagingTest.dependsOn(groovyPackagingTest)
435+
packagingTest.dependsOn(javaPackagingTest)
410436
}
411437

412438
Task platform = project.tasks.create("vagrant${boxTask}#platformTest", VagrantCommandTask) {

client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/NoopBulkRequestBuilder.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,17 @@ public NoopBulkRequestBuilder setWaitForActiveShards(final int waitForActiveShar
129129
}
130130

131131
/**
132-
* A timeout to wait if the index operation can't be performed immediately. Defaults to <tt>1m</tt>.
132+
* A timeout to wait if the index operation can't be performed immediately.
133+
* Defaults to {@code 1m}.
133134
*/
134135
public final NoopBulkRequestBuilder setTimeout(TimeValue timeout) {
135136
request.timeout(timeout);
136137
return this;
137138
}
138139

139140
/**
140-
* A timeout to wait if the index operation can't be performed immediately. Defaults to <tt>1m</tt>.
141+
* A timeout to wait if the index operation can't be performed immediately.
142+
* Defaults to {@code 1m}.
141143
*/
142144
public final NoopBulkRequestBuilder setTimeout(String timeout) {
143145
request.timeout(timeout);
@@ -151,4 +153,3 @@ public int numberOfActions() {
151153
return request.numberOfActions();
152154
}
153155
}
154-

client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/NoopSearchRequestBuilder.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public NoopSearchRequestBuilder setRouting(String... routing) {
142142

143143
/**
144144
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
145-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
145+
* {@code _local} to prefer local shards, {@code _primary} to execute only on primary shards, or
146146
* a custom value, which guarantees that the same order will be used across different requests.
147147
*/
148148
public NoopSearchRequestBuilder setPreference(String preference) {
@@ -188,15 +188,15 @@ public NoopSearchRequestBuilder setMinScore(float minScore) {
188188
}
189189

190190
/**
191-
* From index to start the search from. Defaults to <tt>0</tt>.
191+
* From index to start the search from. Defaults to {@code 0}.
192192
*/
193193
public NoopSearchRequestBuilder setFrom(int from) {
194194
sourceBuilder().from(from);
195195
return this;
196196
}
197197

198198
/**
199-
* The number of search hits to return. Defaults to <tt>10</tt>.
199+
* The number of search hits to return. Defaults to {@code 10}.
200200
*/
201201
public NoopSearchRequestBuilder setSize(int size) {
202202
sourceBuilder().size(size);
@@ -349,7 +349,7 @@ public NoopSearchRequestBuilder slice(SliceBuilder builder) {
349349

350350
/**
351351
* Applies when sorting, and controls if scores will be tracked as well. Defaults to
352-
* <tt>false</tt>.
352+
* {@code false}.
353353
*/
354354
public NoopSearchRequestBuilder setTrackScores(boolean trackScores) {
355355
sourceBuilder().trackScores(trackScores);

client/rest-high-level/src/main/java/org/elasticsearch/client/Request.java

-7
Original file line numberDiff line numberDiff line change
@@ -842,13 +842,6 @@ Params withLocal(boolean local) {
842842
return this;
843843
}
844844

845-
Params withFlatSettings(boolean flatSettings) {
846-
if (flatSettings) {
847-
return putParam("flat_settings", Boolean.TRUE.toString());
848-
}
849-
return this;
850-
}
851-
852845
Params withIncludeDefaults(boolean includeDefaults) {
853846
if (includeDefaults) {
854847
return putParam("include_defaults", Boolean.TRUE.toString());

client/sniffer/build.gradle

-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.elasticsearch.gradle.precommit.PrecommitTasks
2121

2222
apply plugin: 'elasticsearch.build'
23-
apply plugin: 'ru.vyarus.animalsniffer'
2423
apply plugin: 'nebula.maven-base-publish'
2524
apply plugin: 'nebula.maven-scm'
2625

@@ -52,8 +51,6 @@ dependencies {
5251
testCompile "org.hamcrest:hamcrest-all:${versions.hamcrest}"
5352
testCompile "org.elasticsearch:securemock:${versions.securemock}"
5453
testCompile "org.elasticsearch:mocksocket:${versions.mocksocket}"
55-
testCompile "org.codehaus.mojo:animal-sniffer-annotations:1.15"
56-
signature "org.codehaus.mojo.signature:java17:1.0@signature"
5754
}
5855

5956
forbiddenApisMain {

client/sniffer/src/test/java/org/elasticsearch/client/sniff/ElasticsearchHostsSnifferTests.java

-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@
6060
import static org.junit.Assert.assertThat;
6161
import static org.junit.Assert.fail;
6262

63-
//animal-sniffer doesn't like our usage of com.sun.net.httpserver.* classes
64-
@IgnoreJRERequirement
6563
public class ElasticsearchHostsSnifferTests extends RestClientTestCase {
6664

6765
private int sniffRequestTimeout;

distribution/archives/build.gradle

+18
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,24 @@ subprojects {
217217
}
218218
check.dependsOn checkNotice
219219

220+
if (project.name == 'zip' || project.name == 'tar') {
221+
task checkMlCppNotice {
222+
dependsOn buildDist, checkExtraction
223+
onlyIf toolExists
224+
doLast {
225+
// this is just a small sample from the C++ notices, the idea being that if we've added these lines we've probably added all the required lines
226+
final List<String> expectedLines = Arrays.asList("Apache log4cxx", "Boost Software License - Version 1.0 - August 17th, 2003")
227+
final Path noticePath = archiveExtractionDir.toPath().resolve("elasticsearch-${VersionProperties.elasticsearch}/modules/x-pack/x-pack-ml/NOTICE.txt")
228+
final List<String> actualLines = Files.readAllLines(noticePath)
229+
for (final String expectedLine : expectedLines) {
230+
if (actualLines.contains(expectedLine) == false) {
231+
throw new GradleException("expected [${noticePath}] to contain [${expectedLine}] but it did not")
232+
}
233+
}
234+
}
235+
}
236+
check.dependsOn checkMlCppNotice
237+
}
220238
}
221239

222240
/*****************************************************************************

0 commit comments

Comments
 (0)