-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Upgrade ES client to 9.0.0-alpha.3 #208776
Conversation
# Conflicts: # x-pack/solutions/security/packages/data-stream-adapter/src/create_or_update_data_stream.ts # x-pack/solutions/security/packages/index-adapter/src/create_or_update_index.ts
087452c
to
640c0fd
Compare
0561aa3
to
8c610c2
Compare
It looks like this PR modifies one or more |
45691d7
to
f5c6882
Compare
It looks like this PR modifies one or more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDA team LGTM!
@@ -131,6 +131,7 @@ export function registerSearchApplicationsRoutes({ log, router }: RouteDependenc | |||
name: request.params.engine_name, | |||
search_application: { | |||
indices: request.body.indices, | |||
// @ts-expect-error [email protected] has this parameter been renamed to analytics_collection_name? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually a different one. name
is the search application's display name, analytics_collection_name
is the name of the related collection
https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/SearchApplication.java#L67
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smoke testing synthetics/SLO looks good !!
MKI tests passed! Running a final CI with the latest |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
cc @afharo |
Starting backport for target branches: 9.0 https://github.com/elastic/kibana/actions/runs/13523771765 |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
Skipping backport since the amount of conflicts in the 9.0 branch would create too many risks. |
## Summary Updating the ES client to 9.0. Resolves elastic#116102 ## What changes? **Breaking change**: `body` has been removed. Most of the changes are about bringing all the content inside the body as a root attribute to the API params: ```diff const response = await client.search({ index: 'test', - body: { query: { match_all: {} } - } }) ``` For this reason, enabling the "Hide whitespace changes" option when reviewing is recommended. Some exceptions to this rule: * Bulk APIs replace the `body` array with `operations` array (direct replacement) * Index Put Settings API replace `body` array with `settings` (direct replacement) * Msearch replaces the `body` array with `searches` array (direct replacement) * Document Index API replaces `body` with `document` (direct replacement) * Create Repository replaces `body` with `repository` (direct replacement) Because of a known issue in the client (elastic/elasticsearch-js#2584), there's still an escape hatch to send data in the body in case the specific use case requires it via `// @ts-expect-error [email protected] https://github.com/elastic/elasticsearch-js/issues/2584`, but it shouldn't be abused because we lose types. In this PR we've used it in those scenarios where we reuse the response of a GET as the body of a PUT/POST. ### Other changes * `estypes` can be imported from the root of the library as `import type { estypes } from '@elastic/elasticsearch';` * `estypesWithBody` have been removed * `requestTimeout`'s 30s default has been removed in the client. This PR explicitly adds the setting in all client usages. ### Identify risks - [x] The client places unknown properties as querystring, risking body params leaking there, and causing 400 errors from ES => Solved by forcing `body` usage there via `// @ts-expect-error [email protected] https://github.com/elastic/elasticsearch-js/issues/2584`. The next version of the client will address this. - [x] We need to run the MKI tests to make sure that we're not breaking anything there => https://elastic.slack.com/archives/C04HT4P1YS3/p1739528112482629?thread_ts=1739480136.231439&cid=C04HT4P1YS3 --------- Co-authored-by: Gloria Hornero <[email protected]>
## Summary This PR fixes an issue introduced in #208776 where switching from ES|QL mode to classic mode in Discover caused the search request to fail with an `unrecognized parameter: [indexType]` error. This was because the `indexType` was actually being sent as part of the search request `params` when it shouldn't have been. We already had some rollup tests that would have caught it, but a workaround was also added to the rollup search strategy to sidestep the issue, preventing the tests from failing. That workaround has been removed and existing ES|QL tests updated to catch the issue specifically for ES|QL mode. Fixes #212704. ### Checklist - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
## Summary After upgrading the ES client to 9.0 (#208776), we noticed that the CI fails to upload the results of the tests to the CI cluster: ``` ERROR ResponseError: media_type_header_exception Caused by: status_exception: Accept version must be either version 8 or 7, but found 9. Accept=application/vnd.elasticsearch+json; compatible-with=9 Root causes: media_type_header_exception: Invalid media-type value on headers [Content-Type, Accept] ``` This PR makes sure that the CI client is still using v8.x until we upgrade that cluster.
Summary
Updating the ES client to 9.0.
Resolves #116102
What changes?
Breaking change:
body
has been removed.Most of the changes are about bringing all the content inside the body as a root attribute to the API params:
For this reason, enabling the "Hide whitespace changes" option when reviewing is recommended.
Some exceptions to this rule:
body
array withoperations
array (direct replacement)body
array withsettings
(direct replacement)body
array withsearches
array (direct replacement)body
withdocument
(direct replacement)body
withrepository
(direct replacement)Because of a known issue in the client (elastic/elasticsearch-js#2584), there's still an escape hatch to send data in the body in case the specific use case requires it via
// @ts-expect-error [email protected] https://github.com/elastic/elasticsearch-js/issues/2584
, but it shouldn't be abused because we lose types. In this PR we've used it in those scenarios where we reuse the response of a GET as the body of a PUT/POST.Other changes
estypes
can be imported from the root of the library asimport type { estypes } from '@elastic/elasticsearch';
estypesWithBody
have been removedrequestTimeout
's 30s default has been removed in the client. This PR explicitly adds the setting in all client usages.Identify risks
body
usage there via// @ts-expect-error [email protected] https://github.com/elastic/elasticsearch-js/issues/2584
. The next version of the client will address this.