Commit graph

1889 commits

Author SHA1 Message Date
Mark Vieira
21df4f545c
Update spotless (#115349) 2024-10-22 10:49:29 -07:00
Jake Landis
2aeecfd084
[7.17] Manual backport of 103944 (#104016)
* Manual backport of 103944

* copy RegisteredDomainProcessorTests#testBasic from main
2024-01-08 11:31:01 -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
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
0c1c6ffec8
Mute SecurityDocumentationIT.testDelegatePkiAuthentication 2023-07-18 10:34:48 -07:00
Mark Vieira
47c6fd34da
[7.17] Add JUnit rule based integration test cluster orchestration framework… (#92517)
This commit adds a new test framework for configuring and orchestrating
test clusters for both Java and YAML REST testing. This will eventually
replace the existing "test-clusters" Gradle plugin and the build-time
cluster orchestration.
2022-12-22 17:48:07 -08:00
David Roberts
93b3584e4f
Account for using ML snapshot builds in HLRC release tests (#90066)
Since https://github.com/elastic/elasticsearch/pull/89951 we use
ML snapshot builds in all elasticsearch-ci jobs, even the
release-tests ones.

The test of the reported ML native code version in the HLRC tests
needs to account for this.

This change is 7.17 only, as the HLRC is removed in 8.x.
2022-09-17 08:22:05 +01:00
Christos Soulios
e85056b2f0
Unmute test (#89979)
Test had been muted because of issue #67749

This PR unmutes test RollupIT.testPutStartAndGetRollupJob() because most probably it has
been fixed by #86992

Closes #67749
2022-09-12 16:08:49 +03:00
Rene Groeschke
62868b7abe
[7.17] Add verification metadata for dependencies (#88814) (#89105)
Backports the following commits to 7.17:
 - Add verification metadata for dependencies (#88814)
 - Add missing dependency verification checksums (#89139)
2022-08-08 12:30:59 +02:00
Tanguy Leroux
17f4e0b141
[7.17] Fix mount snapshot api ignoring unknown request parameter (#89061)
The High Level REST Client provides a MountSnapshotRequest#ignoredIndexSettings(String[]) method to define some index settings to ignore when mounting a snapshot as a searchable snapshot index.

Sadly the client generates a wrong request body field ignored_index_settings instead of ignore_index_settings. This wasn't caught until #75982 was reported because the parser of Mount API request ignores unknown fields in request body.

We fixed the wrong leniency of the request parser on the Elasticsearch side (#88987) starting version 8.5.0, and we decided to continue to ignore the ignored_index_settings generated by the HLRC bug to avoid breaking HLRC client usages.

This change fixes the request body generated by the HLRC to pass the correct field name. This fix is for versions 7.17.6+ (we do not expect to release new versions of HLRC in 8.x).

It also renames the HLRC methods to expose the change to client users.

Co-authored-by: bellengao <bellengao@tencent.com>
2022-08-04 19:12:06 +02:00
Rene Groeschke
62294616df
[7.17] Rework testing conventions gradle plugin (#87213) (#88422)
Backports the following commits to 7.17:
 - Rework testing conventions gradle plugin (#87213)
2022-07-12 10:58:40 +02:00
Rene Groeschke
98d18185ae
[7.17] Setup elasticsearch dependency monitoring with Snyk for production code (#88036) (#88223)
Backports the following commits to 7.17:
 - Setup elasticsearch dependency monitoring with Snyk for production code (#88036)
2022-07-04 08:36:35 +02:00
Nikolaj Volgushev
6c43bff0c3
Mute RestClientMultipleHostsIntegTests#testNonRetryableException (#87316) (#87648) 2022-06-14 15:00:14 +02:00
Sylvain Wallez
549ec8c16c
Do not retry client requests when failing with ContentTooLargeException (#87248) (#87257) 2022-05-31 12:49:59 -04:00
Rene Groeschke
448ab34957
[7.17] Use internal-java-rest-test in high level rest client (#86837)
This is 7.17 specific change before we can backport the deletion of the elasticsearch.rest-test plugin
2022-05-23 10:05:14 +02:00
Seth Michael Larson
79878662c5
Revert "Enable HLRC compatibility mode by default (#86517)" (#86873)
This reverts commit 0cb5108942.
2022-05-17 18:06:52 -05:00
Sylvain Wallez
0cb5108942
Enable HLRC compatibility mode by default (#86517) 2022-05-12 19:00:54 +02:00
Mark Vieira
a3e4313cb4
Upgrade bytebuddy to latest version with Java 19 support (#85881) (#85915) 2022-04-14 17:10:58 -04:00
Tanguy Leroux
750bb1e46a
Mute MigrationIT.testGetDeprecationInfo (#85813) (#85814)
Relates #85743
2022-04-12 07:02:44 -04:00
Will James
4c41c7a9f4
Do not send default ignore_throttled parameter since it is deprecated (#84827) 2022-03-10 18:14:15 +01:00
Sylvain Wallez
37c06a0508
[client] Fix decompressed response headers (#63419) (#84581)
When a gzip-encoded response is decompressed the response should no more
have a content-encoding header and content-length should be set to
"unknown". GzipDecompressingEntity correctly does this for the entity
but the response still reported the original response's content-encoding
and content-length headers.
2022-03-02 13:36:00 -05:00
Philip Krauss
5168bcdecf
Fix for exception self-suppression in Rest client (#83568) (#84558)
Co-authored-by: Philip Krauss <35487337+philkra@users.noreply.github.com>

Co-authored-by: Fedor Bobin <fuudtorrentsru@gmail.com>
2022-03-02 09:53:15 -05:00
Rene Groeschke
4de3fb5eaf
Remove usage of deprecated Provider#forUseAtConfigurationTime (#83932) (#83947)
Remove gradle api usage that has been deprecated with Gradle 7.4
2022-02-15 16:45:24 +01:00
Tanguy Leroux
d03aaf1262
Mute RollupIT.testPutStartAndGetRollupJob (#83503) (#83505)
Relates #67749
2022-02-04 06:15:47 -05:00
Sylvain Wallez
a624548c28
Fix version resolution and encoding in LLRC (#81989) (#82205) 2022-01-04 10:08:49 -05:00
Tim Vernum
bbd504275a
Expand example in HLRC put-role docs (#82139)
This expands the example in the High Level Rest Client's Put Role
documentation to include an example of creating a role with index
privileges, include FLS and DLS Relates: #81354
2021-12-30 04:39:59 -05:00
Sylvain Wallez
bc8e6b7493
LLRC: expose http client and allow overriding meta header (#81955) (#82067) 2021-12-23 10:11:26 -05:00
Rory Hunter
358cd80d34 Formatting escape hatch (#81806)
Thanks to https://bugs.eclipse.org/bugs/show_bug.cgi?id=574437,
we've run into a situation where Spotless is incorrectly formatting
a particular piece of syntax (due the underlying Eclipse bug). We
were able to turn off formatting of this syntax using `// @formatter:off`
and `// @formatter:on`, but there was a further problem. We configure
IntelliJ to use the Eclipse formatter plugin, but this doesn't
respect the `@formatter` tags since these are set at the Spotless
level, not the Eclipse formatter level. Note that these tags aren't
set in the Eclipse formatter config, because there we use `// tag::`
and `// end::` in order to avoid reformatting docs snippets, which
have a much narrower line width.

What a mess.

So, to get around all this, drop the `@formatter` tags and tweak
our custom `SnippetLengthCheck` Checkstyle rule so that
`// tag:noformat` regions are not subject to the narrower line length
check, but are still exempt from formatting.
2021-12-16 16:28:17 +00:00
Lee Hinman
cb5766c197
[7.16] Change HLRC's LifecyclePolicy to allow all valid ILM actions (#81483) (#81765)
* Change HLRC's LifecyclePolicy to allow all valid ILM actions (#81483)

This commit changes the High Level Rest Client's `LifecyclePolicy`
implementation to allow all the same valid actions for each phase that
ILM supports. It was previously missing actions in the hot and cold
phases, as well as missing the frozen phase entirely. This also adds a
test that uses the "real" `TimeseriesLifecycleType.ORDERED_*ACTIONS`
lists so that if an action is added or removed in the future the test
will fail. Resolves #81461
# Conflicts:
#	client/rest-high-level/src/test/java/org/elasticsearch/client/indexlifecycle/LifecyclePolicyTests.java
#	x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/TimeseriesLifecycleType.java

* Fix test
2021-12-15 11:13:33 -05:00
Andrei Stefan
eeb39f8499
EQL: HLRC documentation (#80979) 2021-12-08 13:56:25 +02:00
Hendrik Muhs
969e5655ef
[7.16] [Transform] handle pit index not found error (#81368) (#81491)
Do not fail the transform if pit search fails with index not found as a result of an index that got deleted via ILM, 
if that index is part of a search that selects indices using a wildcard, e.g. logs-*. If pit search fails, the search 
is retried using search without a pit context. The 2nd search might fail if the source targets an explicit index. 
In addition the usage of the pit API can not be disabled by transform.

fixes elastic#81252
relates elastic#81256
2021-12-08 09:44:56 +01:00
Martijn van Groningen
deb0d4c8c7
[7.16] Add replicated field to get data stream api response. (#81140)
* [7.16] Add replicated field to get data stream api response.

Backporting #80988 to 7.16 branch.

Internally we already kept track of whether a data stream is replicated by CCR.
It is part of the `DataStream` class. This just adds it to the xcontent serialization
of the get data stream api response class.

Relates to elastic/kibana#118899

* adjust to 7.16 reality
2021-11-30 06:01:49 -05:00
Artem Prigoda
47da0dca20
[7.16] Revert "Deprecate returning 408 for a server timeout on _cluster/health (#78180)" (#80831)
* Revert "Allow deprecation warning for the return_200_for_cluster_health_timeout parameter (#80178) (#80445)"

This reverts commit 5a5300753d.

* Revert "[7.x] Use query param instead of a system property for opting in for new cluster health response code (#79397) (#79435)"

This reverts commit d8c14281

* Revert "[7.x] Deprecate returning 408 for a server timeout on `_cluster/health` (#78180) (#78940)"

This reverts commit 03bd55d1
2021-11-18 16:57:39 +01:00
Benjamin Trent
4724553d91
[ML] deprecate estimated_heap_memory_usage_bytes and replace with model_size_bytes (#80545)
This deprecates estimated_heap_memory_usage_bytes on model put and replaces it with model_size_bytes.

On GET, both fields are returned (unless storing in the index) and are populated with the same field.

For the ml/info API, both fields are returned as well.
2021-11-10 11:24:04 -05:00
Rory Hunter
c2da6b1223 Fix HiddenField checkstyle problems in client/ (#80549)
Part of #19752.

Fix a number of cases of shadows vars under `client/rest-high-level`. As
part of this, fork the Checkstyle `HiddeFieldCheck` class so that it
understand the pattern of settings with no "set" prefix.
2021-11-10 13:50:43 +00:00
Ryan Ernst
8aa954969b
Upgrade Mockito to 4.0.0 (#79949) (#79974)
Mockito 4.0 removes several deprecated methods. This commit updates
usages of those deprecated methods and upgrades mockito. The changes
include: * Replace anyMapOf,anyListOf,anySetOf,anyCollectionOf with the
same   method name without `Of` and no longer taking any arguments. *
Replace anyObject with any * Removing argument from isNull * Replace
verifyZeroInteractions with verifyNoMoreInteractions The changes here
were completely mechanical, done entirely with forms of find/replace
within IntelliJ.
2021-10-27 20:55:49 -07:00
Ryan Ernst
9336cfd931
Convert uses of mockito Matchers to ArgumentMatchers (#79852) (#79964)
Matchers is deprecated in Mockito, in favor of the newer
ArgumentMatchers class. In fact, internally Matchers just extends
ArgumentMatchers as all the methods there were moved. This commit
changes all imports of org.mockito.Matchers to
org.mockito.ArgumentMatchers.
2021-10-27 18:13:26 -07:00
Mark Vieira
de15f4b62d Fix malformed signature used for integration test license 2021-10-27 16:07:13 -07:00
Mark Vieira
bcfbf00074 Reformat Elasticsearch source 2021-10-27 15:23:15 -07:00
Henning Andersen
3cad9c1c39 Rethrottle tests wait for task to start (#77822)
Improved how we wait for tasks to really start, to ensure that
rethrottle does not fail the test.

Closes #75327
2021-10-27 23:19:01 +02:00
Lee Hinman
08214dcf84
Add deprecation headers to HLRC classes (#79754) (#79763)
This commit adds the @Deprecated annotation and Javadoc to HLRC classes.
# Conflicts:
#	client/rest-high-level/qa/ssl-enabled/src/javaRestTest/java/org/elasticsearch/client/documentation/EnrollmentDocumentationIT.java
#	client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/EnrichDocumentationIT.java
#	qa/ccs-rolling-upgrade-remote-cluster/src/test/java/org/elasticsearch/upgrades/SearchStatesIT.java
#	x-pack/qa/reindex-tests-with-security/src/test/java/org/elasticsearch/xpack/security/ReindexWithSecurityIT.java
#	x-pack/qa/security-example-spi-extension/src/javaRestTest/java/org/elasticsearch/example/role/CustomRolesProviderIT.java
#	x-pack/qa/smoke-test-plugins-ssl/src/test/java/org/elasticsearch/smoketest/SmokeTestMonitoringWithSecurityIT.java
2021-10-25 19:12:52 -04:00
Hendrik Muhs
6405fea8e4
[7.16][Transform] Improve transform upgrader (#79601) (#79700)
* [Transform] Improve transform upgrader (#79601)

This changes fixes some issues with the upgrader. It inlines the index name resolver as wildcard
deletes are not supported if action.destructive_requires_name is set to true(default). It changes
response to always return all counters in order to avoid an empty response. After documentation has
been created, it switches the deprecation URL to the upgrade API docs.

* change url to 7.16 specific one

* fix 7.x specific test

* fix put mapping call
2021-10-25 07:49:08 -04:00
Ryan Ernst
09c88797d2
Upgrade mockito to 3.12.4 (#79669) (#79686)
Securemock is a wrapper around Mockito that monkey patches internals of
Mockito to work with the SecurityManager. However, the library has not
been updated in several years due to the complicated nature of this
monkey patching. This has left us with an ancient version of Mockito,
missing out on updates to the library in the last half decade.

While Securemock currently works with Mockito 1.x, in 2.x an official
means of plugging into mockito was added, MockMaker. This commit removes
securemock as a dependnecy of the test framework, replacing it with a
modern version of Mockito, and implementing a MockMaker that integrates
with SecurityManager.

Note that while there is a newer version of Mockito available, 4.0, it
has several deprecations removed that are used throughout Elasticsearch.
Those can be addressed in followups, and then a subsequent upgrade to
4.0 should be possible.

relates #79567
closes #40334
2021-10-24 10:46:03 -07:00
Keith Massey
f662dc1cf3
Updating deprecation message wording based on docs team feedback (#79387)
This commit updates deprecation info API wording based on feedback from the docs team.
2021-10-20 09:46:06 -05:00
Gordon Brown
35dc030ed8
Implement framework for migrating system indices (#78951)
This PR adds a framework for migrating system indices as necessary prior
to Elasticsearch upgrades. This framework uses REST APIs added in
another commit:
- GET _migration/system_features

This API, which gets the status of "features" (plugins which own system
indices) with regards to whether they need to be upgraded or not. As of
this PR, this API also reports errors encountered while migrating system
indices alongside the index that was being processed when this occurred.

As an example of this error reporting:

```json
{
    "feature_name": "logstash_management",
    "minimum_index_version": "8.0.0",
    "upgrade_status": "ERROR",
    "indices": [
        {
            "index": ".logstash",
            "version": "8.0.0",
            "failure_cause": {
                "error": {
                    "root_cause": [
                        {
                            "type": "runtime_exception",
                            "reason": "whoopsie",
                            "stack_trace": "<omitted for brevity>"
                        }
                    ],
                    "type": "runtime_exception",
                    "reason": "whoopsie",
                    "stack_trace": "<omitted for brevity>"
                }
            }
        }
    ]
}
```

- POST _migration/system_features

This API starts the migration process. The API for this has no changes,
but when called, any system indices which need to be migrated will be
migrated, with status information stored in the cluster state for later
use by the GET _migration/system_features API.
2021-10-19 20:16:39 -06:00
Przemko Robakowski
8fe8e6f039
Store Template's mappings as bytes for disk serialization (#78746) (#79522)
This change the way we store mappings in `Template` during serialization
to disk - instead storing it as map we use byte array that we already
have. This avoids deserialization-serialization cycle during storing
cluster state on disk.
# Conflicts:
#	server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java
2021-10-19 19:14:54 -04:00
Keith Massey
1f0e85bae3
Exposing the ability to log deprecated settings at non-critical level(#79107) (#79492)
A recent change for the deprecation logs provided the capability to emit deprecation's at critical vs. warning levels, #77482.
However deprecated settings always log at critical level without the ability to express that the setting deprecation is only a
warning.

This commit exposes the ability to set the deprecation level when deprecating a setting.
Relates #78781
2021-10-19 14:32:17 -05:00
William Brafford
159cb4413c
Use 'migration' instead of 'upgrade' in GET system feature migration status responses (#79302) (#79495)
* Change 'upgrade' to 'migration' in System Index Migration responses
2021-10-19 13:32:53 -04:00
Artem Prigoda
d8c1428136
[7.x] Use query param instead of a system property for opting in for new cluster health response code (#79397) (#79435)
Backport #79351 to 7.x:

The original change was implemented in #78940, but we have decided to move from a system property
to a request parameter, so Cloud users/clients have an easier way to opt-in for the new status code.

Relates #70849
2021-10-19 14:21:34 +01:00
Rene Groeschke
c6e5483784
Replace eager gradle task creation with task avoidance api (#79442)
* Replace eager gradle task creation with task avoidance api

Some more eagerly created tasks sneaked into the 7.x branch lately

* Fix typo in integTest configuration
2021-10-19 06:26:12 -04:00