Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indices options group wildcards #7

Closed
wants to merge 66 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
e35d783
Mark the enum options IGNORE_ALIASES and ALLOW_NO_INDICES as deprecat…
gmarouli Jan 23, 2024
9bb5ade
Group all wildcard options in one class.
gmarouli Jan 23, 2024
00c6c5b
Fix class method failure
gmarouli Jan 24, 2024
764e8f3
Fix XContent serialization
gmarouli Jan 24, 2024
93527cb
Support conflicting XContent serialization expectations
gmarouli Jan 24, 2024
bea09bf
Support conflicting XContent serialization expectations
gmarouli Jan 24, 2024
65a7035
Merge branch 'main' into indices-options-group-wildcards
gmarouli Jan 24, 2024
d5c0dcf
[Connectors API] Implement update service type action (#104643)
jedrazb Jan 24, 2024
4323ac3
Remove explicit ALLOW_NO_INDICES, it is on by default
gmarouli Jan 24, 2024
ef630a6
adding known issue for int8_hnsw (#104664)
benwtrent Jan 24, 2024
9d3207c
Speedup check for dynamic mappers when parsing documents (#104698)
original-brownbear Jan 24, 2024
7ef80f2
Fix precision issue in CI for cartesian centroids (#104707)
craigtaverner Jan 24, 2024
1c29d6e
Use faster way of making a set from a CHM (#104704)
original-brownbear Jan 24, 2024
d9088fa
Update IndicesOptionsTests and fix the related found bugs
gmarouli Jan 24, 2024
6c86aed
Rename expandWildcards field
gmarouli Jan 24, 2024
324d35f
Also allow test_grok_pattern's content passed by query param (#104714)
jan-elastic Jan 24, 2024
37c4393
Improve comments
gmarouli Jan 24, 2024
30f9639
Improve S3 storage class docs (#104599)
DaveCTurner Jan 24, 2024
8363437
TestGrokPatternAction is local-only (#104710)
DaveCTurner Jan 24, 2024
ab8ee60
Fix SamlAuthenticationIT flakyness (#103867)
breskeby Jan 24, 2024
6b910db
Fix serverless docker setup compatibility (#104724)
breskeby Jan 24, 2024
0f17ff4
[ML] Avoid possible datafeed infinite loop with filtering aggregation…
droberts195 Jan 24, 2024
eb8c73f
[ML] Adding support for Cohere inference service (#104559)
jonathan-buttner Jan 24, 2024
9b4647c
AwaitsFix #104728
mark-vieira Jan 24, 2024
90acd5d
merge with main
gmarouli Jan 25, 2024
d1e5f72
ESQL: Fix replacement of nested expressions in aggs with multiple par…
luigidellaquila Jan 25, 2024
e0ddb82
[CI] Ensure large response can fit into 3 messages (#104729)
ywangd Jan 25, 2024
a7f2e2d
Fix testRestoreSnapshotAllocationDoesNotExceedWatermarkWithMultipleSh…
idegtiarenko Jan 25, 2024
1116889
Remove unused arg from `ActionType` ctor (#104650)
DaveCTurner Jan 25, 2024
55ba6fe
Reinstate compat shim lost in #104650
DaveCTurner Jan 25, 2024
bec2115
Remove `ThreadPool` arg from `TransportResponseHandler#executor` (#10…
DaveCTurner Jan 25, 2024
82c4cc7
Fix dependency check for ignored licenses (#104736)
breskeby Jan 25, 2024
875840d
Rename resolveAlias to resolveAliases
gmarouli Jan 25, 2024
906cd66
Fix NPE
gmarouli Jan 25, 2024
de5821b
Fix test
gmarouli Jan 25, 2024
d6d449b
Fix XContent parsing
gmarouli Jan 25, 2024
54adb8d
Small fixes
gmarouli Jan 25, 2024
b4345d9
[Enterprise Search] Add `.connector-secrets` system index and GET/POS…
navarone-feekery Jan 25, 2024
4e91d69
Export random sampler agg from server (#104747)
droberts195 Jan 25, 2024
cb68e44
Extract GeneralOptions
gmarouli Jan 25, 2024
e48b549
[DOCS] Fixes asciidoc syntax in PUT trained models API docs. (#104741)
szabosteve Jan 25, 2024
209b655
Avoid eager task realization (#103343)
breskeby Jan 25, 2024
05ea8c7
Revert "[Enterprise Search] Add `.connector-secrets` system index and…
navarone-feekery Jan 25, 2024
599a96b
Fix writable
gmarouli Jan 25, 2024
35aff34
[ML] Add an important note about a gotcha with the delayed data check…
droberts195 Jan 25, 2024
05c7377
Closing services (#104726)
jonathan-buttner Jan 25, 2024
ba579f0
Preserve old serialisation for performance reasons
gmarouli Jan 25, 2024
e87c49c
[DOCS] Improve ES|QL functions reference for functions E-Z (#104623)
abdonpijpelink Jan 25, 2024
3fb2893
Avoid execute ESQL planning on refresh thread (#104591)
dnhatn Jan 25, 2024
048fa93
[Profiling] Refine co2 calculation data (#104628)
rockdaboot Jan 25, 2024
fc2bdc2
Build sub aggregation buckets more lazily (#104762)
original-brownbear Jan 25, 2024
a22e332
Extract concrete index options
gmarouli Jan 25, 2024
03c9f89
Make RestResponse releasable (#104752)
DaveCTurner Jan 25, 2024
e0514f3
[ES|QL] Allow DateTime as the third and fourth inputs to auto_bucket …
fang-xing-esql Jan 25, 2024
2a5cd78
Mute data_stream test (#104775)
mayya-sharipova Jan 25, 2024
79b7dbb
ESQL: add =~ operator (case insensitive equality) (#103656)
luigidellaquila Jan 26, 2024
6051c0d
Merge branch 'main' into indices-options-group-wildcards
gmarouli Jan 26, 2024
d876ec7
Add skip tags to three tests to prevent them from being run on versio…
fang-xing-esql Jan 26, 2024
807147d
Revert "x-pack/plugin/core: make automatic rollovers lazy" (#104734)
axw Jan 26, 2024
e495f7f
Use the randomly generated options
gmarouli Jan 26, 2024
d128481
Redefine index version 8500009 for use by 8.12.1 (#104755)
thecoop Jan 26, 2024
d5fd6ee
Merge branch 'main' into indices-options-group-wildcards
gmarouli Jan 26, 2024
99a6f89
Replace constructor usage with builders
gmarouli Jan 26, 2024
922781c
Reduce number of constants
gmarouli Jan 26, 2024
3d7b292
Use builder
gmarouli Jan 26, 2024
c8e4c91
Remove Writable from grouped IndicesOptions
gmarouli Jan 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .buildkite/scripts/fixture-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -euo pipefail

echo "$DOCKER_REGISTRY_PASSWORD" | docker login -u "$DOCKER_REGISTRY_USERNAME" --password-stdin docker.elastic.co
unset DOCKER_REGISTRY_USERNAME DOCKER_REGISTRY_PASSWORD

docker buildx create --use
.ci/scripts/run-gradle.sh deployFixtureDockerImages
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public TaskProvider<? extends Task> createTask(Project project) {
.register("validate" + publicationName + "Pom", PomValidationTask.class);
validatePom.configure(t -> t.dependsOn(validateTask));
validateTask.configure(task -> {
GenerateMavenPom generateMavenPom = project.getTasks()
TaskProvider<GenerateMavenPom> generateMavenPom = project.getTasks()
.withType(GenerateMavenPom.class)
.getByName("generatePomFileFor" + publicationName + "Publication");
.named("generatePomFileFor" + publicationName + "Publication");
task.dependsOn(generateMavenPom);
task.getPomFile().fileValue(generateMavenPom.getDestination());
task.getPomFile().fileProvider(generateMavenPom.map(GenerateMavenPom::getDestination));
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
import org.gradle.api.provider.ListProperty;
import org.gradle.api.provider.MapProperty;
import org.gradle.api.provider.Property;
import org.gradle.api.provider.SetProperty;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputDirectory;
import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.OutputFile;
import org.gradle.api.tasks.PathSensitive;
import org.gradle.api.tasks.PathSensitivity;
Expand All @@ -36,14 +38,15 @@
import java.nio.file.Files;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

import javax.inject.Inject;

/**
* This task wraps up the details of building a Docker image, including adding a pull
* mechanism that can retry, and emitting the image SHA as a task output.
*/
public class DockerBuildTask extends DefaultTask {
public abstract class DockerBuildTask extends DefaultTask {
private static final Logger LOGGER = Logging.getLogger(DockerBuildTask.class);

private final WorkerExecutor workerExecutor;
Expand All @@ -55,15 +58,13 @@ public class DockerBuildTask extends DefaultTask {
private boolean noCache = true;
private String[] baseImages;
private MapProperty<String, String> buildArgs;
private Property<String> platform;

@Inject
public DockerBuildTask(WorkerExecutor workerExecutor, ObjectFactory objectFactory, ProjectLayout projectLayout) {
this.workerExecutor = workerExecutor;
this.markerFile = objectFactory.fileProperty();
this.dockerContext = objectFactory.directoryProperty();
this.buildArgs = objectFactory.mapProperty(String.class, String.class);
this.platform = objectFactory.property(String.class).convention(Architecture.current().dockerPlatform);
this.markerFile.set(projectLayout.getBuildDirectory().file("markers/" + this.getName() + ".marker"));
}

Expand All @@ -75,9 +76,10 @@ public void build() {
params.getTags().set(Arrays.asList(tags));
params.getPull().set(pull);
params.getNoCache().set(noCache);
params.getPush().set(getPush().getOrElse(false));
params.getBaseImages().set(Arrays.asList(baseImages));
params.getBuildArgs().set(buildArgs);
params.getPlatform().set(platform);
params.getPlatforms().set(getPlatforms());
});
}

Expand Down Expand Up @@ -129,10 +131,16 @@ public MapProperty<String, String> getBuildArgs() {
}

@Input
public Property<String> getPlatform() {
return platform;
public abstract SetProperty<String> getPlatforms();

public void setPlatform(String platform) {
getPlatforms().set(Arrays.asList(platform));
}

@Input
@Optional
public abstract Property<Boolean> getPush();

@OutputFile
public RegularFileProperty getMarkerFile() {
return markerFile;
Expand Down Expand Up @@ -181,7 +189,7 @@ public void execute() {
}

final List<String> tags = parameters.getTags().get();
final boolean isCrossPlatform = parameters.getPlatform().get().equals(Architecture.current().dockerPlatform) == false;
final boolean isCrossPlatform = isCrossPlatform();

LoggedExec.exec(execOperations, spec -> {
spec.executable("docker");
Expand All @@ -193,7 +201,7 @@ public void execute() {
spec.args("build", parameters.getDockerContext().get().getAsFile().getAbsolutePath());

if (isCrossPlatform) {
spec.args("--platform", parameters.getPlatform().get());
spec.args("--platform", parameters.getPlatforms().get().stream().collect(Collectors.joining(",")));
}

if (parameters.getNoCache().get()) {
Expand All @@ -203,18 +211,34 @@ public void execute() {
tags.forEach(tag -> spec.args("--tag", tag));

parameters.getBuildArgs().get().forEach((k, v) -> spec.args("--build-arg", k + "=" + v));

if (parameters.getPush().getOrElse(false)) {
spec.args("--push");
}
});

// Fetch the Docker image's hash, and write it to desk as the task's output. Doing this allows us
// to do proper up-to-date checks in Gradle.
try {
// multi-platform image builds do not end up in local registry, so we need to pull the just build image
// first to get the checksum and also serves as a test for the image being pushed correctly
if (parameters.getPlatforms().get().size() > 1 && parameters.getPush().getOrElse(false)) {
pullBaseImage(tags.get(0));
}
final String checksum = getImageChecksum(tags.get(0));
Files.writeString(parameters.getMarkerFile().getAsFile().get().toPath(), checksum + "\n");
} catch (IOException e) {
throw new RuntimeException("Failed to write marker file", e);
}
}

private boolean isCrossPlatform() {
return getParameters().getPlatforms()
.get()
.stream()
.anyMatch(any -> any.equals(Architecture.current().dockerPlatform) == false);
}

private String getImageChecksum(String imageTag) {
final ByteArrayOutputStream stdout = new ByteArrayOutputStream();

Expand Down Expand Up @@ -243,6 +267,8 @@ interface Parameters extends WorkParameters {

MapProperty<String, String> getBuildArgs();

Property<String> getPlatform();
SetProperty<String> getPlatforms();

Property<Boolean> getPush();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
Expand Down Expand Up @@ -187,7 +188,7 @@ public void checkDependencies() {
}
File licensesDirAsFile = licensesDir.get().getAsFile();
if (dependencies.isEmpty()) {
if (licensesDirAsFile.exists()) {
if (licensesDirAsFile.exists() && allIgnored() == false) {
throw new GradleException("Licenses dir " + licensesDirAsFile + " exists, but there are no dependencies");
}
return; // no dependencies to check
Expand Down Expand Up @@ -227,6 +228,10 @@ public void checkDependencies() {
sources.forEach((item, exists) -> failIfAnyMissing(item, exists, "sources"));
}

private boolean allIgnored() {
return Arrays.asList(getLicensesDir().listFiles()).stream().map(f -> f.getName()).allMatch(ignoreFiles::contains);
}

// This is just a marker output folder to allow this task being up-to-date.
// The check logic is exception driven so a failed tasks will not be defined
// by this output but when successful we can safely mark the task as up-to-date.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,17 @@ public void execute(DependencyLicensesTask dependencyLicensesTask) {
public void givenProjectWithLicensesDirButNoDependenciesThenShouldThrowException() throws Exception {
expectedException.expect(GradleException.class);
expectedException.expectMessage(containsString("exists, but there are no dependencies"));
getLicensesDir(project).mkdir();
createFileIn(getLicensesDir(project), "groovy-LICENSE.txt", PERMISSIVE_LICENSE_TEXT);
task.get().checkDependencies();
}

@Test
public void givenProjectWithLicensesDirButAllIgnoreFileAndNoDependencies() throws Exception {
getLicensesDir(project).mkdir();
String licenseFileName = "cloudcarbonfootprint-LICENSE.txt";
createFileIn(getLicensesDir(project), licenseFileName, PERMISSIVE_LICENSE_TEXT);
task.get().ignoreFile(licenseFileName);
task.get().checkDependencies();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

public class NoopPlugin extends Plugin implements ActionPlugin {

public static final ActionType<SearchResponse> NOOP_SEARCH_ACTION = new ActionType<>("mock:data/read/search", SearchResponse::new);
public static final ActionType<BulkResponse> NOOP_BULK_ACTION = new ActionType<>("mock:data/write/bulk", BulkResponse::new);
public static final ActionType<SearchResponse> NOOP_SEARCH_ACTION = new ActionType<>("mock:data/read/search");
public static final ActionType<BulkResponse> NOOP_BULK_ACTION = new ActionType<>("mock:data/write/bulk");

@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
Expand Down
4 changes: 2 additions & 2 deletions distribution/docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ void addBuildDockerImageTask(Architecture architecture, DockerBase base) {

noCache = BuildParams.isCi
tags = generateTags(base, architecture)
platform = architecture.dockerPlatform
platforms.add(architecture.dockerPlatform)

// We don't build the Iron Bank image when we release Elasticsearch, as there's
// separate process for submitting new releases. However, for testing we do a
Expand Down Expand Up @@ -468,7 +468,7 @@ void addBuildEssDockerImageTask(Architecture architecture) {
noCache = BuildParams.isCi
baseImages = []
tags = generateTags(base, architecture)
platform = architecture.dockerPlatform
platforms.add(architecture.dockerPlatform)

onlyIf("$architecture supported") { isArchitectureSupported(architecture) }
}
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog/103656.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 103656
summary: "ESQL: add =~ operator (case insensitive equality)"
area: ES|QL
type: feature
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/104559.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 104559
summary: Adding support for Cohere inference service
area: Machine Learning
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/104591.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 104591
summary: Avoid execute ESQL planning on refresh thread
area: ES|QL
type: bug
issues: []
6 changes: 0 additions & 6 deletions docs/changelog/104597.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions docs/changelog/104643.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 104643
summary: "[Connectors API] Implement update service type action"
area: Application
type: enhancement
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/104718.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 104718
summary: "ESQL: Fix replacement of nested expressions in aggs with multiple parameters"
area: ES|QL
type: bug
issues:
- 104706
6 changes: 6 additions & 0 deletions docs/changelog/104722.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 104722
summary: Avoid possible datafeed infinite loop with filtering aggregations
area: Machine Learning
type: bug
issues:
- 104699
5 changes: 2 additions & 3 deletions docs/reference/esql/functions/asin.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ Numeric expression. If `null`, the function returns `null`.

*Description*

Returns the
https://en.wikipedia.org/wiki/Inverse_trigonometric_functions[arcsine]
of the input numeric expression as an angle, expressed in radians.
Returns the {wikipedia}/Inverse_trigonometric_functions[arcsine] of the input
numeric expression as an angle, expressed in radians.

*Supported types*

Expand Down
5 changes: 2 additions & 3 deletions docs/reference/esql/functions/atan.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ Numeric expression. If `null`, the function returns `null`.

*Description*

Returns the
https://en.wikipedia.org/wiki/Inverse_trigonometric_functions[arctangent] of the
input numeric expression as an angle, expressed in radians.
Returns the {wikipedia}/Inverse_trigonometric_functions[arctangent] of the input
numeric expression as an angle, expressed in radians.

*Supported types*

Expand Down
5 changes: 2 additions & 3 deletions docs/reference/esql/functions/atan2.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ Numeric expression. If `null`, the function returns `null`.

*Description*

The https://en.wikipedia.org/wiki/Atan2[angle] between the positive x-axis and
the ray from the origin to the point (x , y) in the Cartesian plane, expressed
in radians.
The {wikipedia}/Atan2[angle] between the positive x-axis and the ray from the
origin to the point (x , y) in the Cartesian plane, expressed in radians.

*Supported types*

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/esql/functions/auto_bucket.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

[source,esql]
----
AUTO_BUCKET(field, buckets, from, to)
AUTO_BUCKET(expression, buckets, from, to)
----

*Parameters*

`field`::
Numeric or date column from which to derive buckets.
Numeric or date expression from which to derive buckets.

`buckets`::
Target number of buckets.
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/esql/functions/avg.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

[source,esql]
----
AVG(column)
AVG(expression)
----

`column`::
Numeric column. If `null`, the function returns `null`.
`expression`::
Numeric expression. If `null`, the function returns `null`.

*Description*

The average of a numeric field.
The average of a numeric expression.

*Supported types*

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/esql/functions/cos.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Numeric expression. If `null`, the function returns `null`.

*Description*

Returns the https://en.wikipedia.org/wiki/Sine_and_cosine[cosine] of `n`. Input
expected in radians.
Returns the {wikipedia}/Sine_and_cosine[cosine] of `n`. Input expected in
radians.

*Supported types*

Expand Down
9 changes: 4 additions & 5 deletions docs/reference/esql/functions/cosh.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ image::esql/functions/signature/cosh.svg[Embedded,opts=inline]
`n`::
Numeric expression. If `null`, the function returns `null`.

*Supported types*
*Description*

include::types/cosh.asciidoc[]
Returns the {wikipedia}/Hyperbolic_functions[hyperbolic cosine].

*Description*
*Supported types*

Returns the https://en.wikipedia.org/wiki/Hyperbolic_functions[hyperbolic
cosine].
include::types/cosh.asciidoc[]

*Example*

Expand Down
Loading
Loading