Skip to content

Commit 4de7133

Browse files
committed
Merge remote-tracking branch 'es/master' into enrich
2 parents 0caca2f + a8a7477 commit 4de7133

File tree

127 files changed

+1169
-712
lines changed

Some content is hidden

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

127 files changed

+1169
-712
lines changed

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

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ class BuildPlugin implements Plugin<Project> {
131131

132132
project.getTasks().register("buildResources", ExportElasticsearchBuildResourcesTask)
133133

134-
setupSeed(project)
135134
configureRepositories(project)
136135
project.extensions.getByType(ExtraPropertiesExtension).set('versions', VersionProperties.versions)
137136
configureInputNormalization(project)
@@ -950,32 +949,6 @@ class BuildPlugin implements Plugin<Project> {
950949
}
951950
}
952951

953-
/**
954-
* Pins the test seed at configuration time so it isn't different on every
955-
* {@link Test} execution. This is useful if random
956-
* decisions in one run of {@linkplain Test} influence the
957-
* outcome of subsequent runs. Pinning the seed up front like this makes
958-
* the reproduction line from one run be useful on another run.
959-
*/
960-
static String setupSeed(Project project) {
961-
ExtraPropertiesExtension ext = project.rootProject.extensions.getByType(ExtraPropertiesExtension)
962-
if (ext.has('testSeed')) {
963-
/* Skip this if we've already pinned the testSeed. It is important
964-
* that this checks the rootProject so that we know we've only ever
965-
* initialized one time. */
966-
return ext.get('testSeed')
967-
}
968-
969-
String testSeed = System.getProperty('tests.seed')
970-
if (testSeed == null) {
971-
long seed = new Random(System.currentTimeMillis()).nextLong()
972-
testSeed = Long.toUnsignedString(seed, 16).toUpperCase(Locale.ROOT)
973-
}
974-
975-
ext.set('testSeed', testSeed)
976-
return testSeed
977-
}
978-
979952
private static class TestFailureReportingPlugin implements Plugin<Project> {
980953
@Override
981954
void apply(Project project) {

buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/RestTestsFromSnippetsTask.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import groovy.transform.PackageScope
2323
import org.elasticsearch.gradle.doc.SnippetsTask.Snippet
2424
import org.gradle.api.InvalidUserDataException
2525
import org.gradle.api.tasks.Input
26+
import org.gradle.api.tasks.Internal
2627
import org.gradle.api.tasks.OutputDirectory
2728

2829
import java.nio.file.Files
@@ -58,6 +59,7 @@ class RestTestsFromSnippetsTask extends SnippetsTask {
5859
@OutputDirectory
5960
File testRoot = project.file('build/rest')
6061

62+
@Internal
6163
Set<String> names = new HashSet<>()
6264

6365
RestTestsFromSnippetsTask() {

buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class PluginBuildPlugin implements Plugin<Project> {
146146

147147
private static void configureDependencies(Project project) {
148148
project.dependencies {
149-
if (ClasspathUtils.isElasticsearchProject()) {
149+
if (ClasspathUtils.isElasticsearchProject(project)) {
150150
compileOnly project.project(':server')
151151
testCompile project.project(':test:framework')
152152
} else {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class PrecommitTasks {
4747
}
4848

4949
Configuration jarHellConfig = project.configurations.create("jarHell")
50-
if (ClasspathUtils.isElasticsearchProject() && project.path.equals(":libs:elasticsearch-core") == false) {
50+
if (ClasspathUtils.isElasticsearchProject(project) && project.path.equals(":libs:elasticsearch-core") == false) {
5151
// External plugins will depend on this already via transitive dependencies.
5252
// Internal projects are not all plugins, so make sure the check is available
5353
// we are not doing this for this project itself to avoid jar hell with itself
@@ -252,7 +252,7 @@ class PrecommitTasks {
252252
}
253253

254254
private static TaskProvider configureLoggerUsage(Project project) {
255-
Object dependency = ClasspathUtils.isElasticsearchProject() ? project.project(':test:logger-usage') :
255+
Object dependency = ClasspathUtils.isElasticsearchProject(project) ? project.project(':test:logger-usage') :
256256
"org.elasticsearch.test:logger-usage:${VersionProperties.elasticsearch}"
257257

258258
project.configurations.create('loggerUsagePlugin')

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestIntegTestTask.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ package org.elasticsearch.gradle.test
2121
import org.elasticsearch.gradle.VersionProperties
2222
import org.elasticsearch.gradle.testclusters.ElasticsearchCluster
2323
import org.elasticsearch.gradle.testclusters.RestTestRunnerTask
24-
import org.elasticsearch.gradle.testclusters.TestClustersPlugin
2524
import org.elasticsearch.gradle.tool.Boilerplate
2625
import org.elasticsearch.gradle.tool.ClasspathUtils
2726
import org.gradle.api.DefaultTask
@@ -124,7 +123,7 @@ class RestIntegTestTask extends DefaultTask {
124123
Boilerplate.maybeCreate(project.configurations, 'restSpec') {
125124
project.dependencies.add(
126125
'restSpec',
127-
ClasspathUtils.isElasticsearchProject() ? project.project(':rest-api-spec') :
126+
ClasspathUtils.isElasticsearchProject(project) ? project.project(':rest-api-spec') :
128127
"org.elasticsearch:rest-api-spec:${VersionProperties.elasticsearch}"
129128
)
130129
}

buildSrc/src/main/java/org/elasticsearch/gradle/ReaperPlugin.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package org.elasticsearch.gradle;
2121

22+
import org.elasticsearch.gradle.info.GlobalBuildInfoPlugin;
2223
import org.gradle.api.Plugin;
2324
import org.gradle.api.Project;
2425

@@ -35,10 +36,12 @@ public void apply(Project project) {
3536
throw new IllegalArgumentException("ReaperPlugin can only be applied to the root project of a build");
3637
}
3738

39+
project.getPlugins().apply(GlobalBuildInfoPlugin.class);
40+
3841
Path inputDir = project.getRootDir().toPath().resolve(".gradle")
3942
.resolve("reaper").resolve("build-" + ProcessHandle.current().pid());
4043
ReaperService service = project.getExtensions().create("reaper", ReaperService.class,
41-
project.getLogger(), project.getBuildDir().toPath(), inputDir);
44+
project, project.getBuildDir().toPath(), inputDir);
4245

4346
project.getGradle().buildFinished(result -> service.shutdown());
4447
}

buildSrc/src/main/java/org/elasticsearch/gradle/ReaperService.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.elasticsearch.gradle.tool.ClasspathUtils;
2323
import org.gradle.api.GradleException;
24+
import org.gradle.api.Project;
2425
import org.gradle.api.logging.Logger;
2526
import org.gradle.internal.jvm.Jvm;
2627

@@ -38,14 +39,16 @@ public class ReaperService {
3839

3940
private static final String REAPER_CLASS = "org/elasticsearch/gradle/reaper/Reaper.class";
4041
private static final Pattern REAPER_JAR_PATH_PATTERN = Pattern.compile("file:(.*)!/" + REAPER_CLASS);
41-
private Logger logger;
42-
private Path buildDir;
43-
private Path inputDir;
44-
private Path logFile;
42+
private final Logger logger;
43+
private final boolean isInternal;
44+
private final Path buildDir;
45+
private final Path inputDir;
46+
private final Path logFile;
4547
private volatile Process reaperProcess;
4648

47-
public ReaperService(Logger logger, Path buildDir, Path inputDir) {
48-
this.logger = logger;
49+
public ReaperService(Project project, Path buildDir, Path inputDir) {
50+
this.logger = project.getLogger();
51+
this.isInternal = ClasspathUtils.isElasticsearchProject(project);
4952
this.buildDir = buildDir;
5053
this.inputDir = inputDir;
5154
this.logFile = inputDir.resolve("reaper.log");
@@ -135,7 +138,7 @@ private synchronized void ensureReaperStarted() {
135138
}
136139

137140
private Path locateReaperJar() {
138-
if (ClasspathUtils.isElasticsearchProject()) {
141+
if (isInternal) {
139142
// when running inside the Elasticsearch build just pull find the jar in the runtime classpath
140143
URL main = this.getClass().getClassLoader().getResource(REAPER_CLASS);
141144
String mainPath = main.getFile();

buildSrc/src/main/java/org/elasticsearch/gradle/info/GlobalBuildInfoPlugin.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
import java.util.Arrays;
2626
import java.util.HashMap;
2727
import java.util.List;
28+
import java.util.Locale;
2829
import java.util.Map;
30+
import java.util.Random;
2931
import java.util.stream.Collectors;
3032

3133
public class GlobalBuildInfoPlugin implements Plugin<Project> {
@@ -46,6 +48,15 @@ public void apply(Project project) {
4648
File compilerJavaHome = findCompilerJavaHome();
4749
File runtimeJavaHome = findRuntimeJavaHome(compilerJavaHome);
4850

51+
String testSeedProperty = System.getProperty("tests.seed");
52+
final String testSeed;
53+
if (testSeedProperty == null) {
54+
long seed = new Random(System.currentTimeMillis()).nextLong();
55+
testSeed = Long.toUnsignedString(seed, 16).toUpperCase(Locale.ROOT);
56+
} else {
57+
testSeed = testSeedProperty;
58+
}
59+
4960
final List<JavaHome> javaVersions = new ArrayList<>();
5061
for (int version = 8; version <= Integer.parseInt(minimumCompilerVersion.getMajorVersion()); version++) {
5162
if (System.getenv(getJavaHomeEnvVarName(Integer.toString(version))) != null) {
@@ -95,7 +106,9 @@ public void apply(Project project) {
95106
ext.set("gradleJavaVersion", Jvm.current().getJavaVersion());
96107
ext.set("gitRevision", gitRevision(project.getRootProject().getRootDir()));
97108
ext.set("buildDate", ZonedDateTime.now(ZoneOffset.UTC));
109+
ext.set("testSeed", testSeed);
98110
ext.set("isCi", System.getenv("JENKINS_URL") != null);
111+
ext.set("isInternal", GlobalBuildInfoPlugin.class.getResource("/buildSrc.marker") != null);
99112
});
100113
}
101114

@@ -265,5 +278,4 @@ private static String readFirstLine(final Path path) throws IOException {
265278
.findFirst()
266279
.orElseThrow(() -> new IOException("file [" + path + "] is empty"));
267280
}
268-
269281
}

buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchCluster.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ public void setNumberOfNodes(int numberOfNodes) {
104104
}
105105
}
106106

107+
@Internal
107108
ElasticsearchNode getFirstNode() {
108109
return nodes.getAt(clusterName + "-0");
109110
}

buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/RunTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class RunTask extends DefaultTestClustersTask {
2323
description = "Enable debugging configuration, to allow attaching a debugger to elasticsearch."
2424
)
2525
public void setDebug(boolean enabled) {
26-
this.debug = debug;
26+
this.debug = enabled;
2727
}
2828

2929
@Input
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
package org.elasticsearch.gradle.tool;
22

3-
public class ClasspathUtils {
4-
private static boolean isElasticsearchProject;
3+
import org.gradle.api.Project;
4+
import org.gradle.api.plugins.ExtraPropertiesExtension;
55

6-
static {
7-
// look for buildSrc marker file, if it exists then we are running in the context of the elastic/elasticsearch build
8-
isElasticsearchProject = ClasspathUtils.class.getResource("/buildSrc.marker") != null;
9-
}
6+
public class ClasspathUtils {
107

118
private ClasspathUtils() {
129
}
@@ -17,7 +14,8 @@ private ClasspathUtils() {
1714
*
1815
* @return if we are currently running in the `elastic/elasticsearch` project
1916
*/
20-
public static boolean isElasticsearchProject() {
21-
return isElasticsearchProject;
17+
public static boolean isElasticsearchProject(Project project) {
18+
ExtraPropertiesExtension ext = project.getExtensions().getByType(ExtraPropertiesExtension.class);
19+
return (boolean) ext.get("isInternal");
2220
}
2321
}

buildSrc/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
elasticsearch = 8.0.0
2-
lucene = 8.2.0
2+
lucene = 8.3.0-snapshot-47aece66b48
33

44
bundled_jdk_vendor = adoptopenjdk
55
bundled_jdk = 13+33

client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/Role.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
import org.elasticsearch.common.Strings;
2525
import org.elasticsearch.common.collect.Tuple;
2626
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
27-
import org.elasticsearch.common.xcontent.XContentParser;
2827
import org.elasticsearch.common.xcontent.ObjectParser.ValueType;
28+
import org.elasticsearch.common.xcontent.XContentParser;
2929

3030
import java.util.Arrays;
3131
import java.util.Collection;
@@ -299,12 +299,14 @@ public static class ClusterPrivilegeName {
299299
public static final String NONE = "none";
300300
public static final String ALL = "all";
301301
public static final String MONITOR = "monitor";
302-
public static final String MONITOR_DATA_FRAME_TRANSFORMS = "monitor_data_frame_transforms";
302+
public static final String MONITOR_TRANSFORM_DEPRECATED = "monitor_data_frame_transforms";
303+
public static final String MONITOR_TRANSFORM = "monitor_transform";
303304
public static final String MONITOR_ML = "monitor_ml";
304305
public static final String MONITOR_WATCHER = "monitor_watcher";
305306
public static final String MONITOR_ROLLUP = "monitor_rollup";
306307
public static final String MANAGE = "manage";
307-
public static final String MANAGE_DATA_FRAME_TRANSFORMS = "manage_data_frame_transforms";
308+
public static final String MANAGE_TRANSFORM_DEPRECATED = "manage_data_frame_transforms";
309+
public static final String MANAGE_TRANSFORM = "manage_transform";
308310
public static final String MANAGE_ML = "manage_ml";
309311
public static final String MANAGE_WATCHER = "manage_watcher";
310312
public static final String MANAGE_ROLLUP = "manage_rollup";
@@ -321,8 +323,8 @@ public static class ClusterPrivilegeName {
321323
public static final String MANAGE_ILM = "manage_ilm";
322324
public static final String READ_ILM = "read_ilm";
323325
public static final String MANAGE_ENRICH = "manage_enrich";
324-
public static final String[] ALL_ARRAY = new String[] { NONE, ALL, MONITOR, MONITOR_DATA_FRAME_TRANSFORMS, MONITOR_ML,
325-
MONITOR_WATCHER, MONITOR_ROLLUP, MANAGE, MANAGE_DATA_FRAME_TRANSFORMS,
326+
public static final String[] ALL_ARRAY = new String[] { NONE, ALL, MONITOR, MONITOR_TRANSFORM_DEPRECATED, MONITOR_TRANSFORM,
327+
MONITOR_ML, MONITOR_WATCHER, MONITOR_ROLLUP, MANAGE, MANAGE_TRANSFORM_DEPRECATED, MANAGE_TRANSFORM,
326328
MANAGE_ML, MANAGE_WATCHER, MANAGE_ROLLUP, MANAGE_INDEX_TEMPLATES, MANAGE_INGEST_PIPELINES, TRANSPORT_CLIENT,
327329
MANAGE_SECURITY, MANAGE_SAML, MANAGE_OIDC, MANAGE_TOKEN, MANAGE_PIPELINE, MANAGE_CCR, READ_CCR, MANAGE_ILM, READ_ILM,
328330
MANAGE_ENRICH };

client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SecurityDocumentationIT.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.elasticsearch.client.RequestOptions;
2929
import org.elasticsearch.client.RestHighLevelClient;
3030
import org.elasticsearch.client.security.AuthenticateResponse;
31+
import org.elasticsearch.client.security.AuthenticateResponse.RealmInfo;
3132
import org.elasticsearch.client.security.ChangePasswordRequest;
3233
import org.elasticsearch.client.security.ClearRealmCacheRequest;
3334
import org.elasticsearch.client.security.ClearRealmCacheResponse;
@@ -79,7 +80,6 @@
7980
import org.elasticsearch.client.security.PutUserResponse;
8081
import org.elasticsearch.client.security.RefreshPolicy;
8182
import org.elasticsearch.client.security.TemplateRoleName;
82-
import org.elasticsearch.client.security.AuthenticateResponse.RealmInfo;
8383
import org.elasticsearch.client.security.support.ApiKey;
8484
import org.elasticsearch.client.security.support.CertificateInfo;
8585
import org.elasticsearch.client.security.support.expressiondsl.RoleMapperExpression;
@@ -99,8 +99,6 @@
9999
import org.elasticsearch.common.util.set.Sets;
100100
import org.hamcrest.Matchers;
101101

102-
import javax.crypto.SecretKeyFactory;
103-
import javax.crypto.spec.PBEKeySpec;
104102
import java.io.IOException;
105103
import java.io.InputStream;
106104
import java.nio.file.Files;
@@ -121,6 +119,9 @@
121119
import java.util.concurrent.CountDownLatch;
122120
import java.util.concurrent.TimeUnit;
123121

122+
import javax.crypto.SecretKeyFactory;
123+
import javax.crypto.spec.PBEKeySpec;
124+
124125
import static org.hamcrest.Matchers.contains;
125126
import static org.hamcrest.Matchers.containsInAnyOrder;
126127
import static org.hamcrest.Matchers.containsString;
@@ -681,8 +682,8 @@ public void testGetRoles() throws Exception {
681682

682683
List<Role> roles = response.getRoles();
683684
assertNotNull(response);
684-
// 27 system roles plus the three we created
685-
assertThat(roles.size(), equalTo(31));
685+
// 29 system roles plus the three we created
686+
assertThat(roles.size(), equalTo(33));
686687
}
687688

688689
{

docs/Versions.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
include::{asciidoc-dir}/../../shared/versions/stack/{source_branch}.asciidoc[]
33

4-
:lucene_version: 8.2.0
5-
:lucene_version_path: 8_2_0
4+
:lucene_version: 8.3.0
5+
:lucene_version_path: 8_3_0
66
:jdk: 11.0.2
77
:jdk_major: 11
88
:build_flavor: default

docs/reference/indices/split-index.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ POST /twitter/_split/split-twitter-index
2121
[[split-index-api-request]]
2222
==== {api-request-title}
2323

24-
`POST /<index>/_shrink/<target-index>`
24+
`POST /<index>/_split/<target-index>`
2525

26-
`PUT /<index>/_shrink/<target-index>`
26+
`PUT /<index>/_split/<target-index>`
2727

2828

2929
[[split-index-api-prereqs]]

docs/reference/ml/df-analytics/apis/put-dfanalytics.asciidoc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,22 @@ and mappings.
6161
==== {api-request-body-title}
6262

6363
`analysis`::
64-
(Required, object) Defines the type of {dfanalytics} you want to perform on your source
65-
index. For example: `outlier_detection`. See <<dfanalytics-types>>.
64+
(Required, object) Defines the type of {dfanalytics} you want to perform on
65+
your source index. For example: `outlier_detection`. See
66+
<<dfanalytics-types>>.
6667

6768
`analyzed_fields`::
6869
(Optional, object) You can specify both `includes` and/or `excludes` patterns.
6970
If `analyzed_fields` is not set, only the relevant fields will be included.
70-
For example, all the numeric fields for {oldetection}.
71+
For example, all the numeric fields for {oldetection}. For the potential field
72+
type limitations, see
73+
{stack-ov}/ml-dfa-limitations.html[{dfanalytics} limitations].
7174

72-
`analyzed_fields.includes`:::
75+
`includes`:::
7376
(Optional, array) An array of strings that defines the fields that will be
7477
included in the analysis.
7578

76-
`analyzed_fields.excludes`:::
79+
`excludes`:::
7780
(Optional, array) An array of strings that defines the fields that will be
7881
excluded from the analysis.
7982

0 commit comments

Comments
 (0)