Commit graph

141 commits

Author SHA1 Message Date
Mark Vieira
d1117aeb3e
Update Gradle wrapper to 8.6 (#103796) (#105466)
Co-authored-by: Rene Groeschke <rene@elastic.co>
2024-02-13 15:14:48 -05:00
Mark Vieira
69f77309f5
Update Gradle Enterprise plugin to 3.16.1 (#104435) (#105463)
# Conflicts:
#	gradle/build.versions.toml
#	settings.gradle
2024-02-13 12:48:02 -05:00
Rene Groeschke
5661f5fbd0
[7.17] Update gradle wrapper to 8.5 (#102154) (#102816)
* Update gradle wrapper to 8.5 (#102154)

Update BuildLayout references

* Remove non existent project
2023-11-30 15:03:30 -05:00
Rene Groeschke
468bef1b9e
[7.17] Update gradle wrapper to 8.4 (#99856) (#100926)
* Remove deprecated forConfigurationTime usage
2023-10-17 13:44:48 +02:00
Rene Groeschke
a080bb2bbe
[7.17] Update gradle wrapper to 8.3 (#97838) (#100715)
* Update gradle wrapper to 8.3 (#97838)

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.

(cherry picked from commit b23e000c30)

# Conflicts:
#	build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/LegacyYamlRestCompatTestPluginFuncTest.groovy
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaModulePathPlugin.java
#	build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat/AbstractYamlRestCompatTestPlugin.java
#	build-tools-internal/src/main/resources/minimumGradleVersion
#	gradle/verification-metadata.xml
#	gradle/wrapper/gradle-wrapper.jar
#	gradlew
#	x-pack/plugin/watcher/qa/with-monitoring/src/javaRestTest/java/org/elasticsearch/smoketest/MonitoringWithWatcherRestIT.java

* [7.17] Use patched nebula os package gradle plugin

* Update testingconvention precommit integ test
2023-10-16 06:18:08 -04:00
Rene Groeschke
5afd06ae57
[7.17] Update Gradle Wrapper to 8.2 (#96686) (#97484)
* Update Gradle Wrapper to 8.2 (#96686)

- Convention usage has been deprecated and was fixed in our build files
- Fix test dependencies and deprecation
2023-09-27 08:46:44 +02:00
Mark Vieira
0ae698b203
Update Gradle Enterprise plugin to 3.14.1 (#98551) (#99254) 2023-09-20 09:32:42 +02:00
Rene Groeschke
1744a57312
Revert "[7.17] Update to Gradle 7.6 (#89796) (#92235)"
This reverts commit fc43f0105c.
2022-12-20 12:30:21 +01:00
Rene Groeschke
fc43f0105c
[7.17] Update to Gradle 7.6 (#89796) (#92235)
* Fix TestResultProcessor api changes
* Fix inputs for generateProviderManifest
* Ignore tests for now until gradle has fixed reporting issue
* Fix dependency substitution in example plugins build
* Use right java bin path on windows
* Add hint to task onlyif when no docker is available
2022-12-08 16:48:35 +01:00
Mark Vieira
ef93cbb7f2
Upgrade Gradle Enterprise plugin to 3.11.4 (#91435) (#91566)
# Conflicts:
#	gradle/verification-metadata.xml
#	plugins/examples/settings.gradle
#	settings.gradle
2022-11-14 17:08:51 -05:00
Mark Vieira
822dbb4b27 Revert "Upgrade Gradle Enterprise plugin to 3.11.3 (#91323) (#91327)"
This reverts commit 9abde58fa0.
2022-11-07 08:51:07 -08:00
Mark Vieira
9abde58fa0
Upgrade Gradle Enterprise plugin to 3.11.3 (#91323) (#91327) 2022-11-04 12:17:44 -07:00
Mark Vieira
1b61bd19b9
Upgrade Gradle wrapper to 7.5.1 (#88918) (#89180) 2022-08-09 06:03:11 +09:30
Rene Groeschke
e1979fe81b
Update to to Gradle wrapper 7.5 (#85141) (#88595)
Backports the following commits to 7.17:
 - Update to to Gradle wrapper 7.5 (#85141)
2022-07-19 11:33:32 +02:00
Rene Groeschke
a7599927f6
Update gradle wrapper to 7.4.2 (#85608) (#85620) 2022-04-01 17:53:44 +02:00
Mark Vieira
45d35aa4ad Fix classpath for example build integration tests (#81837)
This fixes two classpath issues for integration tests in the example
build

1. adds log4j to the runtime classpath where needed
2. removes exclude of jakarta json which was added as a workaround for

https://github.com/elastic/elasticsearch-java/issues/47

(cherry picked from commit 350fe2d21f)
2022-03-10 15:44:49 -08:00
Mark Vieira
840f02042d
Update Gradle wrapper to 7.4.1 (#84841) (#84884) 2022-03-10 13:13:41 -05:00
Rene Groeschke
2d6d830c86
Update gradle wrapper to 7.4 (#81963) (#83886)
* Make ForbiddenApisPrecommitPlugin plugin Gradle 8.0 compatible
* Fix deprecations on ignoring empty folders for task inputs
* Update Gradle wrapper to 7.4 GA
2022-02-15 11:15:54 +01:00
Przemyslaw Gomulka
8d10cfebed
[7.17] Convert 'id' and '_id' values in REST API tests to strings #82681 (#83772)
Follow-up from #77144 (comment) with converting id/_id to always be strings instead of integers. This makes the type value in the Elasticsearch specification be only string instead of string | number.

this change was generated using following command on ubuntu
find . -type f -name "*.yml" -print0 | xargs -0 sed -i -r 's/([^a-zA-Z0-9_\.]id|[^a-zA-Z0-9_]_id):(\s)([0-9]+)/\1:\2"\3"/g'
relates #82681
2022-02-10 13:52:36 +01:00
Rory Hunter
36dccd6928 Fix typo in plugins/examples/settings.gradle 2022-01-28 14:52:31 +00:00
Rene Groeschke
41a6e2f785
Update gradle wrapper to 7.3.3 (#82057) (#82061)
Keep gradle version up to date
2021-12-23 07:47:43 -05:00
Rene Groeschke
b1271c4352
Update gradle wrappers to 7.3.2 (#81798) (#81861)
Keep our build up to date with latest gradle releases
2021-12-19 18:07:01 +01:00
Rene Groeschke
a545e86588
Update gradle wrapper for plugin examples (#81435) (#81446) 2021-12-07 11:02:46 -05:00
Mark Vieira
3e22fe029a
Fix references to moved classes in plugin examples (#80736) (#80740)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-11-15 17:24:55 -05:00
Chris Hegarty
964180ba99
[7.x] Fix split package org.elasticsearch.common.xcontent (#79061)
* Fix split package org.elasticsearch.common.xcontent

* Fix test
2021-10-13 15:43:41 +01:00
Nikola Grcevski
ccc46ebd52
[TEST] Use persistent settings in YML tests (#78480) (#78521)
Use persistent instead of transient settings for various REST
YML tests, because we are deprecating the transient cluster
settings.
2021-09-30 12:38:18 -04:00
Mark Vieira
76733d92ee
Remove example-plugins included build (#78408) (#78420) 2021-09-28 15:31:09 -07:00
Rene Groeschke
c9648b079f
[7.x] Do not create unused testCluster (#78312)
* Do not create unused testCluster (#77581)

* Do not create unused testCluster

This avoids creating test clusters that are not required during the build.
We use lazy configuration here on testClusters and only instantiate them as theyre

* Do not fail on run task (debug)

* Create more test cluster lazy

* Make more test cluster lazy

* Avoid creating unused testcluster

* Fix PluginBuildPlugin

* Fix disabling geo db download

* Fix cluster setup in repository-multi-version

* Polishing

* Fix issue with irretic groovy ogic

* Fix bwc tests

* Fix more bwcTests

* Fix more bwc tests

* Fix more bwc tests

* Fix more bwc tests

* Fix typo

* Minor polishing

* Fix rolling upgrade tests

* Fix cluster config in sql qa mixedcluster project

* Fix more bwc tests

* Clean up before review

* Document test cluster usage

* Api polising after Review

provide useCluster(Provider) method to TestClusterAware

Ideally we take this a step further and realize those test clusters only on use.
But out of scope of this PR.

* Allow gradle provider as value for nonSystemProperties

* Some simplification on test configuration

* Fix typo in rest test config

* Fix more typos

* Fix another typo

* Fix more typos

* Fix runEqlCorrectnessNode run task and cluster configuration (#78249)

* Fix merge issue

* Fix bwc tests after backporting
2021-09-27 14:00:29 -04:00
Yang Wang
c05c0234f0
Short circuit authorization for child actions (#77221) (#78295)
This commit detects a specific case when a child action (e.g. a shard
level action, or a phased action) acts on the same indices (or a
subset of the indices) or that parent request, and we can retain the
original authorization result.

The optimization is only effective for the invocation of the child
action on the same node as the parent - if the transport action needs
to be executed on a remote node then that authorization will not be
optimized and will perform the full check as existed before this
change.

This change is primarily benefitial for actions where a single parent
action on a coordinating node triggers the execution of multiple
children (e.g. a child action per shard) as it allows the
coordinating node to trigger those action and allow the load
to be passed to the remote nodes as quickly as possible rather than
having authorization on the coordinating node become a bottleneck.

Co-authored-by: Tim Vernum <tim.vernum@elastic.co>
2021-09-25 12:10:29 +10:00
Mark Vieira
9f0d94e6a1
[7.x] Isolate example plugins projects from main Elasticsearch build (#78140) (#78222) 2021-09-22 17:04:00 -07:00
Mark Vieira
017b4ae6f0
[7.x] Introduce external build-tools JavaRestTestPlugin (#77603) (#77662) 2021-09-13 14:55:33 -07:00
Rory Hunter
934691e720 Fix shadowed variables in various places - part 1 (#77555)
Part of #19752.

Fix a number of locations where local variables or parameters are shadowing a field
that is defined in the same class.
2021-09-13 14:10:35 +01:00
Rene Groeschke
0bbc52510e
Fix dependency resolution on eclipse for example projects (#77468) 2021-09-09 04:30:17 -04:00
Rene Groeschke
4039c35ea0
Introduce simple public yaml-rest-test plugin (7.x backport) (#77054)
* Introduce simple public yaml-rest-test plugin (#76554)

This introduces a basic public yaml rest test plugin that is supposed to be used by external
elasticsearch plugin authors. This is driven by #76215

- Rename yaml-rest-test to intern-yaml-rest-test
- Use public yaml plugin in example plugins

Co-authored-by: Mark Vieira <portugee@gmail.com>

* Fix test assertion after output normalization

Co-authored-by: Mark Vieira <portugee@gmail.com>
2021-09-03 11:57:42 -04:00
Stuart Tettemer
91e9c5c5a0
Script: Fields API for Sort and Score scripts (#75863) (#76108)
Adds minimal fields API support to sort and score scripts.

Example: `field('myfield').getValue(123)` where `123` is the default if the field has no values.

Refs: #61388
Backport: 6c02a6c
2021-08-04 11:40:52 -05:00
Rene Groeschke
228548afcc
Fix fips tests build for example plugins 2021-06-23 20:28:26 +02:00
Rene Groeschke
fc6b650297
Cleanup QA projects build scripts (#74428) (#74483)
Aiming for configuring less during the build,
this removes non required configuration from qa build scripts that do not
contain any sources. We also remove a few non required afterEvaluate hooks
2021-06-23 16:14:56 +02:00
Ryan Ernst
1f94aaf280
Move ParseField to o.e.c.xcontent (#73923) (#73929)
ParseField is part of the x-content lib, yet it doesn't exist under the
same root package as the rest of the lib. This commit moves the class to
the appropriate package.

relates #73784
2021-06-08 15:51:18 -07:00
Ryan Ernst
393ab2d813
Rename o.e.common in libs/core to o.e.core (#73909) (#73920)
When libs/core was created, several classes were moved from server's
o.e.common package, but they were not moved to a new package. Split
packages need to go away long term, so that Elasticsearch can even think
about modularization. This commit moves all the classes under o.e.common
in core to o.e.core.

relates #73784
backport #73909
2021-06-08 14:17:44 -07:00
Rene Groeschke
7c3630989d
Remove internal build logic from public build tool plugins (#72470) (7.x backport) (#72832)
back porting #72470 to 7.x
Extract usage of internal API from TestClustersPlugin and PluginBuildPlugin and
related plugins and build logic

This includes a refactoring of ElasticsearchDistribution to handle types
better in a way we can differentiate between supported Elasticsearch
Distribution types supported in TestCkustersPlugin and types only supported
in internal plugins.

It also introduces a set of internal versions of public plugins.

As part of this we also generate the plugin descriptors now.

As a follow up on this we can actually move these public used classes into
an extra project (declared as included build)

We keep LoggedExec and VersionProperties effectively public And workaround for RestTestBase
2021-06-03 12:43:40 +02:00
Tim Vernum
c585975912
Make RBACEngine.resolveAuthorizedIndicesFromRole Return Set for Lookups (#73406)
This changes the result of AuthorizationEngine.loadAuthorizedIndices
(and dependent methods) from List<String> to Set<String>.

This has the following performance benefits:
1. `contains` checks are faster
2.  RBACEngine always formed this collections as a Set, so this
    change reduces unnecessary copying.

An additional performance improvement was added when resolve authorized
index names for data streams.

Backport of: #72598

Co-authored-by: Tamara Braun <summerwind.1005@gmail.com>
2021-05-26 18:14:35 +10:00
Rene Groeschke
59126ea871
Restructure buildsrc restructure buildsrc (7.x backport) (#72315)
backports #72030 to 7.x

Related to #71593 we move all build logic that is for elasticsearch build only into
the org.elasticsearch.gradle.internal* packages

This makes it clearer if build logic is considered to be used by external projects
Ultimately we want to only expose TestCluster and PluginBuildPlugin logic
to third party plugin authors.

This is a very first step towards that direction.
2021-04-28 08:52:56 +02:00
Lyudmila Fokina
3c7731dd3f
Warn users if security is implicitly disabled (#71650)
* Warn users if security is implicitly disabled (#70114)

Elasticsearch has security features implicitly disabled by default for
Basic and Trial licenses, unless explicitly set in the configuration
file.
This may be good for onboarding, but it also lead to unintended insecure
 clusters.
 This change introduces clear warnings when security features are
 implicitly disabled.
 - a warning header in each REST response if security is implicitly
 disabled;
 - a log message during cluster boot.
2021-04-13 20:51:52 +02:00
Mark Vieira
789443e26b
Remove integration testing using OSS distribution (#69153) (#69160) 2021-02-17 16:25:28 -08:00
Mark Vieira
2d1e8b3abd Update sources with new SSPL+Elastic-2.0 license headers
As per the new licensing change for Elasticsearch and Kibana this commit
moves existing Apache 2.0 licensed source code to the new dual license
SSPL+Elastic license 2.0. In addition, existing x-pack code now uses
the new version 2.0 of the Elastic license. Full changes include:

- Updating LICENSE and NOTICE files throughout the code base, as well
  as those packaged in our published artifacts
- Update IDE integration to now use the new license header on newly
  created source files
- Remove references to the "OSS" distribution from our documentation
- Update build time verification checks to no longer allow Apache 2.0
  license header in Elasticsearch source code
- Replace all existing Apache 2.0 license headers for non-xpack code
  with updated header (vendored code with Apache 2.0 headers obviously
  remains the same).
- Replace all Elastic license 1.0 headers with new 2.0 header in xpack.
2021-02-02 18:07:23 -08:00
Julie Tibshirani
ca448f0f25
Rename QueryShardContext -> SearchExecutionContext. (#67544)
We decided to rename `QueryShardContext` to clarify that it supports all parts
of search request execution. Before there was confusion over whether it should
only be used for building queries, or maybe only used in the query phase. This
PR also updates the javadocs.

Closes #64740.
2021-01-14 16:11:00 -08:00
Ioannis Kakavas
c0b24df307
Ensure CI is run in FIPS 140 approved only mode (#66804)
We were depending on the BouncyCastle FIPS own mechanics to set
itself in approved only mode since we run with the Security
Manager enabled. The check during startup seems to happen before we
set our restrictive SecurityManager though in
org.elasticsearch.bootstrap.Elasticsearch , and this means that
BCFIPS would not be in approved only mode, unless explicitly
configured so.

This commit sets the appropriate JVM property to explicitly set
BCFIPS in approved only mode in CI and adds tests to ensure that we
will be running with BCFIPS in approved only mode when we expect to.
It also sets xpack.security.fips_mode.enabled to true for all test clusters
used in fips mode and sets the distribution to the default one. It adds a
password to the elasticsearch keystore for all test clusters that run in fips
mode.
Moreover, it changes a few unit tests where we would use bcrypt even in
FIPS 140 mode. These would still pass since we are bundling our own
bcrypt implementation, but are now changed to use FIPS 140 approved
algorithms instead for better coverage.

It also addresses a number of tests that would fail in approved only mode
Mainly:

    Tests that use PBKDF2 with a password less than 112 bits (14char). We
    elected to change the passwords used everywhere to be at least 14
    characters long instead of mandating
    the use of pbkdf2_stretch because both pbkdf2 and
    pbkdf2_stretch are supported and allowed in fips mode and it makes sense
    to test with both. We could possibly figure out the password algorithm used
    for each test and adjust password length accordingly only for pbkdf2 but
    there is little value in that. It's good practice to use strong passwords so if
    our docs and tests use longer passwords, then it's for the best. The approach
    is brittle as there is no guarantee that the next test that will be added won't
    use a short password, so we add some testing documentation too.
    This leaves us with a possible coverage gap since we do support passwords
    as short as 6 characters but we only test with > 14 chars but the
    validation itself was not tested even before. Tests can be added in a followup,
    outside of fips related context.

    Tests that use a PKCS12 keystore and were not already muted.

    Tests that depend on running test clusters with a basic license or
    using the OSS distribution as FIPS 140 support is not available in
    neither of these.

Finally, it adds some information around FIPS 140 testing in our testing
documentation reference so that developers can hopefully keep in
mind fips 140 related intricacies when writing/changing docs.
2020-12-24 15:35:28 +02:00
Martijn Laarman
e97080d502
[backport 7.x] Add visibility to the rest-spec-api (#66250) 2020-12-15 13:06:12 +01:00
Rene Groeschke
68fce39562
Avoid tasks materialized during configuration phase (#65922) (#66218)
* Avoid tasks materialized during configuration phase
* Fix RestTestFromSnippet testRoot setup
2020-12-12 22:13:38 +01:00
Rene Groeschke
8e5f7365e6
Make AntFixture handling task provider api compliant (#65832) (#66224)
This tweaks the AntFixture handling to make it compliant with the task avoidance api.
Tasks of type StandaloneRestTestTask are now generally finalised by using the typed ant stop task
which allows us to remove of errorprone dependsOn overrides in StandaloneRestTestTask. As a result
we also ported more task definitions in the build to task avoidance api.

Next work item regarding AntFixture handling is porting AntFixture to a plain Gradle task and remove
Groovy AntBuilder will allow us to port more build logic from Groovy to Java but is out of the scope of
This PR.
2020-12-12 21:26:25 +01:00