This updates the gradle wrapper to 8.12
We addressed deprecation warnings due to the update that includes:
- Fix change in TestOutputEvent api
- Fix deprecation in groovy syntax
- Use latest ospackage plugin containing our fix
- Remove project usages at execution time
- Fix deprecated project references in repository-old-versions
(cherry picked from commit ba61f8c7f7)
# Conflicts:
# build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerCloudElasticsearchDistributionType.java
# build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/distribution/DockerUbiElasticsearchDistributionType.java
# build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/Fixture.java
# plugins/repository-hdfs/hadoop-client-api/build.gradle
# server/src/main/java/org/elasticsearch/inference/ChunkingOptions.java
# x-pack/plugin/kql/build.gradle
# x-pack/plugin/migrate/build.gradle
# x-pack/plugin/security/qa/security-basic/build.gradle
This adds infrastructure to make the legacy test cluster plugin and
the legacy test cluster based test plugins generally configuration cache compatible.
(cherry picked from commit 8c20ac5884)
# Conflicts:
# qa/mixed-cluster/build.gradle
* [Build] Fix Concurrency issue in buildparams access (#117552)
Also provide caching support for buildparams provider
* Extract BuildParameterExtension public api into interface
* Make tests better readable
* Fix test flakyness
* Make BuildParameterExtensionSpec java 17 compatible
* Try fix BuildParameterExtensionSpec
The `java.security.manager=allow` system property is required when
running tests on newer Java versions with the security manager
deprecated. As such, it should be set in our
`GradleTestPolicySetupPlugin` so that it's done for external plugin
authors.
* Fallback to bundled jdk for runtime jdk instead of build jvm
* Rework bundled jdk resolution to be lazy
* Use fixed runtime jdk for gradle build integ tests
We do not implicitly rely on all different kind of env variables when leveraging Gradle Configuration Cache
this makes reusing config cache more reliable and improves cache hits
* configure default env variables for logged exec task
* Fix antfixturestop constructor
* Make LoggedExec cc compatible (fix integtests)
* Fix spotless
We throw an error when we detect resource leaks in cluster logs but we
don't provide any indication of which cluster, or which log. This change
logs the path to the log file in question so you can investigate.
Fix incompatibility with 8.8 and our internal api usages
- Update ospackage to a version that contains a fix we provided
- Tweak build logic to avoid deprecation warnings
- Use newer permission api
- Use custom shadowplugin
- Rework ElasticsearchDistribution dependencies resolution
- Update Gradle wrapper to 8.8
We should make sure to find leaks reported by both of these, these days
our `LeakTracker` will likely be more sensitive that Netty's in some
cases since our objects refer to Netty objects and thus get collected
first.
Adding support for MDX files in our :docs project. We parse those *.mdx files
like we do for asciidoc files for code snippets and generate yaml specs from them that
we test as part of our integration tests.
By default:
When searching for doc sources in the docs folder we fail the build if we detect multiple files of
the same name but different extension. E.g. having painless-field-context.mdx
and painless-field-context.asciidoc in the same source folder will fail the build.
Migration Mode:
To allow easier migration from asciidoc to mdx the build supports a kind of migration mode.
When running the build with -Dgradle.docs.migration=true (e.g. ./gradlew buildRestTests -Dgradle.docs.migration=true)
Duplicate doc source files (asciidoc and mdx) are allowed
The Generated yaml rest specs for duplicates will have the extension *.mdx.yml or *asciidoc.yml.
The generated yaml rest specs for duplicates are compared to each other to ensure they produce the same yml output.
This commit makes zstd compression available to Elasticsearch. The
library is pulled in through maven in jar files for each platform, then
bundled in a new platform directory under lib. Access to the zstd
compression/decompression is through NativeAccess.
Sometimes subprojects are created by build tests. There exists a utility
function to define the subproject build file. Yet some tests add the
project to settings and then configure through the subprojects directive
in the root build file. This commit cleans up two such cases to use
explicit subproject build files.
On Serverless it is not possible to configure deprecation indexing (it
is always off). This commit updates the behaviour of
`ElasticsearchCluster` to no longer attempt to configure deprecation
indexing on stateless nodes.
Fixing a couple of file leaks (and cleaning up one missing
try-with-resources). The directory descriptor leaks in particular
were leaking massively on every precommit run, to the point where it
slows down the whole system and/or we're running into descriptor limits.
* Use single-char variant of String.indexOf() where possible
indexOf(char) is more efficient than searching for the same one-character String.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Use String.replace() instead of replaceAll() for non-regexp replacements
When arguments do not make use of regexp features replace() is a more efficient option, especially the char-variant.
Prevent invalid and miss-configuration of APM agent using an explicit allow-list of setting keys.
Additionally, configuration defaults of APMAgentSettings are consolidated in APMJvmOptions to keep defaults in a single location.
(ES-6916)
RunTaks is used by both statefull and serverless.
when --with-apm-server is used, `telemetry.metrics.enabled` is always turned to true
and server_url is set to localhost
However when --with-apm-server is NOT used, then we should disable `telemetry.metrics.enabled`
only if that setting was not explicitly used. This explicte use is for instance when
running gradlew run and configuring ES to send to ESS cluster
a follow up from https://github.com/elastic/elasticsearch/pull/101941/files#r1388403805
When a test cluster in serverless is run with --with-apm-server
3 nodes were attempting to start apm server. This was throwing an exception.
There is no harm in reusing the already running apm server,
and in fact is more realistic
* Move TestCluster plugin and module setup from Node to Cluster
* Do not materialize unused TestCluster
* Fix lazy test cluster evaluation
* Register artifact transforms ones per project
* Make task caching for TestClusterAware tasks CC compatible
* Move stateful logic out of taskgraph.whenready
With apm metrics being enabled by default in serverless, the run task should only allow for apm integration and starting the server when --with-apm-server is switch on
When the flag is not present, the apm metrics should be disabled and apm server not started
* Make YamlRestTest and ElasticDistributionPlugin cc compatible
These changes are addressing configuration cache incompatibilities of running
rest tests with the new ClassRule based Elasticsearch test cluster setup.
This allows running those tests with configuration cache enabled:
`./gradlew :modules:ingest-user-info:yamlRestTest --configuration-cache`
Gradle now fully supports compiling, testing and running on Java 20.
Among other general performance improvements this release introduces --test-dry-run command line option that allows checking if tests are filtered or not by gradle.
Required updating nebula ospackage plugin as setuid was broken in gradle 8.3.
Lots of spots where we did weird things around streams like redundant stream creation, redundant collecting
before adding all the collected elements to another collection or so, redundant streams for joining strings
and using less efficient `Collectors.toList` and in a few cases also incorrectly relying on the result being mutable.