Skip to content

Commit d4dba9a

Browse files
committed
Merge branch 'master' into bump-compiler-to-jdk-10
* master: (40 commits) Do not optimize append-only if seen normal op with higher seqno (elastic#28787) [test] packaging: gradle tasks for groovy tests (elastic#29046) Prune only gc deletes below local checkpoint (elastic#28790) remove testUnassignedShardAndEmptyNodesInRoutingTable elastic#28745: remove extra option in the composite rest tests Fold EngineDiskUtils into Store, for better lock semantics (elastic#29156) Add file permissions checks to precommit task Remove execute mode bit from source files Optimize the composite aggregation for match_all and range queries (elastic#28745) [Docs] Add rank_eval size parameter k (elastic#29218) [DOCS] Remove ignore_z_value parameter link Docs: Update docs/index_.asciidoc (elastic#29172) Docs: Link C++ client lib elasticlient (elastic#28949) [DOCS] Unregister repository instead of deleting it (elastic#29206) Docs: HighLevelRestClient#multiSearch (elastic#29144) Add Z value support to geo_shape Remove type casts in logging in server component (elastic#28807) Change BroadcastResponse from ToXContentFragment to ToXContentObject (elastic#28878) REST : Split `RestUpgradeAction` into two actions (elastic#29124) Add error file docs to important settings ...
2 parents 0a63e21 + 0ac89a3 commit d4dba9a

File tree

316 files changed

+6306
-3126
lines changed

Some content is hidden

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

316 files changed

+6306
-3126
lines changed

README.textile

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Elasticsearch is a distributed RESTful search engine built for the cloud. Featur
2727
** All the power of Lucene easily exposed through simple configuration / plugins.
2828
* Per operation consistency
2929
** Single document level operations are atomic, consistent, isolated and durable.
30-
* Open Source under the Apache License, version 2 ("ALv2")
3130

3231
h2. Getting Started
3332

@@ -217,23 +216,3 @@ Elasticsearch (1.x), it is required to perform a full cluster restart. Please
217216
see the "setup reference":
218217
https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html
219218
for more details on the upgrade process.
220-
221-
h1. License
222-
223-
<pre>
224-
This software is licensed under the Apache License, version 2 ("ALv2"), quoted below.
225-
226-
Copyright 2009-2016 Elasticsearch <https://www.elastic.co>
227-
228-
Licensed under the Apache License, Version 2.0 (the "License"); you may not
229-
use this file except in compliance with the License. You may obtain a copy of
230-
the License at
231-
232-
http://www.apache.org/licenses/LICENSE-2.0
233-
234-
Unless required by applicable law or agreed to in writing, software
235-
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
236-
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
237-
License for the specific language governing permissions and limitations under
238-
the License.
239-
</pre>

TESTING.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,16 +414,16 @@ and in another window:
414414

415415
----------------------------------------------------
416416
vagrant up centos-7 --provider virtualbox && vagrant ssh centos-7
417-
cd $BATS_ARCHIVES
417+
cd $PACKAGING_ARCHIVES
418418
sudo -E bats $BATS_TESTS/*rpm*.bats
419419
----------------------------------------------------
420420

421421
If you wanted to retest all the release artifacts on a single VM you could:
422422

423423
-------------------------------------------------
424-
./gradlew setupBats
424+
./gradlew setupPackagingTest
425425
cd qa/vagrant; vagrant up ubuntu-1404 --provider virtualbox && vagrant ssh ubuntu-1404
426-
cd $BATS_ARCHIVES
426+
cd $PACKAGING_ARCHIVES
427427
sudo -E bats $BATS_TESTS/*.bats
428428
-------------------------------------------------
429429

Vagrantfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,9 @@ export TAR=/elasticsearch/distribution/tar/build/distributions
334334
export RPM=/elasticsearch/distribution/rpm/build/distributions
335335
export DEB=/elasticsearch/distribution/deb/build/distributions
336336
export BATS=/project/build/bats
337-
export BATS_UTILS=/project/build/bats/utils
338-
export BATS_TESTS=/project/build/bats/tests
339-
export BATS_ARCHIVES=/project/build/bats/archives
337+
export BATS_UTILS=/project/build/packaging/bats/utils
338+
export BATS_TESTS=/project/build/packaging/bats/tests
339+
export PACKAGING_ARCHIVES=/project/build/packaging/archives
340340
VARS
341341
cat \<\<SUDOERS_VARS > /etc/sudoers.d/elasticsearch_vars
342342
Defaults env_keep += "ZIP"
@@ -346,7 +346,7 @@ Defaults env_keep += "DEB"
346346
Defaults env_keep += "BATS"
347347
Defaults env_keep += "BATS_UTILS"
348348
Defaults env_keep += "BATS_TESTS"
349-
Defaults env_keep += "BATS_ARCHIVES"
349+
Defaults env_keep += "PACKAGING_ARCHIVES"
350350
SUDOERS_VARS
351351
chmod 0440 /etc/sudoers.d/elasticsearch_vars
352352
SHELL

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -475,14 +475,18 @@ class BuildPlugin implements Plugin<Project> {
475475
}
476476

477477
static void configureJavadoc(Project project) {
478-
project.tasks.withType(Javadoc) {
479-
executable = new File(project.compilerJavaHome, 'bin/javadoc')
478+
// remove compiled classes from the Javadoc classpath: http://mail.openjdk.java.net/pipermail/javadoc-dev/2018-January/000400.html
479+
final List<File> classes = new ArrayList<>()
480+
project.tasks.withType(JavaCompile) { javaCompile ->
481+
classes.add(javaCompile.destinationDir)
480482
}
481-
configureJavadocJar(project)
482-
if (project.compilerJavaVersion == JavaVersion.VERSION_1_10) {
483-
project.tasks.withType(Javadoc) { it.enabled = false }
484-
project.tasks.getByName('javadocJar').each { it.enabled = false }
483+
project.tasks.withType(Javadoc) { javadoc ->
484+
javadoc.executable = new File(project.compilerJavaHome, 'bin/javadoc')
485+
javadoc.classpath = javadoc.getClasspath().filter { f ->
486+
return classes.contains(f) == false
487+
}
485488
}
489+
configureJavadocJar(project)
486490
}
487491

488492
/** Adds a javadocJar task to generate a jar containing javadocs. */
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/*
2+
* Licensed to Elasticsearch under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.elasticsearch.gradle.precommit
20+
21+
import org.gradle.api.DefaultTask
22+
import org.gradle.api.GradleException
23+
import org.gradle.api.file.FileCollection
24+
import org.gradle.api.tasks.InputFiles
25+
import org.gradle.api.tasks.OutputFile
26+
import org.gradle.api.tasks.SourceSet
27+
import org.gradle.api.tasks.TaskAction
28+
import org.gradle.api.tasks.util.PatternSet
29+
import org.gradle.api.tasks.util.PatternFilterable
30+
import org.apache.tools.ant.taskdefs.condition.Os
31+
32+
import java.nio.file.Files
33+
import java.nio.file.attribute.PosixFilePermission
34+
import java.nio.file.attribute.PosixFileAttributeView
35+
36+
import static java.nio.file.attribute.PosixFilePermission.OTHERS_EXECUTE
37+
import static java.nio.file.attribute.PosixFilePermission.GROUP_EXECUTE
38+
import static java.nio.file.attribute.PosixFilePermission.OWNER_EXECUTE
39+
40+
/**
41+
* Checks source files for correct file permissions.
42+
*/
43+
public class FilePermissionsTask extends DefaultTask {
44+
45+
/** A pattern set of which files should be checked. */
46+
private PatternFilterable filesFilter = new PatternSet()
47+
48+
@OutputFile
49+
File outputMarker = new File(project.buildDir, 'markers/filePermissions')
50+
51+
FilePermissionsTask() {
52+
onlyIf { !Os.isFamily(Os.FAMILY_WINDOWS) }
53+
description = "Checks java source files for correct file permissions"
54+
// we always include all source files, and exclude what should not be checked
55+
filesFilter.include('**')
56+
// exclude sh files that might have the executable bit set
57+
filesFilter.exclude('**/*.sh')
58+
}
59+
60+
/** Returns the files this task will check */
61+
@InputFiles
62+
FileCollection files() {
63+
List<FileCollection> collections = new ArrayList<>()
64+
for (SourceSet sourceSet : project.sourceSets) {
65+
collections.add(sourceSet.allSource.matching(filesFilter))
66+
}
67+
return project.files(collections.toArray())
68+
}
69+
70+
@TaskAction
71+
void checkInvalidPermissions() {
72+
List<String> failures = new ArrayList<>()
73+
for (File f : files()) {
74+
PosixFileAttributeView fileAttributeView = Files.getFileAttributeView(f.toPath(), PosixFileAttributeView.class)
75+
Set<PosixFilePermission> permissions = fileAttributeView.readAttributes().permissions()
76+
if (permissions.contains(OTHERS_EXECUTE) || permissions.contains(OWNER_EXECUTE) ||
77+
permissions.contains(GROUP_EXECUTE)) {
78+
failures.add("Source file is executable: " + f)
79+
}
80+
}
81+
if (failures.isEmpty() == false) {
82+
throw new GradleException('Found invalid file permissions:\n' + failures.join('\n'))
83+
}
84+
outputMarker.setText('done', 'UTF-8')
85+
}
86+
87+
}

buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class PrecommitTasks {
3737
configureNamingConventions(project),
3838
project.tasks.create('forbiddenPatterns', ForbiddenPatternsTask.class),
3939
project.tasks.create('licenseHeaders', LicenseHeadersTask.class),
40+
project.tasks.create('filepermissions', FilePermissionsTask.class),
4041
project.tasks.create('jarHell', JarHellTask.class),
4142
project.tasks.create('thirdPartyAudit', ThirdPartyAuditTask.class)]
4243

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ class VagrantPropertiesExtension {
3737
@Input
3838
Boolean inheritTests
3939

40-
@Input
41-
Boolean inheritTestArchives
42-
4340
@Input
4441
Boolean inheritTestUtils
4542

@@ -60,10 +57,6 @@ class VagrantPropertiesExtension {
6057
this.inheritTests = inheritTests
6158
}
6259

63-
void setInheritTestArchives(Boolean inheritTestArchives) {
64-
this.inheritTestArchives = inheritTestArchives
65-
}
66-
6760
void setInheritTestUtils(Boolean inheritTestUtils) {
6861
this.inheritTestUtils = inheritTestUtils
6962
}

0 commit comments

Comments
 (0)