Skip to content

Commit 61a468e

Browse files
Merge remote-tracking branch 'elastic/master' into optimize-away-needless-uploads
2 parents c12ed69 + e79e6d9 commit 61a468e

File tree

645 files changed

+13096
-5228
lines changed

Some content is hidden

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

645 files changed

+13096
-5228
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

.ci/matrix-vagrant-packaging.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file is used as part of a matrix build in Jenkins where the
2+
# values below are included as an axis of the matrix.
3+
4+
# This axis of the build matrix represents the versions subprojects
5+
# of the :qa:os project which will be tested on a metal CI worker
6+
# for the purposes of verifying of Vagrant-based tooling
7+
8+
OS:
9+
- centos-7
10+
- debian-9
11+
- fedora-28
12+
- fedora-29
13+
- oel-7
14+
- sles-12
15+
- ubuntu-1804
16+
- windows-2012r2
17+
- windows-2016

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: 1 addition & 1 deletion
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
}

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=

0 commit comments

Comments
 (0)