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 align-thread-pool-info-cat-api
* master: (80 commits) Remove HTTP max content length leniency (elastic#29337) Begin moving XContent to a separate lib/artifact (elastic#29300) Java versions for ci (elastic#29320) Minor cleanup in the InternalEngine (elastic#29241) Clarify expectations of false positives/negatives (elastic#27964) Update docs on vertex ordering (elastic#27963) Revert "REST high-level client: add support for Indices Update Settings API (elastic#28892)" (elastic#29323) [test] remove Streamable serde assertions (elastic#29307) Improve query string docs (elastic#28882) fix query string example for boolean query (elastic#28881) Resolve unchecked cast warnings introduced with elastic#28892 REST high-level client: add support for Indices Update Settings API (elastic#28892) Search: Validate script query is run with a single script (elastic#29304) [DOCS] Added info on WGS-84. Closes issue elastic#3590 (elastic#29305) Increase timeout on Netty client latch for tests Build: Use branch specific refspec sysprop for bwc builds (elastic#29299) TEST: trim unsafe commits before opening engine Move trimming unsafe commits from engine ctor to store (elastic#29260) Fix incorrect geohash for lat 90, lon 180 (elastic#29256) Do not load global state when deleting a snapshot (elastic#29278) ...
- Loading branch information
Showing
474 changed files
with
9,724 additions
and
4,476 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') | ||
} | ||
|
||
} |
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
Oops, something went wrong.