forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into thread-pool-info-migration
* master: (110 commits) Remove undocumented action.master.force_local setting (elastic#29351) Enhance error for out of bounds byte size settings (elastic#29338) Fix QueryAnalyzerTests. Fix HasChildQueryBuilderTests to not use the `classic` similarity. [Docs] Correct javadoc of GetIndexRequest (elastic#29364) Make TransportRankEvalAction members final Add awaits fix for a query analyzer test Check presence of multi-types before validating new mapping (elastic#29316) Add awaits fix for HasChildQueryBuilderTests Remove silent batch mode from install plugin (elastic#29359) Align cat thread pool info to thread pool config (elastic#29195) Track Lucene operations in engine explicitly (elastic#29357) Build: Fix Java9 MR build (elastic#29312) Reindex: Fix error in delete-by-query rest spec (elastic#29318) Improve similarity integration. (elastic#29187) Fix some query extraction bugs. (elastic#29283) [Docs] Correct experimental note formatting Move Nullable into core (elastic#29341) [Docs] Update getting-started.asciidoc (elastic#29294) Elasticsearch 6.3.0 is now on Lucene 7.3. ...
- Loading branch information
Showing
631 changed files
with
12,119 additions
and
6,025 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This file is used with all of the non-matrix tests in Jenkins. | ||
|
||
# This .properties file defines the versions of Java with which to | ||
# build and test Elasticsearch for this branch. Valid Java versions | ||
# are 'java' or 'openjdk' followed by the major release number. | ||
|
||
ES_BUILD_JAVA=java10 | ||
ES_RUNTIME_JAVA=java8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# This file is used as part of a matrix build in Jenkins where the | ||
# values below are included as an axis of the matrix. | ||
|
||
# This axis of the build matrix represents the versions of Java with | ||
# which Elasticsearch will be built. Valid Java versions are 'java' | ||
# or 'openjdk' followed by the major release number. | ||
|
||
ES_BUILD_JAVA: | ||
- java10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file is used as part of a matrix build in Jenkins where the | ||
# values below are excluded from the test matrix. | ||
|
||
# The yaml mapping below represents a single intersection on the build | ||
# matrix where a test *should not* be run. The value of the exclude | ||
# key is a list of maps. | ||
|
||
# In this example all of the combinations defined in the matrix will | ||
# run except for the test that builds with java10 and runs with java8. | ||
# exclude: | ||
# - ES_BUILD_JAVA: java10 | ||
# ES_RUNTIME_JAVA: java8 | ||
|
||
exclude: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file is used as part of a matrix build in Jenkins where the | ||
# values below are included as an axis of the matrix. | ||
|
||
# This axis of the build matrix represents the versions of Java on | ||
# which Elasticsearch will be tested. Valid Java versions are 'java' | ||
# or 'openjdk' followed by the major release number. | ||
|
||
ES_RUNTIME_JAVA: | ||
- java8 | ||
- java10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/FilePermissionsTask.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.elasticsearch.gradle.precommit | ||
|
||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.GradleException | ||
import org.gradle.api.file.FileCollection | ||
import org.gradle.api.tasks.InputFiles | ||
import org.gradle.api.tasks.OutputFile | ||
import org.gradle.api.tasks.SourceSet | ||
import org.gradle.api.tasks.TaskAction | ||
import org.gradle.api.tasks.util.PatternSet | ||
import org.gradle.api.tasks.util.PatternFilterable | ||
import org.apache.tools.ant.taskdefs.condition.Os | ||
|
||
import java.nio.file.Files | ||
import java.nio.file.attribute.PosixFilePermission | ||
import java.nio.file.attribute.PosixFileAttributeView | ||
|
||
import static java.nio.file.attribute.PosixFilePermission.OTHERS_EXECUTE | ||
import static java.nio.file.attribute.PosixFilePermission.GROUP_EXECUTE | ||
import static java.nio.file.attribute.PosixFilePermission.OWNER_EXECUTE | ||
|
||
/** | ||
* Checks source files for correct file permissions. | ||
*/ | ||
public class FilePermissionsTask extends DefaultTask { | ||
|
||
/** A pattern set of which files should be checked. */ | ||
private PatternFilterable filesFilter = new PatternSet() | ||
|
||
@OutputFile | ||
File outputMarker = new File(project.buildDir, 'markers/filePermissions') | ||
|
||
FilePermissionsTask() { | ||
onlyIf { !Os.isFamily(Os.FAMILY_WINDOWS) } | ||
description = "Checks java source files for correct file permissions" | ||
// we always include all source files, and exclude what should not be checked | ||
filesFilter.include('**') | ||
// exclude sh files that might have the executable bit set | ||
filesFilter.exclude('**/*.sh') | ||
} | ||
|
||
/** Returns the files this task will check */ | ||
@InputFiles | ||
FileCollection files() { | ||
List<FileCollection> collections = new ArrayList<>() | ||
for (SourceSet sourceSet : project.sourceSets) { | ||
collections.add(sourceSet.allSource.matching(filesFilter)) | ||
} | ||
return project.files(collections.toArray()) | ||
} | ||
|
||
@TaskAction | ||
void checkInvalidPermissions() { | ||
List<String> failures = new ArrayList<>() | ||
for (File f : files()) { | ||
PosixFileAttributeView fileAttributeView = Files.getFileAttributeView(f.toPath(), PosixFileAttributeView.class) | ||
Set<PosixFilePermission> permissions = fileAttributeView.readAttributes().permissions() | ||
if (permissions.contains(OTHERS_EXECUTE) || permissions.contains(OWNER_EXECUTE) || | ||
permissions.contains(GROUP_EXECUTE)) { | ||
failures.add("Source file is executable: " + f) | ||
} | ||
} | ||
if (failures.isEmpty() == false) { | ||
throw new GradleException('Found invalid file permissions:\n' + failures.join('\n')) | ||
} | ||
outputMarker.setText('done', 'UTF-8') | ||
} | ||
|
||
} |
Oops, something went wrong.