Skip to content

Commit 91bbb5f

Browse files
committed
Merge branch 'master' into feature/extensible-values-source
2 parents 369ad60 + f03b6ff commit 91bbb5f

File tree

490 files changed

+9651
-4478
lines changed

Some content is hidden

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

490 files changed

+9651
-4478
lines changed

.ci/dockerOnLinuxExclusions

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
# Docker tests to be skipped on that OS. If /etc/os-release doesn't exist
55
# (as is the case on centos-6, for example) then that OS will again be
66
# excluded.
7-
centos-6
87
debian-8
98
opensuse-15-1
10-
ol-6.10
119
ol-7.7
1210
sles-12

README.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ In order to play with the distributed nature of Elasticsearch, simply bring more
192192

193193
=== Where to go from here?
194194

195-
We have just covered a very small portion of what Elasticsearch is all about. For more information, please refer to the http://www.elastic.co/products/elasticsearch[elastic.co] website. General questions can be asked on the https://discuss.elastic.co[Elastic Forum] or https://ela.st/slack[on Slack]. The Elasticsearch GitHub repository is reserved for bug reports and feature requests only.
195+
We have just covered a very small portion of what Elasticsearch is all about. For more information, please refer to the https://www.elastic.co/products/elasticsearch[elastic.co] website. General questions can be asked on the https://discuss.elastic.co[Elastic Forum] or https://ela.st/slack[on Slack]. The Elasticsearch GitHub repository is reserved for bug reports and feature requests only.
196196

197197
=== Building from Source
198198

TESTING.asciidoc

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,8 @@ zip, and deb packages and all the plugins. It will then run the tests on every
340340
available system. This will take a very long time.
341341
+
342342
Fortunately, the various systems under test have their own Gradle tasks under
343-
`qa/os`. To find out what packaging combinations can be tested on a system, run
343+
`qa/os`. To find the systems tested, do a listing of the `qa/os` directory.
344+
To find out what packaging combinations can be tested on a system, run
344345
the `tasks` task. For example:
345346
+
346347
----------------------------------
@@ -360,28 +361,7 @@ will remain running and you'll have to stop them manually with `./gradlew --stop
360361

361362
All the regular vagrant commands should just work so you can get a shell in a
362363
VM running trusty by running
363-
`vagrant up ubuntu-1604 --provider virtualbox && vagrant ssh ubuntu-1604`.
364-
365-
These are the linux flavors supported, all of which we provide images for
366-
367-
* ubuntu-1604 aka xenial
368-
* ubuntu-1804 aka bionic beaver
369-
* debian-8 aka jessie
370-
* debian-9 aka stretch, the current debian stable distribution
371-
* centos-6
372-
* centos-7
373-
* rhel-8
374-
* fedora-28
375-
* fedora-29
376-
* oel-6 aka Oracle Enterprise Linux 6
377-
* oel-7 aka Oracle Enterprise Linux 7
378-
* sles-12
379-
* opensuse-42 aka Leap
380-
381-
We're missing the following from the support matrix because there aren't high
382-
quality boxes available in vagrant atlas:
383-
384-
* sles-11
364+
`vagrant up ubuntu-1804 --provider virtualbox && vagrant ssh ubuntu-1804`.
385365

386366
=== Testing packaging on Windows
387367

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ subprojects {
8484

8585
Node developer = node.appendNode('developers').appendNode('developer')
8686
developer.appendNode('name', 'Elastic')
87-
developer.appendNode('url', 'http://www.elastic.co')
87+
developer.appendNode('url', 'https://www.elastic.co')
8888
}
8989
}
9090
}
@@ -215,8 +215,8 @@ task verifyVersions {
215215
* after the backport of the backcompat code is complete.
216216
*/
217217

218-
boolean bwc_tests_enabled = true
219-
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
218+
boolean bwc_tests_enabled = false
219+
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/51875" /* place a PR link here when committing bwc changes */
220220
if (bwc_tests_enabled == false) {
221221
if (bwc_tests_disabled_issue.isEmpty()) {
222222
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/AntFixture.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ import org.elasticsearch.gradle.LoggedExec
2525
import org.gradle.api.GradleException
2626
import org.gradle.api.Task
2727
import org.gradle.api.tasks.Exec
28-
import org.gradle.api.tasks.Input
2928
import org.gradle.api.tasks.Internal
30-
3129
/**
3230
* A fixture for integration tests which runs in a separate process launched by Ant.
3331
*/

buildSrc/src/main/java/org/elasticsearch/gradle/test/DistroTestPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void apply(Project project) {
110110

111111
TaskProvider<Task> destructiveDistroTest = project.getTasks().register("destructiveDistroTest");
112112
for (ElasticsearchDistribution distribution : distributions) {
113-
if (distribution.getType() != Type.DOCKER || runDockerTests == true) {
113+
if (distribution.getType() != Type.DOCKER || runDockerTests) {
114114
TaskProvider<?> destructiveTask = configureDistroTest(project, distribution);
115115
destructiveDistroTest.configure(t -> t.dependsOn(destructiveTask));
116116
}
@@ -153,7 +153,7 @@ public void apply(Project project) {
153153
//
154154
// The shouldTestDocker property could be null, hence we use Boolean.TRUE.equals()
155155
boolean shouldExecute = distribution.getType() != Type.DOCKER
156-
|| Boolean.TRUE.equals(vmProject.findProperty("shouldTestDocker")) == true;
156+
|| Boolean.TRUE.equals(vmProject.findProperty("shouldTestDocker"));
157157

158158
if (shouldExecute) {
159159
t.dependsOn(vmTask);

buildSrc/src/main/java/org/elasticsearch/gradle/tool/DockerUtils.java

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ private static DockerAvailability getDockerAvailability(Project project) {
5353
// Since we use a multi-stage Docker build, check the Docker version since 17.05
5454
lastResult = runCommand(project, dockerPath, "version", "--format", "{{.Server.Version}}");
5555

56-
if (lastResult.isSuccess() == true) {
56+
if (lastResult.isSuccess()) {
5757
version = Version.fromString(lastResult.stdout.trim(), Version.Mode.RELAXED);
5858

5959
isVersionHighEnough = version.onOrAfter("17.05.0");
6060

61-
if (isVersionHighEnough == true) {
61+
if (isVersionHighEnough) {
6262
// Check that we can execute a privileged command
6363
lastResult = runCommand(project, dockerPath, "images");
6464
}
6565
}
6666
}
6767

68-
boolean isAvailable = isVersionHighEnough && lastResult.isSuccess() == true;
68+
boolean isAvailable = isVersionHighEnough && lastResult.isSuccess();
6969

7070
return new DockerAvailability(isAvailable, isVersionHighEnough, dockerPath, version, lastResult);
7171
}
@@ -125,7 +125,7 @@ private static class DockerAvailability {
125125
public static void assertDockerIsAvailable(Project project, List<String> tasks) {
126126
DockerAvailability availability = getDockerAvailability(project);
127127

128-
if (availability.isAvailable == true) {
128+
if (availability.isAvailable) {
129129
return;
130130
}
131131

@@ -146,17 +146,7 @@ public static void assertDockerIsAvailable(Project project, List<String> tasks)
146146
throwDockerRequiredException(message);
147147
}
148148

149-
if (availability.version == null) {
150-
final String message = String.format(
151-
Locale.ROOT,
152-
"Docker is required to run the following task%s, but it doesn't appear to be running: \n%s",
153-
tasks.size() > 1 ? "s" : "",
154-
String.join("\n", tasks)
155-
);
156-
throwDockerRequiredException(message);
157-
}
158-
159-
if (availability.isVersionHighEnough == false) {
149+
if (availability.lastCommand.isSuccess() && availability.isVersionHighEnough == false) {
160150
final String message = String.format(
161151
Locale.ROOT,
162152
"building Docker images requires Docker version 17.05+ due to use of multi-stage builds yet was [%s]",
@@ -168,9 +158,10 @@ public static void assertDockerIsAvailable(Project project, List<String> tasks)
168158
// Some other problem, print the error
169159
final String message = String.format(
170160
Locale.ROOT,
171-
"a problem occurred running Docker from [%s] yet it is required to run the following task%s: \n%s\n"
172-
+ "the problem is that Docker exited with exit code [%d] with standard error output [%s]",
161+
"a problem occurred while using Docker from [%s]%s yet it is required to run the following task%s: \n%s\n"
162+
+ "the problem is that Docker exited with exit code [%d] with standard error output:\n%s",
173163
availability.path,
164+
availability.version == null ? "" : " v" + availability.version,
174165
tasks.size() > 1 ? "s" : "",
175166
String.join("\n", tasks),
176167
availability.lastCommand.exitCode,
@@ -213,8 +204,8 @@ private static Result runCommand(Project project, String... args) {
213204
spec.setCommandLine((Object[]) args);
214205
spec.setStandardOutput(stdout);
215206
spec.setErrorOutput(stderr);
207+
spec.setIgnoreExitValue(true);
216208
});
217-
218209
return new Result(execResult.getExitValue(), stdout.toString(), stderr.toString());
219210
}
220211

buildSrc/src/main/resources/checkstyle.xml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<property name="message" value="Empty javadoc comments are forbidden"/>
1919
</module>
2020

21-
<!--
21+
<!--
2222
We include snippets that are wrapped in `// tag` and `// end` into the
2323
docs, stripping the leading spaces. If the context is wider than 76
2424
characters then it'll need to scroll. This fails the build if it sees
@@ -103,5 +103,31 @@
103103
<property name="ignoreComments" value="true" />
104104
</module>
105105
<!-- end Orwellian suppression of Serializable -->
106+
107+
<!-- Forbid equality comparisons with `true` -->
108+
<module name="DescendantToken">
109+
<property name="tokens" value="EQUAL"/>
110+
<property name="limitedTokens" value="LITERAL_TRUE"/>
111+
<property name="maximumNumber" value="0"/>
112+
<property name="maximumDepth" value="1"/>
113+
<message key="descendant.token.max" value="Do not check for equality with 'true', since it is implied"/>
114+
</module>
115+
116+
<!-- Forbid using '!' for logical negations in favour of checking
117+
against 'false' explicitly. -->
118+
<!-- This is disabled for now because there are many, many violations,
119+
hence the rule is reporting at the "warning" severity. -->
120+
121+
<!--
122+
<module name="DescendantToken">
123+
<property name="severity" value="warning"/>
124+
<property name="tokens" value="EXPR"/>
125+
<property name="limitedTokens" value="LNOT"/>
126+
<property name="maximumNumber" value="0"/>
127+
<property name="maximumDepth" value="1"/>
128+
<message key="descendant.token.max" value="Do not negate boolean expressions with '!', but check explicitly with '== false' as it is more explicit"/>
129+
</module>
130+
-->
131+
106132
</module>
107133
</module>

buildSrc/src/main/resources/fips_java.security

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
security.provider.1=org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider
22
security.provider.2=org.bouncycastle.jsse.provider.BouncyCastleJsseProvider fips:BCFIPS
33
security.provider.3=SUN
4+
security.provider.4=SunJGSS
45
securerandom.source=file:/dev/urandom
56
securerandom.strongAlgorithms=NativePRNGBlocking:SUN,DRBG:SUN
67
securerandom.drbg.config=

buildSrc/src/main/resources/forbidden/jdk-signatures.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ java.net.MulticastSocket#<init>(int)
5959
java.net.ServerSocket#<init>(int)
6060
java.net.ServerSocket#<init>(int,int)
6161

62-
@defaultMessage use NetworkAddress format/formatAddress to print IP or IP+ports
62+
@defaultMessage use NetworkAddress format() to print IP or IP+ports
6363
java.net.InetAddress#toString()
6464
java.net.InetAddress#getHostAddress()
6565
java.net.Inet4Address#getHostAddress()

buildSrc/src/minimumRuntime/java/org/elasticsearch/gradle/Version.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ public enum Mode {
2929
RELAXED
3030
}
3131

32-
private static final Pattern pattern = Pattern.compile("(\\d)+\\.(\\d+)\\.(\\d+)(-alpha\\d+|-beta\\d+|-rc\\d+)?(-SNAPSHOT)?");
32+
private static final Pattern pattern = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)(-alpha\\d+|-beta\\d+|-rc\\d+)?(-SNAPSHOT)?");
3333

34-
private static final Pattern relaxedPattern = Pattern.compile("(\\d)+\\.(\\d+)\\.(\\d+)(-[a-zA-Z0-9_]+)*?");
34+
private static final Pattern relaxedPattern = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)(-[a-zA-Z0-9_]+)*?");
3535

3636
public Version(int major, int minor, int revision) {
3737
Objects.requireNonNull(major, "major version can't be null");
@@ -60,7 +60,7 @@ public static Version fromString(final String s, final Mode mode) {
6060
Objects.requireNonNull(s);
6161
Matcher matcher = mode == Mode.STRICT ? pattern.matcher(s) : relaxedPattern.matcher(s);
6262
if (matcher.matches() == false) {
63-
String expected = mode == Mode.STRICT == true
63+
String expected = mode == Mode.STRICT
6464
? "major.minor.revision[-(alpha|beta|rc)Number][-SNAPSHOT]"
6565
: "major.minor.revision[-extra]";
6666
throw new IllegalArgumentException("Invalid version format: '" + s + "'. Should be " + expected);

buildSrc/src/test/java/org/elasticsearch/gradle/VersionTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public void testVersionParsing() {
3838
assertVersionEquals("5.1.2-rc3", 5, 1, 2);
3939
assertVersionEquals("6.1.2-SNAPSHOT", 6, 1, 2);
4040
assertVersionEquals("6.1.2-beta1-SNAPSHOT", 6, 1, 2);
41+
assertVersionEquals("17.03.11", 17, 3, 11);
4142
}
4243

4344
public void testRelaxedVersionParsing() {
@@ -46,6 +47,7 @@ public void testRelaxedVersionParsing() {
4647
assertVersionEquals("6.1.2-beta1-SNAPSHOT", 6, 1, 2, Version.Mode.RELAXED);
4748
assertVersionEquals("6.1.2-foo", 6, 1, 2, Version.Mode.RELAXED);
4849
assertVersionEquals("6.1.2-foo-bar", 6, 1, 2, Version.Mode.RELAXED);
50+
assertVersionEquals("16.01.22", 16, 1, 22, Version.Mode.RELAXED);
4951
}
5052

5153
public void testCompareWithStringVersions() {
@@ -91,6 +93,7 @@ public void testToString() {
9193

9294
public void testCompareVersions() {
9395
assertEquals(0, new Version(7, 0, 0).compareTo(new Version(7, 0, 0)));
96+
assertOrder(Version.fromString("19.0.1"), Version.fromString("20.0.3"));
9497
}
9598

9699
public void testExceptionEmpty() {

buildSrc/version.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ slf4j = 1.6.2
2222
# when updating the JNA version, also update the version in buildSrc/build.gradle
2323
jna = 4.5.1
2424

25-
netty = 4.1.43.Final
25+
netty = 4.1.45.Final
2626
joda = 2.10.4
2727

2828
# when updating this version, you need to ensure compatibility with:
@@ -31,7 +31,7 @@ joda = 2.10.4
3131
# - x-pack/plugin/security
3232
bouncycastle = 1.61
3333
# test dependencies
34-
randomizedrunner = 2.7.4
34+
randomizedrunner = 2.7.6
3535
junit = 4.12
3636
httpclient = 4.5.10
3737
httpcore = 4.4.12

0 commit comments

Comments
 (0)