Skip to content

Commit 7069f48

Browse files
committed
Merge remote-tracking branch 'upstream/main' into float-byte-script-comparisons
2 parents a737c34 + 46fc7de commit 7069f48

File tree

4,110 files changed

+141727
-376842
lines changed

Some content is hidden

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

4,110 files changed

+141727
-376842
lines changed

.buildkite/pipelines/periodic-fwc.template.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ steps:
77
image: family/elasticsearch-ubuntu-2004
88
machineType: n1-standard-32
99
buildDirectory: /dev/shm/bk
10-
preemptible: true
1110
matrix:
1211
setup:
1312
FWC_VERSION: $FWC_LIST
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# This file is auto-generated. See .buildkite/pipelines/periodic-fwc.template.yml
22
steps:
3-
- label: "{{matrix.FWC_VERSION}} / fwc"
4-
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v$$FWC_VERSION#fwcTest -Dtests.bwc.snapshot=false
3+
- label: $FWC_VERSION / fwc
4+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v$FWC_VERSION#fwcTest -Dtests.bwc.snapshot=false
55
timeout_in_minutes: 300
66
agents:
77
provider: gcp
88
image: family/elasticsearch-ubuntu-2004
99
machineType: n1-standard-32
1010
buildDirectory: /dev/shm/bk
11-
preemptible: true
1211
matrix:
1312
setup:
1413
FWC_VERSION: []
1514
env:
16-
FWC_VERSION: "{{matrix.FWC_VERSION}}"
15+
FWC_VERSION: $FWC_VERSION

build-tools-internal/src/main/groovy/elasticsearch.build-scan.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ develocity {
133133
}
134134
} else {
135135
tag 'LOCAL'
136+
if (providers.systemProperty('idea.active').present) {
137+
tag 'IDEA'
138+
}
136139
}
137140
}
138141
}

build-tools-internal/src/main/groovy/elasticsearch.ide.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
179179

180180
// this path is produced by the extractLibs task above
181181
String testLibraryPath = TestUtil.getTestLibraryPath("${elasticsearchProject.left()}/libs/native/libraries/build/platform")
182-
182+
def enableIdeaCC = providers.gradleProperty("org.elasticsearch.idea-configuration-cache").getOrElse("true").toBoolean()
183183
idea {
184184
project {
185185
vcs = 'Git'
@@ -209,6 +209,11 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
209209
}
210210
}
211211
runConfigurations {
212+
defaults(org.jetbrains.gradle.ext.Gradle) {
213+
scriptParameters = enableIdeaCC ? [
214+
'--configuration-cache'
215+
].join(' ') : ''
216+
}
212217
defaults(JUnit) {
213218
vmParameters = [
214219
'-ea',

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/MrjarPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private SourceSet addSourceSet(
139139
compileOptions.getRelease().set(javaVersion);
140140
});
141141
if (isMainSourceSet) {
142-
project.getTasks().create(sourceSet.getJavadocTaskName(), Javadoc.class, javadocTask -> {
142+
project.getTasks().register(sourceSet.getJavadocTaskName(), Javadoc.class, javadocTask -> {
143143
javadocTask.getJavadocTool().set(javaToolchains.javadocToolFor(spec -> {
144144
spec.getLanguageVersion().set(JavaLanguageVersion.of(javaVersion));
145145
}));

distribution/tools/java-version-checker/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apply plugin: 'elasticsearch.build'
22

3-
compileJava {
3+
tasks.named("compileJava").configure {
44
options.release = 8
55
}
66

docs/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ ext.docsFileTree = fileTree(projectDir) {
3737
}
3838

3939
tasks.named("yamlRestTest") {
40+
enabled = false
4041
if (buildParams.isSnapshotBuild() == false) {
4142
// LOOKUP is not available in snapshots
4243
systemProperty 'tests.rest.blacklist', [
@@ -47,6 +48,7 @@ tasks.named("yamlRestTest") {
4748

4849
/* List of files that have snippets that will not work until platinum tests can occur ... */
4950
tasks.named("buildRestTests").configure {
51+
enabled = false
5052
getExpectedUnconvertedCandidates().addAll(
5153
'reference/ml/anomaly-detection/ml-configuring-transform.asciidoc',
5254
'reference/ml/anomaly-detection/apis/delete-calendar-event.asciidoc',

docs/changelog/123610.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 123610
2+
summary: Disable concurrency when `top_hits` sorts on anything but `_score`
3+
area: "Aggregations"
4+
type: bug
5+
issues: []

docs/docset.yml

Lines changed: 506 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
mapped_pages:
3+
- https://www.elastic.co/guide/en/elasticsearch/plugins/current/creating-classic-plugins.html
4+
---
5+
6+
# Creating classic plugins [creating-classic-plugins]
7+
8+
Classic plugins provide {{es}} with mechanisms for custom authentication, authorization, scoring, and more.
9+
10+
::::{admonition} Plugin release lifecycle
11+
:class: important
12+
13+
Classic plugins require you to build a new version for each new {{es}} release. This version is checked when the plugin is installed and when it is loaded. {{es}} will refuse to start in the presence of plugins with the incorrect `elasticsearch.version`.
14+
15+
::::
16+
17+
18+
19+
## Classic plugin file structure [_classic_plugin_file_structure]
20+
21+
Classic plugins are ZIP files composed of JAR files and [a metadata file called `plugin-descriptor.properties`](/extend/plugin-descriptor-file-classic.md), a Java properties file that describes the plugin.
22+
23+
Note that only JAR files at the root of the plugin are added to the classpath for the plugin. If you need other resources, package them into a resources JAR.
24+
25+
26+
## Example plugins [_example_plugins]
27+
28+
The {{es}} repository contains [examples of plugins](https://github.com/elastic/elasticsearch/tree/main/plugins/examples). Some of these include:
29+
30+
* a plugin with [custom settings](https://github.com/elastic/elasticsearch/tree/main/plugins/examples/custom-settings)
31+
* a plugin with a [custom ingest processor](https://github.com/elastic/elasticsearch/tree/main/plugins/examples/custom-processor)
32+
* adding [custom rest endpoints](https://github.com/elastic/elasticsearch/tree/main/plugins/examples/rest-handler)
33+
* adding a [custom rescorer](https://github.com/elastic/elasticsearch/tree/main/plugins/examples/rescore)
34+
* a script [implemented in Java](https://github.com/elastic/elasticsearch/tree/main/plugins/examples/script-expert-scoring)
35+
36+
These examples provide the bare bones needed to get started. For more information about how to write a plugin, we recommend looking at the [source code of existing plugins](https://github.com/elastic/elasticsearch/tree/main/plugins/) for inspiration.
37+
38+
39+
## Testing your plugin [_testing_your_plugin]
40+
41+
Use `bin/elasticsearch-plugin install file:///path/to/your/plugin` to install your plugin for testing. The Java plugin is auto-loaded only if it’s in the `plugins/` directory.
42+
43+
44+
## Java Security permissions [plugin-authors-jsm]
45+
46+
Some plugins may need additional security permissions. A plugin can include the optional `plugin-security.policy` file containing `grant` statements for additional permissions. Any additional permissions will be displayed to the user with a large warning, and they will have to confirm them when installing the plugin interactively. So if possible, it is best to avoid requesting any spurious permissions!
47+
48+
If you are using the {{es}} Gradle build system, place this file in `src/main/plugin-metadata` and it will be applied during unit tests as well.
49+
50+
The Java security model is stack-based, and additional permissions are granted to the jars in your plugin, so you have to write proper security code around operations requiring elevated privileges. You might add a check to prevent unprivileged code (such as scripts) from gaining escalated permissions. For example:
51+
52+
```java
53+
// ES permission you should check before doPrivileged() blocks
54+
import org.elasticsearch.SpecialPermission;
55+
56+
SecurityManager sm = System.getSecurityManager();
57+
if (sm != null) {
58+
// unprivileged code such as scripts do not have SpecialPermission
59+
sm.checkPermission(new SpecialPermission());
60+
}
61+
AccessController.doPrivileged(
62+
// sensitive operation
63+
);
64+
```
65+
66+
Check [Secure Coding Guidelines for Java SE](https://www.oracle.com/technetwork/java/seccodeguide-139067.md) for more information.
67+
68+

0 commit comments

Comments
 (0)