Skip to content

Commit

Permalink
Merge branch 'main' into inference_metadata_fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikep86 committed Dec 18, 2024
2 parents 6c9edd0 + 1141ede commit a6e85bd
Show file tree
Hide file tree
Showing 232 changed files with 6,534 additions and 1,445 deletions.
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
import org.gradle.api.Task;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.component.ModuleComponentIdentifier;
import org.gradle.api.file.FileCollection;
import org.gradle.api.tasks.TaskProvider;

import java.io.File;
import java.nio.file.Path;

import static org.elasticsearch.gradle.internal.util.DependenciesUtils.createFileCollectionFromNonTransitiveArtifactsView;
import static org.elasticsearch.gradle.internal.util.DependenciesUtils.thirdPartyDependenciesView;
import static org.elasticsearch.gradle.internal.util.ParamsUtils.loadBuildParams;

public class ThirdPartyAuditPrecommitPlugin extends PrecommitPlugin {
Expand All @@ -47,7 +49,6 @@ public TaskProvider<? extends Task> createTask(Project project) {
project.getDependencies().add(JDK_JAR_HELL_CONFIG_NAME, elasticsearchCoreProject);
}
}

TaskProvider<ExportElasticsearchBuildResourcesTask> resourcesTask = project.getTasks()
.register("thirdPartyAuditResources", ExportElasticsearchBuildResourcesTask.class);
Path resourcesDir = project.getBuildDir().toPath().resolve("third-party-audit-config");
Expand All @@ -59,9 +60,11 @@ public TaskProvider<? extends Task> createTask(Project project) {
// usually only one task is created. but this construct makes our integTests easier to setup
project.getTasks().withType(ThirdPartyAuditTask.class).configureEach(t -> {
Configuration runtimeConfiguration = project.getConfigurations().getByName("runtimeClasspath");
FileCollection runtimeThirdParty = thirdPartyDependenciesView(runtimeConfiguration);
Configuration compileOnly = project.getConfigurations()
.getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME);
t.setClasspath(runtimeConfiguration.plus(compileOnly));
FileCollection compileOnlyThirdParty = thirdPartyDependenciesView(compileOnly);
t.getThirdPartyClasspath().from(runtimeThirdParty, compileOnlyThirdParty);
t.getJarsToScan()
.from(
createFileCollectionFromNonTransitiveArtifactsView(
Expand All @@ -78,7 +81,7 @@ public TaskProvider<? extends Task> createTask(Project project) {
t.getJavaHome().set(buildParams.flatMap(params -> params.getRuntimeJavaHome()).map(File::getPath));
t.setSignatureFile(resourcesDir.resolve("forbidden/third-party-audit.txt").toFile());
t.getJdkJarHellClasspath().from(jdkJarHellConfig);
t.getForbiddenAPIsClasspath().from(project.getConfigurations().getByName("forbiddenApisCliJar").plus(compileOnly));
t.getForbiddenAPIsClasspath().from(project.getConfigurations().getByName("forbiddenApisCliJar").plus(compileOnlyThirdParty));
});
return audit;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.gradle.api.JavaVersion;
import org.gradle.api.file.ArchiveOperations;
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.file.FileCollection;
import org.gradle.api.file.FileSystemOperations;
import org.gradle.api.file.FileTree;
import org.gradle.api.file.ProjectLayout;
Expand Down Expand Up @@ -96,8 +95,6 @@ public abstract class ThirdPartyAuditTask extends DefaultTask {

private final ProjectLayout projectLayout;

private FileCollection classpath;

@Inject
public ThirdPartyAuditTask(
ArchiveOperations archiveOperations,
Expand Down Expand Up @@ -198,9 +195,7 @@ public Set<String> getMissingClassExcludes() {
public abstract Property<JavaVersion> getRuntimeJavaVersion();

@Classpath
public FileCollection getClasspath() {
return classpath;
}
public abstract ConfigurableFileCollection getThirdPartyClasspath();

@TaskAction
public void runThirdPartyAudit() throws IOException {
Expand Down Expand Up @@ -345,7 +340,7 @@ private String runForbiddenAPIsCli() throws IOException {
if (javaHome.isPresent()) {
spec.setExecutable(javaHome.get() + "/bin/java");
}
spec.classpath(getForbiddenAPIsClasspath(), classpath);
spec.classpath(getForbiddenAPIsClasspath(), getThirdPartyClasspath());
// Enable explicitly for each release as appropriate. Just JDK 20/21/22/23 for now, and just the vector module.
if (isJavaVersion(VERSION_20) || isJavaVersion(VERSION_21) || isJavaVersion(VERSION_22) || isJavaVersion(VERSION_23)) {
spec.jvmArgs("--add-modules", "jdk.incubator.vector");
Expand Down Expand Up @@ -383,7 +378,7 @@ private boolean isJavaVersion(JavaVersion version) {
private Set<String> runJdkJarHellCheck() throws IOException {
ByteArrayOutputStream standardOut = new ByteArrayOutputStream();
ExecResult execResult = execOperations.javaexec(spec -> {
spec.classpath(getJdkJarHellClasspath(), classpath);
spec.classpath(getJdkJarHellClasspath(), getThirdPartyClasspath());
spec.getMainClass().set(JDK_JAR_HELL_MAIN_CLASS);
spec.args(getJarExpandDir());
spec.setIgnoreExitValue(true);
Expand All @@ -402,8 +397,4 @@ private Set<String> runJdkJarHellCheck() throws IOException {
return new TreeSet<>(Arrays.asList(jdkJarHellCheckList.split("\\r?\\n")));
}

public void setClasspath(FileCollection classpath) {
this.classpath = classpath;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@

package org.elasticsearch.gradle.internal.util;

import com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin;

import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.ResolvableDependencies;
import org.gradle.api.artifacts.component.ComponentIdentifier;
import org.gradle.api.artifacts.component.ProjectComponentIdentifier;
import org.gradle.api.artifacts.result.ResolvedComponentResult;
import org.gradle.api.artifacts.result.ResolvedDependencyResult;
import org.gradle.api.file.FileCollection;
import org.gradle.api.provider.Provider;
import org.gradle.api.specs.AndSpec;
import org.gradle.api.specs.Spec;

Expand All @@ -29,7 +33,7 @@ public static FileCollection createFileCollectionFromNonTransitiveArtifactsView(
) {
ResolvableDependencies incoming = configuration.getIncoming();
return incoming.artifactView(viewConfiguration -> {
Set<ComponentIdentifier> firstLevelDependencyComponents = incoming.getResolutionResult()
Provider<Set<ComponentIdentifier>> firstLevelDependencyComponents = incoming.getResolutionResult()
.getRootComponent()
.map(
rootComponent -> rootComponent.getDependencies()
Expand All @@ -39,12 +43,36 @@ public static FileCollection createFileCollectionFromNonTransitiveArtifactsView(
.filter(dependency -> dependency.getSelected() instanceof ResolvedComponentResult)
.map(dependency -> dependency.getSelected().getId())
.collect(Collectors.toSet())
)
.get();
);
viewConfiguration.componentFilter(
new AndSpec<>(identifier -> firstLevelDependencyComponents.contains(identifier), componentFilter)
new AndSpec<>(identifier -> firstLevelDependencyComponents.get().contains(identifier), componentFilter)
);
}).getFiles();
}

/**
* This method gives us an artifact view of a configuration that filters out all
* project dependencies that are not shadowed jars.
* Basically a thirdparty only view of the dependency tree.
*/
public static FileCollection thirdPartyDependenciesView(Configuration configuration) {
ResolvableDependencies incoming = configuration.getIncoming();
return incoming.artifactView(v -> {
// resolve componentIdentifier for all shadowed project dependencies
Provider<Set<ComponentIdentifier>> shadowedDependencies = incoming.getResolutionResult()
.getRootComponent()
.map(
root -> root.getDependencies()
.stream()
.filter(dep -> dep instanceof ResolvedDependencyResult)
.map(dep -> (ResolvedDependencyResult) dep)
.filter(dep -> dep.getResolvedVariant().getDisplayName() == ShadowBasePlugin.COMPONENT_NAME)
.filter(dep -> dep.getSelected() instanceof ResolvedComponentResult)
.map(dep -> dep.getSelected().getId())
.collect(Collectors.toSet())
);
// filter out project dependencies if they are not a shadowed dependency
v.componentFilter(i -> (i instanceof ProjectComponentIdentifier == false || shadowedDependencies.get().contains(i)));
}).getFiles();
}
}
5 changes: 0 additions & 5 deletions docs/changelog/116423.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions docs/changelog/117778.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 117778
summary: "[Connector APIs] Enforce index prefix for managed connectors"
area: Extract&Transform
type: feature
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/117989.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 117989
summary: ESQL Add esql hash function
area: ES|QL
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/118266.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 118266
summary: Prevent data nodes from sending stack traces to coordinator when `error_trace=false`
area: Search
type: enhancement
issues: []
22 changes: 22 additions & 0 deletions docs/changelog/118366.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
pr: 118366
summary: |-
Configuring a bind DN in an LDAP or Active Directory (AD) realm without a corresponding bind password
will prevent node from starting
area: Authentication
type: breaking
issues: []
breaking:
title: -|
Configuring a bind DN in an LDAP or Active Directory (AD) realm without
a corresponding bind password will prevent node from starting
area: Cluster and node setting
details: -|
For LDAP or AD authentication realms, setting a bind DN (via the
`xpack.security.authc.realms.ldap.*.bind_dn` or `xpack.security.authc.realms.active_directory.*.bind_dn`
realm settings) without a bind password is a misconfiguration that may prevent successful authentication
to the node. Nodes will fail to start if a bind DN is specified without a password.
impact: -|
If you have a bind DN configured for an LDAP or AD authentication
realm, set a bind password for {ref}/ldap-realm.html#ldap-realm-configuration[LDAP]
or {ref}/active-directory-realm.html#ad-realm-configuration[Active Directory].
Configuring a bind DN without a password prevents the misconfigured node from starting.
5 changes: 5 additions & 0 deletions docs/changelog/118544.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 118544
summary: ESQL - Remove restrictions for disjunctions in full text functions
area: ES|QL
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/118617.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 118617
summary: Add support for `sparse_vector` queries against `semantic_text` fields
area: "Search"
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/118757.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 118757
summary: Improve handling of nested fields in index reader wrappers
area: Authorization
type: enhancement
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/118816.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 118816
summary: Support flattened field with downsampling
area: Downsampling
type: bug
issues:
- 116319
5 changes: 5 additions & 0 deletions docs/changelog/118837.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 118837
summary: Add missing timeouts to rest-api-spec ILM APIs
area: "ILM+SLM"
type: bug
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/118844.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 118844
summary: Add missing timeouts to rest-api-spec ingest APIs
area: Ingest Node
type: bug
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/118858.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 118858
summary: Lookup join on multiple join fields not yet supported
area: ES|QL
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The logic for content extraction is defined in {connectors-python}/connectors/ut
While intended primarily for PDF and Microsoft Office formats, you can use any of the <<es-connectors-content-extraction-supported-file-types, supported formats>>.

Enterprise Search uses an {ref}/ingest.html[Elasticsearch ingest pipeline^] to power the web crawler's binary content extraction.
The default pipeline, `ent-search-generic-ingestion`, is automatically created when Enterprise Search first starts.
The default pipeline, `search-default-ingestion`, is automatically created when Enterprise Search first starts.

You can {ref}/ingest.html#create-manage-ingest-pipelines[view^] this pipeline in Kibana.
Customizing your pipeline usage is also an option.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The following diagram provides an overview of how content extraction, sync rules
[.screenshot]
image::images/pipelines-extraction-sync-rules.png[Architecture diagram of data pipeline with content extraction, sync rules, and ingest pipelines]

By default, only the connector specific logic (2) and the default `ent-search-generic-ingestion` pipeline (6) extract and transform your data, as configured in your deployment.
By default, only the connector specific logic (2) and the default `search-default-ingestion` pipeline (6) extract and transform your data, as configured in your deployment.

The following tools are available for more advanced use cases:

Expand Down Expand Up @@ -50,4 +50,4 @@ Use ingest pipelines for data enrichment, normalization, and more.

Elastic connectors use a default ingest pipeline, which you can copy and customize to meet your needs.

Refer to {ref}/ingest-pipeline-search.html[ingest pipelines in Search] in the {es} documentation.
Refer to {ref}/ingest-pipeline-search.html[ingest pipelines in Search] in the {es} documentation.
5 changes: 5 additions & 0 deletions docs/reference/esql/functions/description/hash.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 82 additions & 0 deletions docs/reference/esql/functions/kibana/definition/hash.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions docs/reference/esql/functions/kibana/docs/hash.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions docs/reference/esql/functions/layout/hash.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a6e85bd

Please sign in to comment.