Commit graph

404 commits

Author SHA1 Message Date
Luke Elmers
79803b830c
[8.10] Remove excessively verbose logs (#166525) (#166541) (#166567) 2023-09-15 14:42:11 -06:00
Kibana Machine
18cfd84a54
[8.10] Log more information on requests that fail at global router level (#165293) (#165587)
# Backport

This will backport the following commits from `main` to `8.10`:
- [Log more information on requests that fail at global router level
(#165293)](https://github.com/elastic/kibana/pull/165293)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Gerard
Soldevila","email":"gerard.soldevila@elastic.co"},"sourceCommit":{"committedDate":"2023-09-04T12:20:27Z","message":"Log
more information on requests that fail at global router level
(#165293)\n\nThere are certain occasions where Kibana UI shows a blank
page (e.g. on\r\nthis
[failed\r\ntest](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2999)).\r\nBlank
pages can happen when browsers are not able to fetch one or more\r\nof
the bootstrap resources, e.g. `/bootstrap.js`.\r\nSometimes, Kibana
server-side logs don't contain any information at all\r\nas to what
caused the failure.\r\n\r\nThis PR adds a bit more information in the
logs, hoping it will help us\r\nunderstanding why some of these requests
fail sometimes.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"86765b916dbfc424144735b9c5de904a4e7b7de0","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Core","release_note:skip","backport:prev-minor","v8.11.0"],"number":165293,"url":"https://github.com/elastic/kibana/pull/165293","mergeCommit":{"message":"Log
more information on requests that fail at global router level
(#165293)\n\nThere are certain occasions where Kibana UI shows a blank
page (e.g. on\r\nthis
[failed\r\ntest](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2999)).\r\nBlank
pages can happen when browsers are not able to fetch one or more\r\nof
the bootstrap resources, e.g. `/bootstrap.js`.\r\nSometimes, Kibana
server-side logs don't contain any information at all\r\nas to what
caused the failure.\r\n\r\nThis PR adds a bit more information in the
logs, hoping it will help us\r\nunderstanding why some of these requests
fail sometimes.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"86765b916dbfc424144735b9c5de904a4e7b7de0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/165293","number":165293,"mergeCommit":{"message":"Log
more information on requests that fail at global router level
(#165293)\n\nThere are certain occasions where Kibana UI shows a blank
page (e.g. on\r\nthis
[failed\r\ntest](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2999)).\r\nBlank
pages can happen when browsers are not able to fetch one or more\r\nof
the bootstrap resources, e.g. `/bootstrap.js`.\r\nSometimes, Kibana
server-side logs don't contain any information at all\r\nas to what
caused the failure.\r\n\r\nThis PR adds a bit more information in the
logs, hoping it will help us\r\nunderstanding why some of these requests
fail sometimes.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"86765b916dbfc424144735b9c5de904a4e7b7de0"}}]}]
BACKPORT-->

Co-authored-by: Gerard Soldevila <gerard.soldevila@elastic.co>
2023-09-04 06:27:44 -07:00
Kibana Machine
491db2bb1f
[8.10] [SOR] implement downward compatible update (#161822) (#165436)
# Backport

This will backport the following commits from `main` to `8.10`:
- [[SOR] implement downward compatible `update`
(#161822)](https://github.com/elastic/kibana/pull/161822)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Christiane (Tina)
Heiligers","email":"christiane.heiligers@elastic.co"},"sourceCommit":{"committedDate":"2023-09-01T08:27:17Z","message":"[SOR]
implement downward compatible `update` (#161822)\n\nPart of
https://github.com/elastic/kibana/issues/152807\r\n\r\n##
Summary\r\n\r\nChange the way the `update` API of the savedObjects
repository works, to\r\nstop using ES `update` and perform the update
manually instead by\r\nfetching the document, applying the update and
then re-indexing the\r\nwhole document.\r\n\r\nThis is required for BWC
and version cohabitation reasons, to allow us\r\nconverting the document
to the last known version before applying the\r\nupdate.\r\n\r\nThe
retry on conflict behavior is manually performed too, by
detecting\r\nconflict errors during the `index` calls and performing the
whole loop\r\n(fetch->migrate->update->index) again.\r\n\r\nUpserts are
done in a similar way, by checking the document's existence\r\nfirst,
and then using the `create` API.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
pgayvallet
<pierre.gayvallet@elastic.co>","sha":"727929683e036abe1d5b8c2b05d9c0e5a7539b14","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","Feature:Saved
Objects","release_note:skip","backport:all-open","v8.10.0","v8.11.0"],"number":161822,"url":"https://github.com/elastic/kibana/pull/161822","mergeCommit":{"message":"[SOR]
implement downward compatible `update` (#161822)\n\nPart of
https://github.com/elastic/kibana/issues/152807\r\n\r\n##
Summary\r\n\r\nChange the way the `update` API of the savedObjects
repository works, to\r\nstop using ES `update` and perform the update
manually instead by\r\nfetching the document, applying the update and
then re-indexing the\r\nwhole document.\r\n\r\nThis is required for BWC
and version cohabitation reasons, to allow us\r\nconverting the document
to the last known version before applying the\r\nupdate.\r\n\r\nThe
retry on conflict behavior is manually performed too, by
detecting\r\nconflict errors during the `index` calls and performing the
whole loop\r\n(fetch->migrate->update->index) again.\r\n\r\nUpserts are
done in a similar way, by checking the document's existence\r\nfirst,
and then using the `create` API.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
pgayvallet
<pierre.gayvallet@elastic.co>","sha":"727929683e036abe1d5b8c2b05d9c0e5a7539b14"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/161822","number":161822,"mergeCommit":{"message":"[SOR]
implement downward compatible `update` (#161822)\n\nPart of
https://github.com/elastic/kibana/issues/152807\r\n\r\n##
Summary\r\n\r\nChange the way the `update` API of the savedObjects
repository works, to\r\nstop using ES `update` and perform the update
manually instead by\r\nfetching the document, applying the update and
then re-indexing the\r\nwhole document.\r\n\r\nThis is required for BWC
and version cohabitation reasons, to allow us\r\nconverting the document
to the last known version before applying the\r\nupdate.\r\n\r\nThe
retry on conflict behavior is manually performed too, by
detecting\r\nconflict errors during the `index` calls and performing the
whole loop\r\n(fetch->migrate->update->index) again.\r\n\r\nUpserts are
done in a similar way, by checking the document's existence\r\nfirst,
and then using the `create` API.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
pgayvallet
<pierre.gayvallet@elastic.co>","sha":"727929683e036abe1d5b8c2b05d9c0e5a7539b14"}}]}]
BACKPORT-->

Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
2023-09-01 02:45:31 -07:00
Christiane (Tina) Heiligers
f504ce3c9b
Revert "[8.10] [SOR] Allow optionally downgrading documents with a higher version model in API READ methods (#164789)" (#165023) 2023-08-28 11:32:00 -07:00
Kibana Machine
c24835fb12
[8.10] [SOR] Allow optionally downgrading documents with a higher version model in API READ methods (#164789) (#164924)
# Backport

This will backport the following commits from `main` to `8.10`:
- [[SOR] Allow optionally downgrading documents with a higher version
model in API READ methods
(#164789)](https://github.com/elastic/kibana/pull/164789)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Christiane (Tina)
Heiligers","email":"christiane.heiligers@elastic.co"},"sourceCommit":{"committedDate":"2023-08-26T20:32:40Z","message":"[SOR]
Allow optionally downgrading documents with a higher version model in
API READ methods (#164789)\n\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"0f4052bc200b5e2d29e2b10983335fa5c13510fe","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Saved
Objects","release_note:skip","backport:all-open","Epic:KBNA-7996","v8.10.0","v8.11.0"],"number":164789,"url":"https://github.com/elastic/kibana/pull/164789","mergeCommit":{"message":"[SOR]
Allow optionally downgrading documents with a higher version model in
API READ methods (#164789)\n\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"0f4052bc200b5e2d29e2b10983335fa5c13510fe"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164789","number":164789,"mergeCommit":{"message":"[SOR]
Allow optionally downgrading documents with a higher version model in
API READ methods (#164789)\n\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"0f4052bc200b5e2d29e2b10983335fa5c13510fe"}}]}]
BACKPORT-->

Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
2023-08-26 14:42:02 -07:00
Kibana Machine
4de45864fc
[8.10] [Logger] Strip ANSI escape codes from the message (#164337) (#164821)
# Backport

This will backport the following commits from `main` to `8.10`:
- [[Logger] Strip ANSI escape codes from the message
(#164337)](https://github.com/elastic/kibana/pull/164337)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alejandro Fernández
Haro","email":"alejandro.haro@elastic.co"},"sourceCommit":{"committedDate":"2023-08-25T09:53:57Z","message":"[Logger]
Strip ANSI escape codes from the message (#164337)\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"4b88b10b0f4e3539f697fecfbf2a2097aa620510","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","Team:Security","release_note:skip","Team:
SecuritySolution","backport:prev-minor","v8.11.0"],"number":164337,"url":"https://github.com/elastic/kibana/pull/164337","mergeCommit":{"message":"[Logger]
Strip ANSI escape codes from the message (#164337)\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"4b88b10b0f4e3539f697fecfbf2a2097aa620510"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164337","number":164337,"mergeCommit":{"message":"[Logger]
Strip ANSI escape codes from the message (#164337)\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"4b88b10b0f4e3539f697fecfbf2a2097aa620510"}}]}]
BACKPORT-->

Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
2023-08-25 04:16:33 -07:00
Tiago Costa
4e26eebc26
[8.10] chore(NA): upgrade typescript into v4.7.4 (#162738) (#164758)
# Backport

This will backport the following commits from `main` to `8.10`:
- [chore(NA): upgrade typescript into v4.7.4
(#162738)](https://github.com/elastic/kibana/pull/162738)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Tiago
Costa","email":"tiago.costa@elastic.co"},"sourceCommit":{"committedDate":"2023-08-24T16:27:13Z","message":"chore(NA):
upgrade typescript into v4.7.4 (#162738)\n\nThis PR bumps the Typescript
version used on Kibana into v4.7.4.\r\n\r\nDuring the upgrade I got the
impression the majority of the failures\r\nwere too specific to the
codebase so instead of making assumptions I\r\nchoose to marked a lot of
them with `@ts-expect-error` and let each team\r\ndecide how to handle
it.\r\n\r\nNext you can find a list of files with those comments and the
teams to\r\nwho they belong to. I would appreciate the collaboration
from each team\r\non fixing those. I'm not opposed on fixing those in
subsequent PRs after\r\nthis one have been merged, just wanted to
elaborate that list for a good\r\nfollow up:\r\n\r\n@elastic/kibana-core
\r\n-
[x]\r\n[packages/core/http/core-http-router-server-internal/src/request.ts](https://github.com/elastic/kibana/pull/162738/files#diff-c1f4a8c013c6ff9c5170803322414cb002f70331b23e45c55f075258c678410a)\r\n\r\n@elastic/kibana-data-discovery
\r\n-
[x]\r\n[src/plugins/discover/public/components/doc_table/components/table_row.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-9106b254a57e73fc6f0b2e01f9aff1abbd26f1a0999e6fa998f1b45d3013038f)\r\n\r\n@elastic/kibana-visualizations
\r\n-
[x]\r\n[src/plugins/expressions/common/execution/execution.ts](https://github.com/elastic/kibana/pull/162738/files#diff-47bf3af7472c08ede90f86575ee7db4b8a2c949b1fb61400410ed16a8d819667)\r\n-
[x]\r\n[src/plugins/expressions/common/expression_functions/expression_function_parameter.ts](https://github.com/elastic/kibana/pull/162738/files#diff-3bcaa3c50f2297ff990c7ac83a1c2d36a79e6706a09082c3c48a911713afe950)\r\n-
[x]\r\n[src/plugins/vis_types/heatmap/public/editor/components/labels_panel.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-345db24d53f4158414480b890fa43d1f8a454b67313de79602fda081279cbc4f)\r\n-
[x]\r\n[src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-1c346b41cf025ff4f4e07b6d6dcdd1451cbaa758f9a9e8c72a9801d3fbbdfda2)\r\n\r\n@elastic/kibana-presentation
\r\n-
[x]\r\n[x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts](https://github.com/elastic/kibana/pull/162738/files#diff-56858ed9be77830ab218eab1960337240926609c5a1593b3960b35660ef81359)\r\n\r\n@elastic/response-ops
\r\n-
[x]\r\n[x-pack/plugins/cases/public/components/create/form.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-c5c415f1f56ca986f4bb59e65490b5e0fc77a86092240c0c1a26c141dba07818)\r\n-
[x]\r\n[x-pack/plugins/cases/public/components/markdown_editor/editable_markdown_renderer.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-ab038916f6fed59e18b0a72ce8e823e88d115afdb2704010d0fa8656b66702df)\r\n-
[x]\r\n[x-pack/plugins/rule_registry/server/alert_data_client/browser_fields/index.ts](https://github.com/elastic/kibana/pull/162738/files#diff-3f91aa93f7e6514c0479a37a76d6e9a53646d4eaf5dcd0db64437eadf1eee6b6)\r\n-
[x]\r\n[x-pack/plugins/triggers_actions_ui/.storybook/decorator.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-fbf1d6d0104c11c3f3690d29edf06000b5a63a858bb22b7d04d1f96a45133b07)\r\n-
[x]\r\n[x-pack/plugins/triggers_actions_ui/common/experimental_features.ts](https://github.com/elastic/kibana/pull/162738/files#diff-8e2ca70700895b17125532779945a1d0ab9076b4d4db304c065b47f82b6628a5)\r\n-
[x]\r\n[x-pack/plugins/triggers_actions_ui/public/common/get_experimental_features.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-8e2ca70700895b17125532779945a1d0ab9076b4d4db304c065b47f82b6628a5)\r\n\r\n@elastic/fleet
\r\n-
[x]\r\n[x-pack/plugins/fleet/common/experimental_features.ts](https://github.com/elastic/kibana/pull/162738/files#diff-a852b157b5ff1d6dbf321ea8a25f0020d8f88cd458378cc9de8ef25ce28c9414)\r\n-
[x]\r\n[x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-9eea0be0f9341dd6369720ce7b11bff69dda51230337ebbae921f6abde187bd2)\r\n-
[x]\r\n[x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-844d5f9707b739d25f2b73bd34c45c21e2e5d573b3238c13130a0d1c1db092dc)\r\n-
[x]\r\n[x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-f88d92abbc549ddc95d693bf3a3bc9752613cf74f1e859a01ca61d572e031b11)\r\n-
[x]\r\n[x-pack/plugins/fleet/server/mocks/index.ts](https://github.com/elastic/kibana/pull/162738/files#diff-d3f3e436b158ac2d877b7be9d57642855f89b0149cc28735811443da45bb079f)\r\n\r\n@elastic/security-detection-engine\r\n-
[x]\r\n[x-pack/plugins/lists/server/services/extension_points/extension_point_storage_client.ts](https://github.com/elastic/kibana/pull/162738/files#diff-dbbf5a8541e06fd977c66e44d9ef59f738d953bdfda679ac838e098742c92f50)\r\n-
[x]\r\n[x-pack/plugins/lists/server/services/extension_points/types.ts](https://github.com/elastic/kibana/pull/162738/files#diff-31186826bea8fdb286a25878fa06eeacad8f7a6c384d617fed905d4625821eef)\r\n\r\n@elastic/security-defend-workflows
@gergoabraham \r\n-
[x]\r\n[x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-049eeedef2a403ade7c636418e17fc9a3ffc7030eec2f3e013f459721c076470)\r\n\r\n@elastic/infra-monitoring-ui
\r\n-
[x]\r\n[x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-4ab4fa150247d8f522741ae5ea1ea71c102c72f5439410ea869ec1c9dc9878ad)\r\n-
[x]\r\n[x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-285a67d9ec93651206608d308e5d1d20ccc98ccccb9bcbf3ee31fe35c1844b42)\r\n\r\n@elastic/kibana-security
\r\n-
[x]\r\n[x-pack/plugins/security/server/authentication/authenticator.ts](https://github.com/elastic/kibana/pull/162738/files#diff-bd369002fdfd0986f1ce3bf16263fb8b765e01a86832ccf5b4e521811d502038)\r\n-
[x]\r\n[x-pack/plugins/security/server/session_management/session_index.ts](https://github.com/elastic/kibana/pull/162738/files#diff-10b76eb52a0e17564ad864def8270bb84a4eb87eb35851309bc36601086cbcd7)\r\n\r\n@elastic/security-threat-hunting-explore
@gergoabraham \r\n-
[x]\r\n[x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-7f130bdc9a954330d188aa25324910cf2f72baf76d1329bd36584f5bb153856b)\r\n\r\n@elastic/security-solution
@gergoabraham \r\n-
[x]\r\n[x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-e68a2799df17238257a86ce965369c525be901f6f882e518bde9e8c9bd7cd2c8)\r\n-
[x]\r\n[x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_collection_card.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-edc756f655792f7dcaca0c707f35c6c022981be1873712f460ccb1d611e42568)\r\n-
[x]\r\n[x-pack/plugins/security_solution/tsconfig.json](https://github.com/elastic/kibana/pull/162738/files#diff-844dde79a96b9e6c2bfdf21f8c80feb8b687577e21326da6bd15c6b95d8ec918)\r\n\r\n@elastic/uptime
\r\n-
[x]\r\n[x-pack/plugins/uptime/server/legacy_uptime/lib/alerts/duration_anomaly.test.ts](https://github.com/elastic/kibana/pull/162738/files#diff-6c7b63ce65aa17a2fe3219e1747ae051be88fb02edbe2f198ad6fd418a2bcc57)\r\n\r\n@elastic/security-detections-response-alerts
@gergoabraham \r\n-
[x]\r\n[x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword_array.ts](https://github.com/elastic/kibana/pull/162738/files#diff-472ba2c7fe43448c8a4d04406703f755f71f6e60146bb2f090b4ca0f19ad0a0f)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Michael Dokolin <dokmic@gmail.com>\r\nCo-authored-by: Stratoula
Kalafateli <stratoula1@gmail.com>\r\nCo-authored-by: Rudolf Meijering
<skaapgif@gmail.com>\r\nCo-authored-by: Devon Thomson
<devon.thomson@elastic.co>","sha":"2d652e1313a64f55bae994833324ad8116738254","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","Feature:ExpressionLanguage","release_note:skip","Team:Fleet","auto-backport","v8.10.0","v7.17.13","v8.11.0","v8.9.2"],"number":162738,"url":"https://github.com/elastic/kibana/pull/162738","mergeCommit":{"message":"chore(NA):
upgrade typescript into v4.7.4 (#162738)\n\nThis PR bumps the Typescript
version used on Kibana into v4.7.4.\r\n\r\nDuring the upgrade I got the
impression the majority of the failures\r\nwere too specific to the
codebase so instead of making assumptions I\r\nchoose to marked a lot of
them with `@ts-expect-error` and let each team\r\ndecide how to handle
it.\r\n\r\nNext you can find a list of files with those comments and the
teams to\r\nwho they belong to. I would appreciate the collaboration
from each team\r\non fixing those. I'm not opposed on fixing those in
subsequent PRs after\r\nthis one have been merged, just wanted to
elaborate that list for a good\r\nfollow up:\r\n\r\n@elastic/kibana-core
\r\n-
[x]\r\n[packages/core/http/core-http-router-server-internal/src/request.ts](https://github.com/elastic/kibana/pull/162738/files#diff-c1f4a8c013c6ff9c5170803322414cb002f70331b23e45c55f075258c678410a)\r\n\r\n@elastic/kibana-data-discovery
\r\n-
[x]\r\n[src/plugins/discover/public/components/doc_table/components/table_row.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-9106b254a57e73fc6f0b2e01f9aff1abbd26f1a0999e6fa998f1b45d3013038f)\r\n\r\n@elastic/kibana-visualizations
\r\n-
[x]\r\n[src/plugins/expressions/common/execution/execution.ts](https://github.com/elastic/kibana/pull/162738/files#diff-47bf3af7472c08ede90f86575ee7db4b8a2c949b1fb61400410ed16a8d819667)\r\n-
[x]\r\n[src/plugins/expressions/common/expression_functions/expression_function_parameter.ts](https://github.com/elastic/kibana/pull/162738/files#diff-3bcaa3c50f2297ff990c7ac83a1c2d36a79e6706a09082c3c48a911713afe950)\r\n-
[x]\r\n[src/plugins/vis_types/heatmap/public/editor/components/labels_panel.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-345db24d53f4158414480b890fa43d1f8a454b67313de79602fda081279cbc4f)\r\n-
[x]\r\n[src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-1c346b41cf025ff4f4e07b6d6dcdd1451cbaa758f9a9e8c72a9801d3fbbdfda2)\r\n\r\n@elastic/kibana-presentation
\r\n-
[x]\r\n[x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts](https://github.com/elastic/kibana/pull/162738/files#diff-56858ed9be77830ab218eab1960337240926609c5a1593b3960b35660ef81359)\r\n\r\n@elastic/response-ops
\r\n-
[x]\r\n[x-pack/plugins/cases/public/components/create/form.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-c5c415f1f56ca986f4bb59e65490b5e0fc77a86092240c0c1a26c141dba07818)\r\n-
[x]\r\n[x-pack/plugins/cases/public/components/markdown_editor/editable_markdown_renderer.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-ab038916f6fed59e18b0a72ce8e823e88d115afdb2704010d0fa8656b66702df)\r\n-
[x]\r\n[x-pack/plugins/rule_registry/server/alert_data_client/browser_fields/index.ts](https://github.com/elastic/kibana/pull/162738/files#diff-3f91aa93f7e6514c0479a37a76d6e9a53646d4eaf5dcd0db64437eadf1eee6b6)\r\n-
[x]\r\n[x-pack/plugins/triggers_actions_ui/.storybook/decorator.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-fbf1d6d0104c11c3f3690d29edf06000b5a63a858bb22b7d04d1f96a45133b07)\r\n-
[x]\r\n[x-pack/plugins/triggers_actions_ui/common/experimental_features.ts](https://github.com/elastic/kibana/pull/162738/files#diff-8e2ca70700895b17125532779945a1d0ab9076b4d4db304c065b47f82b6628a5)\r\n-
[x]\r\n[x-pack/plugins/triggers_actions_ui/public/common/get_experimental_features.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-8e2ca70700895b17125532779945a1d0ab9076b4d4db304c065b47f82b6628a5)\r\n\r\n@elastic/fleet
\r\n-
[x]\r\n[x-pack/plugins/fleet/common/experimental_features.ts](https://github.com/elastic/kibana/pull/162738/files#diff-a852b157b5ff1d6dbf321ea8a25f0020d8f88cd458378cc9de8ef25ce28c9414)\r\n-
[x]\r\n[x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-9eea0be0f9341dd6369720ce7b11bff69dda51230337ebbae921f6abde187bd2)\r\n-
[x]\r\n[x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-844d5f9707b739d25f2b73bd34c45c21e2e5d573b3238c13130a0d1c1db092dc)\r\n-
[x]\r\n[x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-f88d92abbc549ddc95d693bf3a3bc9752613cf74f1e859a01ca61d572e031b11)\r\n-
[x]\r\n[x-pack/plugins/fleet/server/mocks/index.ts](https://github.com/elastic/kibana/pull/162738/files#diff-d3f3e436b158ac2d877b7be9d57642855f89b0149cc28735811443da45bb079f)\r\n\r\n@elastic/security-detection-engine\r\n-
[x]\r\n[x-pack/plugins/lists/server/services/extension_points/extension_point_storage_client.ts](https://github.com/elastic/kibana/pull/162738/files#diff-dbbf5a8541e06fd977c66e44d9ef59f738d953bdfda679ac838e098742c92f50)\r\n-
[x]\r\n[x-pack/plugins/lists/server/services/extension_points/types.ts](https://github.com/elastic/kibana/pull/162738/files#diff-31186826bea8fdb286a25878fa06eeacad8f7a6c384d617fed905d4625821eef)\r\n\r\n@elastic/security-defend-workflows
@gergoabraham \r\n-
[x]\r\n[x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-049eeedef2a403ade7c636418e17fc9a3ffc7030eec2f3e013f459721c076470)\r\n\r\n@elastic/infra-monitoring-ui
\r\n-
[x]\r\n[x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-4ab4fa150247d8f522741ae5ea1ea71c102c72f5439410ea869ec1c9dc9878ad)\r\n-
[x]\r\n[x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-285a67d9ec93651206608d308e5d1d20ccc98ccccb9bcbf3ee31fe35c1844b42)\r\n\r\n@elastic/kibana-security
\r\n-
[x]\r\n[x-pack/plugins/security/server/authentication/authenticator.ts](https://github.com/elastic/kibana/pull/162738/files#diff-bd369002fdfd0986f1ce3bf16263fb8b765e01a86832ccf5b4e521811d502038)\r\n-
[x]\r\n[x-pack/plugins/security/server/session_management/session_index.ts](https://github.com/elastic/kibana/pull/162738/files#diff-10b76eb52a0e17564ad864def8270bb84a4eb87eb35851309bc36601086cbcd7)\r\n\r\n@elastic/security-threat-hunting-explore
@gergoabraham \r\n-
[x]\r\n[x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-7f130bdc9a954330d188aa25324910cf2f72baf76d1329bd36584f5bb153856b)\r\n\r\n@elastic/security-solution
@gergoabraham \r\n-
[x]\r\n[x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-e68a2799df17238257a86ce965369c525be901f6f882e518bde9e8c9bd7cd2c8)\r\n-
[x]\r\n[x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_collection_card.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-edc756f655792f7dcaca0c707f35c6c022981be1873712f460ccb1d611e42568)\r\n-
[x]\r\n[x-pack/plugins/security_solution/tsconfig.json](https://github.com/elastic/kibana/pull/162738/files#diff-844dde79a96b9e6c2bfdf21f8c80feb8b687577e21326da6bd15c6b95d8ec918)\r\n\r\n@elastic/uptime
\r\n-
[x]\r\n[x-pack/plugins/uptime/server/legacy_uptime/lib/alerts/duration_anomaly.test.ts](https://github.com/elastic/kibana/pull/162738/files#diff-6c7b63ce65aa17a2fe3219e1747ae051be88fb02edbe2f198ad6fd418a2bcc57)\r\n\r\n@elastic/security-detections-response-alerts
@gergoabraham \r\n-
[x]\r\n[x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword_array.ts](https://github.com/elastic/kibana/pull/162738/files#diff-472ba2c7fe43448c8a4d04406703f755f71f6e60146bb2f090b4ca0f19ad0a0f)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Michael Dokolin <dokmic@gmail.com>\r\nCo-authored-by: Stratoula
Kalafateli <stratoula1@gmail.com>\r\nCo-authored-by: Rudolf Meijering
<skaapgif@gmail.com>\r\nCo-authored-by: Devon Thomson
<devon.thomson@elastic.co>","sha":"2d652e1313a64f55bae994833324ad8116738254"}},"sourceBranch":"main","suggestedTargetBranches":["8.10","7.17","8.9"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"7.17","label":"v7.17.13","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/162738","number":162738,"mergeCommit":{"message":"chore(NA):
upgrade typescript into v4.7.4 (#162738)\n\nThis PR bumps the Typescript
version used on Kibana into v4.7.4.\r\n\r\nDuring the upgrade I got the
impression the majority of the failures\r\nwere too specific to the
codebase so instead of making assumptions I\r\nchoose to marked a lot of
them with `@ts-expect-error` and let each team\r\ndecide how to handle
it.\r\n\r\nNext you can find a list of files with those comments and the
teams to\r\nwho they belong to. I would appreciate the collaboration
from each team\r\non fixing those. I'm not opposed on fixing those in
subsequent PRs after\r\nthis one have been merged, just wanted to
elaborate that list for a good\r\nfollow up:\r\n\r\n@elastic/kibana-core
\r\n-
[x]\r\n[packages/core/http/core-http-router-server-internal/src/request.ts](https://github.com/elastic/kibana/pull/162738/files#diff-c1f4a8c013c6ff9c5170803322414cb002f70331b23e45c55f075258c678410a)\r\n\r\n@elastic/kibana-data-discovery
\r\n-
[x]\r\n[src/plugins/discover/public/components/doc_table/components/table_row.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-9106b254a57e73fc6f0b2e01f9aff1abbd26f1a0999e6fa998f1b45d3013038f)\r\n\r\n@elastic/kibana-visualizations
\r\n-
[x]\r\n[src/plugins/expressions/common/execution/execution.ts](https://github.com/elastic/kibana/pull/162738/files#diff-47bf3af7472c08ede90f86575ee7db4b8a2c949b1fb61400410ed16a8d819667)\r\n-
[x]\r\n[src/plugins/expressions/common/expression_functions/expression_function_parameter.ts](https://github.com/elastic/kibana/pull/162738/files#diff-3bcaa3c50f2297ff990c7ac83a1c2d36a79e6706a09082c3c48a911713afe950)\r\n-
[x]\r\n[src/plugins/vis_types/heatmap/public/editor/components/labels_panel.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-345db24d53f4158414480b890fa43d1f8a454b67313de79602fda081279cbc4f)\r\n-
[x]\r\n[src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-1c346b41cf025ff4f4e07b6d6dcdd1451cbaa758f9a9e8c72a9801d3fbbdfda2)\r\n\r\n@elastic/kibana-presentation
\r\n-
[x]\r\n[x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts](https://github.com/elastic/kibana/pull/162738/files#diff-56858ed9be77830ab218eab1960337240926609c5a1593b3960b35660ef81359)\r\n\r\n@elastic/response-ops
\r\n-
[x]\r\n[x-pack/plugins/cases/public/components/create/form.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-c5c415f1f56ca986f4bb59e65490b5e0fc77a86092240c0c1a26c141dba07818)\r\n-
[x]\r\n[x-pack/plugins/cases/public/components/markdown_editor/editable_markdown_renderer.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-ab038916f6fed59e18b0a72ce8e823e88d115afdb2704010d0fa8656b66702df)\r\n-
[x]\r\n[x-pack/plugins/rule_registry/server/alert_data_client/browser_fields/index.ts](https://github.com/elastic/kibana/pull/162738/files#diff-3f91aa93f7e6514c0479a37a76d6e9a53646d4eaf5dcd0db64437eadf1eee6b6)\r\n-
[x]\r\n[x-pack/plugins/triggers_actions_ui/.storybook/decorator.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-fbf1d6d0104c11c3f3690d29edf06000b5a63a858bb22b7d04d1f96a45133b07)\r\n-
[x]\r\n[x-pack/plugins/triggers_actions_ui/common/experimental_features.ts](https://github.com/elastic/kibana/pull/162738/files#diff-8e2ca70700895b17125532779945a1d0ab9076b4d4db304c065b47f82b6628a5)\r\n-
[x]\r\n[x-pack/plugins/triggers_actions_ui/public/common/get_experimental_features.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-8e2ca70700895b17125532779945a1d0ab9076b4d4db304c065b47f82b6628a5)\r\n\r\n@elastic/fleet
\r\n-
[x]\r\n[x-pack/plugins/fleet/common/experimental_features.ts](https://github.com/elastic/kibana/pull/162738/files#diff-a852b157b5ff1d6dbf321ea8a25f0020d8f88cd458378cc9de8ef25ce28c9414)\r\n-
[x]\r\n[x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/index.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-9eea0be0f9341dd6369720ce7b11bff69dda51230337ebbae921f6abde187bd2)\r\n-
[x]\r\n[x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-844d5f9707b739d25f2b73bd34c45c21e2e5d573b3238c13130a0d1c1db092dc)\r\n-
[x]\r\n[x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-f88d92abbc549ddc95d693bf3a3bc9752613cf74f1e859a01ca61d572e031b11)\r\n-
[x]\r\n[x-pack/plugins/fleet/server/mocks/index.ts](https://github.com/elastic/kibana/pull/162738/files#diff-d3f3e436b158ac2d877b7be9d57642855f89b0149cc28735811443da45bb079f)\r\n\r\n@elastic/security-detection-engine\r\n-
[x]\r\n[x-pack/plugins/lists/server/services/extension_points/extension_point_storage_client.ts](https://github.com/elastic/kibana/pull/162738/files#diff-dbbf5a8541e06fd977c66e44d9ef59f738d953bdfda679ac838e098742c92f50)\r\n-
[x]\r\n[x-pack/plugins/lists/server/services/extension_points/types.ts](https://github.com/elastic/kibana/pull/162738/files#diff-31186826bea8fdb286a25878fa06eeacad8f7a6c384d617fed905d4625821eef)\r\n\r\n@elastic/security-defend-workflows
@gergoabraham \r\n-
[x]\r\n[x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-049eeedef2a403ade7c636418e17fc9a3ffc7030eec2f3e013f459721c076470)\r\n\r\n@elastic/infra-monitoring-ui
\r\n-
[x]\r\n[x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-4ab4fa150247d8f522741ae5ea1ea71c102c72f5439410ea869ec1c9dc9878ad)\r\n-
[x]\r\n[x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-285a67d9ec93651206608d308e5d1d20ccc98ccccb9bcbf3ee31fe35c1844b42)\r\n\r\n@elastic/kibana-security
\r\n-
[x]\r\n[x-pack/plugins/security/server/authentication/authenticator.ts](https://github.com/elastic/kibana/pull/162738/files#diff-bd369002fdfd0986f1ce3bf16263fb8b765e01a86832ccf5b4e521811d502038)\r\n-
[x]\r\n[x-pack/plugins/security/server/session_management/session_index.ts](https://github.com/elastic/kibana/pull/162738/files#diff-10b76eb52a0e17564ad864def8270bb84a4eb87eb35851309bc36601086cbcd7)\r\n\r\n@elastic/security-threat-hunting-explore
@gergoabraham \r\n-
[x]\r\n[x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-7f130bdc9a954330d188aa25324910cf2f72baf76d1329bd36584f5bb153856b)\r\n\r\n@elastic/security-solution
@gergoabraham \r\n-
[x]\r\n[x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-e68a2799df17238257a86ce965369c525be901f6f882e518bde9e8c9bd7cd2c8)\r\n-
[x]\r\n[x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_collection_card.tsx](https://github.com/elastic/kibana/pull/162738/files#diff-edc756f655792f7dcaca0c707f35c6c022981be1873712f460ccb1d611e42568)\r\n-
[x]\r\n[x-pack/plugins/security_solution/tsconfig.json](https://github.com/elastic/kibana/pull/162738/files#diff-844dde79a96b9e6c2bfdf21f8c80feb8b687577e21326da6bd15c6b95d8ec918)\r\n\r\n@elastic/uptime
\r\n-
[x]\r\n[x-pack/plugins/uptime/server/legacy_uptime/lib/alerts/duration_anomaly.test.ts](https://github.com/elastic/kibana/pull/162738/files#diff-6c7b63ce65aa17a2fe3219e1747ae051be88fb02edbe2f198ad6fd418a2bcc57)\r\n\r\n@elastic/security-detections-response-alerts
@gergoabraham \r\n-
[x]\r\n[x-pack/test/detection_engine_api_integration/security_and_spaces/group8/exception_operators_data_types/keyword_array.ts](https://github.com/elastic/kibana/pull/162738/files#diff-472ba2c7fe43448c8a4d04406703f755f71f6e60146bb2f090b4ca0f19ad0a0f)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Michael Dokolin <dokmic@gmail.com>\r\nCo-authored-by: Stratoula
Kalafateli <stratoula1@gmail.com>\r\nCo-authored-by: Rudolf Meijering
<skaapgif@gmail.com>\r\nCo-authored-by: Devon Thomson
<devon.thomson@elastic.co>","sha":"2d652e1313a64f55bae994833324ad8116738254"}},{"branch":"8.9","label":"v8.9.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-24 20:29:02 +01:00
Kibana Machine
e776ad88d9
[8.10] RollingFileAppender: fix file moving mechanism (#164688) (#164716)
# Backport

This will backport the following commits from `main` to `8.10`:
- [RollingFileAppender: fix file moving mechanism
(#164688)](https://github.com/elastic/kibana/pull/164688)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Pierre
Gayvallet","email":"pierre.gayvallet@elastic.co"},"sourceCommit":{"committedDate":"2023-08-24T13:46:48Z","message":"RollingFileAppender:
fix file moving mechanism (#164688)\n\n## Summary\r\n\r\nOn some file
systems or volume mounts, `rename` is not supported and\r\nthrows a
`EXDEV` error, which breaks our file rolling.\r\n\r\nThis PR addresses
it by defaulting to `copy` + `unlink` if the `rename`\r\ncalls fails
with an `EXDEV` error.\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"d16594f266c962efeb6e44c64c7bc2089efddcb9","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Core","release_note:skip","Feature:Logging","backport:prev-minor","v8.11.0"],"number":164688,"url":"https://github.com/elastic/kibana/pull/164688","mergeCommit":{"message":"RollingFileAppender:
fix file moving mechanism (#164688)\n\n## Summary\r\n\r\nOn some file
systems or volume mounts, `rename` is not supported and\r\nthrows a
`EXDEV` error, which breaks our file rolling.\r\n\r\nThis PR addresses
it by defaulting to `copy` + `unlink` if the `rename`\r\ncalls fails
with an `EXDEV` error.\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"d16594f266c962efeb6e44c64c7bc2089efddcb9"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164688","number":164688,"mergeCommit":{"message":"RollingFileAppender:
fix file moving mechanism (#164688)\n\n## Summary\r\n\r\nOn some file
systems or volume mounts, `rename` is not supported and\r\nthrows a
`EXDEV` error, which breaks our file rolling.\r\n\r\nThis PR addresses
it by defaulting to `copy` + `unlink` if the `rename`\r\ncalls fails
with an `EXDEV` error.\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"d16594f266c962efeb6e44c64c7bc2089efddcb9"}}]}]
BACKPORT-->

Co-authored-by: Pierre Gayvallet <pierre.gayvallet@elastic.co>
2023-08-24 08:08:30 -07:00
Kibana Machine
4450bf5b1c
[8.10] [Flaky test #90578] Unskip test (#163696) (#164711)
# Backport

This will backport the following commits from `main` to `8.10`:
- [[Flaky test #90578] Unskip test
(#163696)](https://github.com/elastic/kibana/pull/163696)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alejandro Fernández
Haro","email":"alejandro.haro@elastic.co"},"sourceCommit":{"committedDate":"2023-08-24T13:02:34Z","message":"[Flaky
test #90578] Unskip test (#163696)\n\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"ba843882a7bb35aa3062efd6562ed85d5db157f4","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","technical
debt","release_note:skip","Team:SharedUX","backport:prev-minor","v8.11.0"],"number":163696,"url":"https://github.com/elastic/kibana/pull/163696","mergeCommit":{"message":"[Flaky
test #90578] Unskip test (#163696)\n\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"ba843882a7bb35aa3062efd6562ed85d5db157f4"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/163696","number":163696,"mergeCommit":{"message":"[Flaky
test #90578] Unskip test (#163696)\n\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"ba843882a7bb35aa3062efd6562ed85d5db157f4"}}]}]
BACKPORT-->

Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
2023-08-24 07:18:32 -07:00
Kibana Machine
bb8a4a09e7
[8.10] [HTTP] Allow for internal requests to also specify special query param elasticInternalOrigin (#163796) (#164278)
# Backport

This will backport the following commits from `main` to `8.10`:
- [[HTTP] Allow for internal requests to also specify special query
param `elasticInternalOrigin`
(#163796)](https://github.com/elastic/kibana/pull/163796)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jean-Louis
Leysens","email":"jeanlouis.leysens@elastic.co"},"sourceCommit":{"committedDate":"2023-08-21T09:55:33Z","message":"[HTTP]
Allow for internal requests to also specify special query param
`elasticInternalOrigin` (#163796)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/163678\r\n\r\n* Raise the
notion of \"internal\" into `CoreKibanaRequest`. This enables\r\nus to
share this with lifecycle handlers and control validation of
query\r\nparams\r\n* Added new `isInternalRequest` alongside
`isSystemRequest` and\r\n`isFakeRequest`\r\n* Slight simplification to
existing internal restriction check\r\n* Some other chores and minor
fixes\r\n\r\n## Test\r\n\r\n* Start ES with `yarn es serverless` and
Kibana with `yarn start\r\n--serverless
--server.restrictInternalApis=true`\r\n* Add the service account token
to `kibana.dev.yml`:\r\n`elasticsearch.serviceAccountToken: <SAT>`\r\n*
Send a request to an internal endpoint like: `curl
-XPOST\r\n-uelastic:changeme
http://localhost:5601/<base-path>/api/files/find -H\r\n'kbn-xsrf: foo'
-H 'content-type: application/json' -d '{}'`\r\n * Should give you a 400
result\r\n* message like `{\"statusCode\":400,\"error\":\"Bad
Request\",\"message\":\"uri\r\n[http://localhost:5603/api/files/find]
with method [post] exists but is\r\nnot available with the current
configuration\"}`\r\n* Send the same request, but include the query
param:\r\n`elasticInternalOrigin=true`\r\n * Should give you a 200
result\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"23d39555e0d0fc36c760f0c148913db69749cb47","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:http","Team:Core","release_note:skip","v8.10.0","v8.11.0"],"number":163796,"url":"https://github.com/elastic/kibana/pull/163796","mergeCommit":{"message":"[HTTP]
Allow for internal requests to also specify special query param
`elasticInternalOrigin` (#163796)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/163678\r\n\r\n* Raise the
notion of \"internal\" into `CoreKibanaRequest`. This enables\r\nus to
share this with lifecycle handlers and control validation of
query\r\nparams\r\n* Added new `isInternalRequest` alongside
`isSystemRequest` and\r\n`isFakeRequest`\r\n* Slight simplification to
existing internal restriction check\r\n* Some other chores and minor
fixes\r\n\r\n## Test\r\n\r\n* Start ES with `yarn es serverless` and
Kibana with `yarn start\r\n--serverless
--server.restrictInternalApis=true`\r\n* Add the service account token
to `kibana.dev.yml`:\r\n`elasticsearch.serviceAccountToken: <SAT>`\r\n*
Send a request to an internal endpoint like: `curl
-XPOST\r\n-uelastic:changeme
http://localhost:5601/<base-path>/api/files/find -H\r\n'kbn-xsrf: foo'
-H 'content-type: application/json' -d '{}'`\r\n * Should give you a 400
result\r\n* message like `{\"statusCode\":400,\"error\":\"Bad
Request\",\"message\":\"uri\r\n[http://localhost:5603/api/files/find]
with method [post] exists but is\r\nnot available with the current
configuration\"}`\r\n* Send the same request, but include the query
param:\r\n`elasticInternalOrigin=true`\r\n * Should give you a 200
result\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"23d39555e0d0fc36c760f0c148913db69749cb47"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/163796","number":163796,"mergeCommit":{"message":"[HTTP]
Allow for internal requests to also specify special query param
`elasticInternalOrigin` (#163796)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/163678\r\n\r\n* Raise the
notion of \"internal\" into `CoreKibanaRequest`. This enables\r\nus to
share this with lifecycle handlers and control validation of
query\r\nparams\r\n* Added new `isInternalRequest` alongside
`isSystemRequest` and\r\n`isFakeRequest`\r\n* Slight simplification to
existing internal restriction check\r\n* Some other chores and minor
fixes\r\n\r\n## Test\r\n\r\n* Start ES with `yarn es serverless` and
Kibana with `yarn start\r\n--serverless
--server.restrictInternalApis=true`\r\n* Add the service account token
to `kibana.dev.yml`:\r\n`elasticsearch.serviceAccountToken: <SAT>`\r\n*
Send a request to an internal endpoint like: `curl
-XPOST\r\n-uelastic:changeme
http://localhost:5601/<base-path>/api/files/find -H\r\n'kbn-xsrf: foo'
-H 'content-type: application/json' -d '{}'`\r\n * Should give you a 400
result\r\n* message like `{\"statusCode\":400,\"error\":\"Bad
Request\",\"message\":\"uri\r\n[http://localhost:5603/api/files/find]
with method [post] exists but is\r\nnot available with the current
configuration\"}`\r\n* Send the same request, but include the query
param:\r\n`elasticInternalOrigin=true`\r\n * Should give you a 200
result\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"23d39555e0d0fc36c760f0c148913db69749cb47"}},{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jean-Louis Leysens <jeanlouis.leysens@elastic.co>
2023-08-21 10:01:39 +00:00
Jean-Louis Leysens
a00c2401e2
[HTTP] Add build number to headers so that we can identify UIs (#163577)
Close https://github.com/elastic/kibana/issues/162332

### List

- [x] Add E2E test

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-08-16 16:05:57 +02:00
Sander Philipse
d5a3ed1dee
[Serverless] Add deployment URL (#163925)
## Summary

This adds a link to the concrete project in Serverless ES3. We can't
link to performance directly because that has been descoped for now.
2023-08-15 18:31:22 +02:00
Trevor Pierce
83d9644b74
Upgrade EUI to v86.0.0 (#163088)
`85.1.0` ➡️ `86.0.0`

⚠️ The biggest change in this PR is migrating the `react-beautiful-dnd`
dependency to it's open-source forked successor, `@hello-pangea/dnd`.
This new fork has better typescript support and additionally supports
both React 17 and React 18.

## [`86.0.0`](https://github.com/elastic/eui/tree/v86.0.0)

- Added React 18 support (StrictMode not yet supported).
([#7012](https://github.com/elastic/eui/pull/7012))

**Deprecations**

- Deprecated `euiPaletteComplimentary`; Use `euiPaletteComplementary`
instead. ([#6992](https://github.com/elastic/eui/pull/6992))

**Breaking changes**

- Replaced the underlying drag-and-drop library from
`react-beautiful-dnd` to its fork `@hello-pangea/dnd`
([#7012](https://github.com/elastic/eui/pull/7012))
([#7012](https://github.com/elastic/eui/pull/7012))
- No code updates are needed if using only `<EuiDragDropContext>`,
`<EuiDroppable>` and `<EuiDraggable>` with no direct imports from
`react-beautiful-dnd`. In case you were importing things from
`react-beautiful-dnd` and using them together with EUI components, you
need to switch to `@hello-pangea/dnd` which has cross-compatible API.

---------

Co-authored-by: Tomasz Kajtoch <tomasz.kajtoch@elastic.co>
Co-authored-by: Tomasz Kajtoch <tomek@kajto.ch>
Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
Co-authored-by: Drew Tate <andrew.tate@elastic.co>
2023-08-14 15:45:09 -05:00
Anton Dosov
57c17c4927
[Serverless] Fix sidenav responsiveness (#163700)
## Summary

I was not sure if there are other plans for these stats, but I went
ahead and cleaned those up:

### Issue 1. Sidenav groups are collapsed on a smaller screen 

#### Before 

![Screenshot 2023-08-11 at 11 28
54](a3202f96-05c2-4792-8e9e-a25ea5e471cf)

#### After 

<img width="1456" alt="Screenshot 2023-08-11 at 14 13 23"
src="3e52d05f-12fa-4d38-addb-538239e7d8d1">

### Issue 2. Collapsed sidenav state is empty 

We reserved this for icons, but until we have them, I think it makes
sense to just hide the bar:

#### Berfore

![Screenshot 2023-08-11 at 11 29
01](e8f5f474-15c5-46d1-95cc-c2580d3c7050)


#### After

<img width="1456" alt="Screenshot 2023-08-11 at 14 14 35"
src="99adadb4-637b-404b-9909-fe7e78e0224e">


### Issue 3. Navigation is not initialized when Kibana loaded with
hidden navigation

We initialize the navigation as we render the nav tree (the sidenav).
But if the sidenav is hidden, then the navigation is not initialized.
**So, for example, breadcrumbs are not displayed correctly until the nav
is opened.** As a hack, we will always render the tree, but will make it
hidden.

#### Before 

<img width="1296" alt="Screenshot 2023-08-11 at 14 35 14"
src="499e4a97-b5c3-405d-968b-bae753f15b99">


#### After 

<img width="1296" alt="Screenshot 2023-08-11 at 14 34 37"
src="ae51dea4-8d98-40f6-b3bc-c4d5df8e97fa">
2023-08-11 19:50:05 +02:00
Robert Oskamp
fd08c62f05
Adjust global loading indicator data-test-subj for projects (#163697)
## Summary

This PR adjusts the `data-test-subj` for the global loading indicator in
serverless projects such that at matches the stateful version. This
makes sure that functional tests and corresponding test helper methods
continue to work the same in stateful and serverless environments when
comes to waiting for global loading to finish, which is a key mechanism
to avoid test flakiness.

### Additional information

- The serverless project specific global loading indicator was
introduced with #158523
- The stateful loading indicator `data-test-subj` naming is implemented
here:
https://github.com/elastic/kibana/blob/main/packages/core/chrome/core-chrome-browser-internal/src/ui/loading_indicator.tsx#L61

Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
2023-08-11 10:40:26 -07:00
Tim Sullivan
24655504af
[Serverless/Chrome] App menu bar fixes (#162002)
## Summary

Closes https://github.com/elastic/kibana/issues/161889
Closes https://github.com/elastic/kibana/issues/162935

This PR gives the correct look and feel to the app menu bar.

1. The bar appears to the right of the side panel
2. The bar has fixed position below the fixed EuiHeader
3. Page content flows after the the bar

### Testing
1. Run `yarn es snapshot` in a terminal pane
2. Run `yarn serverless` in another pane
3. Log into the Kibana UI and check different forms of the menu bar
4. Use the dev-project switcher to test other solution projects
5. Test with a header banner:
    ```
    #!/bin/bash
    HOST=http://elastic:changeme@localhost:5601
    curl -X POST "$HOST/internal/kibana/settings" \
     -H 'kbn-xsrf: true' \
     -H 'X-Elastic-Internal-Origin: Kibana' \
     -H 'Content-Type: application/json' \
     -d '{
       "changes": {
         "banners:placement": "top",
"banners:textContent": "Prefix. **SIMPLE BANNER MESSAGE CONTENT**.
Suffix."
       }
     }'
    ```
    Set `banners:placement` to `null` to turn off the header banner.

**Known issue:** in some Observability project pages, the app menu bar
may appear as an empty div. This is explained in the [serverless project
layout
documentation](https://docs.elastic.dev/kibana-dev-docs/serverless-project-navigation#header-action-menu):
> **Note** The display of the toolbar container is conditional, based on
whether there is toolbar content to show. Make sure to pass undefined to
setHeaderActionMenu if there is no application content to show. In
classic layout, passing an empty span or div element suffices to "clear"
the toolbar, but in serverless projects it will cause a large empty
container to show below the header.

### Screenshots
_Will not be updated past a5222e428814c9d2211f4c14fe160dbea93f3e1b_

| |  |
|---|---| 
| **Project layout in Observability app** |
9fb8f57a-3de9-49e8-9d6d-d10fa83a3c83
|
| **Project layout in Observability app w/ header banner** |
19a0bf68-0df7-4f08-b987-125abe9e5680
|
| **Project layout in Security app** |
af1940fa-9d48-48a4-b675-0b3c8bcffc39
|
| **Project layout in Security app w/ header banner** |
d962952a-1d21-4bb3-8992-cafe4aed82a4
|

### Checklist

Delete any items that are not applicable to this PR.

- [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
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-08-10 19:45:49 -07:00
Sébastien Loix
5e0e4487b8
[Serverless Chrome] Fix fullscreen (#163317) 2023-08-10 09:08:22 +01:00
Anton Dosov
6bec8e41f8
[Serverless] Fix Dashboard breadcrumbs missing title (#163393)
## Summary

fix https://github.com/elastic/kibana/issues/163337 for dashboard. 


### Context: 

In serverless navigation we changed how breadcrumbs work. Instead of
setting the full path manually, we automatically calculate the main
parts of the path from the side nav + current URL. This was done to keep
side nav and breadcrumbs in sync as much as possible and solve
consistency issues with breadcrumbs across apps.
https://docs.elastic.dev/kibana-dev-docs/serverless-project-navigation#breadcrumbs

Apps can append custom deeper context using the
`serverless.setBreadcrumbs` api. Regular `core.chrome.setBreadcrumbs`
has no effect when serverless nav is rendered.
2023-08-08 09:20:21 -07:00
Anton Dosov
1047eef005
Update Project Selection in Serverless Top Navigation (#163076)
## Summary

close https://github.com/elastic/kibana/issues/163014

- Changing `My Deployments -> Projects`
- Removing hardcoded url and passing one from the config
2023-08-07 16:18:35 +02:00
Cee Chen
f2b07fc47d
[regression] Handle deprecated KibanaThemeProvider uses to include KibanaRenderContextProvider (#163103)
## Summary

Unfortunately, #161914 regressed #162365 in that many plugins and their
Emotion styles (including EUI emotion styles) are now missing a cache
and are being appended to to the end of the document `<head>` as opposed
to within `<meta name="emotion">`.

What appears to be happening is many plugins are using a parent
`<KibanaThemeProvider>` but **not** a parent
`<KibanaRootContextProvider>` (not sure if this work is TBD or in
progress). This means that a parent `<EuiProvider>`, (which determines
the cache insertion of child Emotion styled components) is missing,
which is causing several CSS specificity bugs, e.g. around datagrid.

As a somewhat-bandaid-y fix, I've bogarted EUI's nested provider context
to check if the theme provider has a parent `EuiProvider`, and if it
doesn't, to use `KibanaEuiProvider` instead of `KibanaThemeProvider`.
This should set up the caches and context if needed, or otherwise simply
use the original `KibanaThemeProvider` component.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>
2023-08-04 09:11:31 -07:00
Tim Sullivan
2c6fd26f5e
[Serverless] Make project header component handle chrome visibility changes (#162746)
## Summary
Closes https://github.com/elastic/kibana/issues/160834

This PR fixes a bug with the Dashboard app in serverless projects. The
Dashboard has a "Full screen" button that is intended to cause the
content area of the dashboard take up the entire viewport. To do this,
the dashboard app uses a chrome service to update an observable used in
the rendering of the header, which sets the layout to a "chromeless"
state. The bug is: in serverless, the project header must respect the
chromeless state.

### Testing

1. Run `yarn es snapshot` in one terminal and then `yarn serverless` in
another terminal.
2. Load sample data through the "Integrations" app, which can be found
in Global Search.
3. View a sample data dashboard, and use the `Full screen` button in the
app menu toolbar.

### Checklist

- [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

---------

Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
2023-08-02 14:08:30 -07:00
Kurt
7770ccc19f
Removing 'showNavLinks' config option and displaying Avatar menu for serverless (#162140)
## Summary

Closes https://github.com/elastic/kibana/issues/160141

The avatar menu needs to be displayed for serverless. It was previously
required to be hidden in serverless, so a config 'showNavLinks' was
added. This config is no longer needed, so it has been removed.

## Testing

Start KB with the `--serverless` flag and login as `elastic`.

The Avatar should appear in the top right coner.
2023-07-31 16:31:37 -04:00
Pierre Gayvallet
cf285a71da
[ZDT] Add documentation on the update / backfill edge case (#162683) 2023-07-28 11:01:43 -07:00
Clint Andrew Hall
477505a2dd
[context] Unify Contexts, deprecate others (#161914)
> Pre-req for https://github.com/elastic/kibana/issues/56406

## Summary

We've had a long-standing problem in Kibana around our use of React
context, particularly with EUI and i18n. There hasn't existed an
idempotent context structure, and that has lead to a lot of unexpected
results, (e.g. missing translations, inconsistent dark mode, excess
context providers, etc).

The biggest change coming from this PR is knowing exactly which provider
to use in a particular use case. This means, for example,
`ReactDOM.render` calls won't be missing `i18n` or `theme` due to a
missing context. It also allows consumers to use `darkMode` without
having to read the `uiSetting` themselves, instead allowing the context
to do it for them.

We also haven't been honoring the intended [`EuiProvider`
API](https://eui.elastic.co/#/utilities/provider#theming-and-global-styles)...
in some cases we've been creating and re-creating the Emotion caches,
often by copy/paste of the cache code. We've also been nesting
`EuiThemeProvider` contexts unnecessarily-- thinking we need to render a
theme provider in an isolated component-- which renders an additional
`span` element into the DOM.

This PR attempts to address this inconsistency by creating a set of
context providers divided by use case:


![diagram](e01c6296-1b7a-4639-ae96-946866950efe)

### `KibanaRootContextProvider`
A root context provider for Kibana. This is the top level context
provider that wraps the entire application. It is responsible for
initializing all of the other contexts and providing them to the
application. It's provided as a package for specific use cases, (e.g.
the `RenderingService`, cases where we replace the entire page content,
Storybook, testing, etc), but not intended for plugins.

### `KibanaRenderContextProvider`
A render context provider for Kibana. This context is designed to be
used with ad-hoc renders of React components, (usually with
`ReactDOM.render`).

### `KibanaThemeContextProvider`
A theme context provider for Kibana. A corollary to EUI's
`EuiThemeProvider`, it uses Kibana services to ensure the EUI Theme is
customized correctly.

### (deprecated) `KibanaStyledComponentsThemeProvider`
A styled components theme provider for Kibana. This package is supplied
for compatibility with legacy code, but should not be used in new code.

## Deprecation strategy
This PR does *not* change any use of context by consumers. It maps the
existing contexts in `kibanaReact` to the new contexts, (along with the
loose API). This means that we won't have completely fixed all of our
dark mode issues yet. But this is necessary to keep this PR focused on
the change, rather than drawing in a lot of teams to review individual
uses.

We should, however, see an immediate performance improvement in the UI
from the reduction in `EuiProvider` calls.

## Open questions
- [ ] Does it make sense to expose a `useTheme` hook from
`@kbn/react-kibana-context-theme` to replace `useEuiTheme`?

## Next steps
- [ ] Update deprecated uses to new contexts.
- [ ] Audit and update calls to `ReactDOM.render`.
- [ ] Add ESLint rule to warn for use of EUI contexts.
- [ ] Delete code from `kibanaReact`.
2023-07-28 09:30:08 -07:00
Thomas Watson
d213ed274c
Upgrade ESLint React plugins (#162464) 2023-07-28 10:43:53 +02:00
Alex Szabo
a487ad77bd
[SharedUX] Merge similar toast messages in case of a toast-flood/storm (#161738)
## Summary
This PR addresses the occasional toast-floods/toast-storms with a simple
catch mechanism: deduplicate/group toasts by their broad alikeness,
their text and title.

This implementation plugs in to the `global_toast_list.tsx` in Kibana's
GlobalToastList component, capturing updates on the toast update stream,
and collapses toasts before passing them further to the downstream EUI
Toast list react components.

The core idea is to not display notifications directly, but to keep the
toast notifications apart from their visual representation. This way, we
can represent more notifications with one toast on our end, if we group
rightly. The only issue then, is to clean up everything nicely when it's
time. For this we're also exporting a mapping that shows which toast ID
represents which grouped toasts.

I also changed the type `ToastInputFields` to accept rendered react
components as title/text - this will prevent attempts to unmount react
components from elements that are not displayed, thus causing React
warnings.

The close-all button is an EUI feature, which we've started discussing
[here](https://github.com/elastic/eui/issues/6945), probably not part of
this PR.

## What toasts get merged?
The exact merging strategy was not settled, and it's kind of a valve,
where we trade off potential detail lost in toasts for the prevented
noise in the toast floods. The current strategy is as folows:
```
 * These toasts will be merged:
 *  - where title and text are strings, and the same (1)
 *  - where titles are the same, and texts are missing (2)
 *  - where titles are the same, and the text's mount function is the same string (3)
 *  - where titles are missing, but the texts are the same string (4)
``` 
The base merge case is `(1) & (2)`, after some discussion with @Dosant
we decided to include (3) as a compromise, where we're still merging
somewhat similar toasts, and extend the merging to `ToastsApi::addError`
where all error toasts have a MountPoint as their text. We understand
this might hide some details (e.g.: same titles, but very slightly
different MountPoints as their text) but realistically this shouldn't
really happen.

The ultimate future improvement will be (as suggested in the comments by
@jloleysens) a sort of identifier to the toast, based on which we can
group without fear of losing information. But this will require more
work on all the call-sites.
 
Relates to: #161482 


![1ca12f39-75af-4d24-8906-9f27fad33c45](b4578f2e-756d-40d0-9d24-fdffe8b9c724)


### Checklist

Delete any items that are not applicable to this PR.

- [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

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-27 16:05:01 +02:00
Alex Szabo
8cf68dc6ba
[Ops] Bump Node.js to version 18 (#160289)
## Summary

Bumps node.js to 18.17.0 (replacement for PR #144012 which was later
reverted)

As a result, these categorical additions were needed: 
- `node` evocations will need the `--openssl-legacy-provider` flag,
wherever it would use certain crypto functionalities
- tests required updating of the expected HTTPS Agent call arguments,
`noDelay` seems to be a default
 - `window.[NAME]` fields cannot be written directly
 - some stricter typechecks

This is using our in-house built node.js 18 versions through the URLs
the proxy-cache. (built with
https://github.com/elastic/kibana-custom-nodejs-builds/pull/4)

These urls are served from a bucket, where the RHEL7/Centos7 compatible
node distributables are. (see:
https://github.com/elastic/kibana-ci-proxy-cache/pull/7)

Further todos: 
 - [x] check docs wording and consistency
 - [ ] update the dependency report
 - [x] explain custom builds in documentation
 - [x] node_sass prebuilts

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
Co-authored-by: Thomas Watson <w@tson.dk>
2023-07-27 14:12:48 +02:00
Jean-Louis Leysens
32b5903f92
[HTTP] First pass of making Kibana work with internal restrictions enforced (#162258)
## Summary

When turning on `server.restrictInternalApis` a number of issues
surfaced due to defaulting to internal resulting in `400`s for:

* HTTP resources
* Static assets via `registerStaticDir`
* Use of `res.render(Html|Js|Css)` outside of HTTP resources

This PR:

* defaults our HTTP resources service to register routes by default
`public`, same for static dirs.
* Did an audit of all renderX usages, if outside of HTTP resources I
added an explicit `access: public`
* ...what else?

### Set `access: 'public'` for known set of "system" routes

Method | Path | Comment
-- | -- | --
GET | /api/status
GET | /api/stats
GET | /translations/{locale}.json
GET | /api/fleet/agent_policies
GET | /api/task_manager/_background_task_utilization
GET | /internal/task_manager/_background_task_utilization
GET | /internal/detection_engine/health/_cluster
POST | /internal/detection_engine/health/_cluster
GET | /internal/detection_engine/health/_space
POST | /internal/detection_engine/health/_space
POST | /internal/detection_engine/health/_rule
POST | /internal/detection_engine/health/_setup
GET	| /bootstrap.js
GET	| /bootstrap-anonymous.js
GET	| \*\*/bundles/\* | Core's routes for serving JS & CSS bundles



## How to test

Run this PR with `kibana.dev.yml` containing
`server.restrictInternalApis: true` and navigate around Kibana UI
checking that there are no `400`s in the network resources tab due to
access restrictions.

## Notes

* Either left a comment about why `access` was set public or a simple
unit test to check that we are setting access for a given route

## To do

- [x] Manually test Kibana
- [x] Manually test with `interactiveSetup` plugin
- [ ] Add integration and e2e test (will do in a follow up PR) 

Related: https://github.com/elastic/kibana/pull/162149

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-26 14:48:06 +02:00
Cee Chen
ca9b4d0f35
[Emotion] Order EUI's CSS utilities after Sass styles (#162365)
## Summary

Follow up to https://github.com/elastic/kibana/pull/161592

Some remaining EUI components that are still in Sass unfortunately need
to respect EUI's global CSS utilities (e.g. `.eui-yScroll`,
`.eui-textTruncate` - [full list
here](https://elastic.github.io/eui/#/utilities/css-utility-classes)).
Creating a separate utilities cache and insertion point should solve the
CSS order/specificity issues.

### Checklist

- [x] Confirm Emotion output order is expected in head (EUI globals, All
Emotion styles, Sass styles, then utilities last)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-25 10:37:29 -07:00
Jean-Louis Leysens
492cfdfe3a
[HTTP] Only allow setting server.restrictInternalApis on serverless (#162475) 2023-07-25 17:56:56 +02:00
Anton Dosov
c76b185323
[uiSettings] use refresh: false instead of default refresh: 'wait_for' in create and update (#160278)
## Summary

Close https://github.com/elastic/kibana/issues/159662

See explanation [here](https://github.com/elastic/kibana/issues/159662)
2023-07-25 04:21:28 -07:00
Pierre Gayvallet
08c8b3d7ff
[ZDT] document behavior of the fields find option for serverless (#162404)
## Summary

Fix https://github.com/elastic/kibana/issues/153766

Add documentation on the limitation of using the `fields` option of the
`SOR.find` API on managed environments.
2023-07-25 08:26:28 +02:00
Marco Antonio Ghiani
9bae853586
[Logs+] Add Log Explorer profile deep link (#161939)
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: weltenwort <stuermer@weltenwort.de>
2023-07-24 21:23:58 +02:00
Pierre Gayvallet
ab486aff05
[Env] Add buildFlavor to package info (#161930)
## Summary

Add a `buildFavor` property to `Env` (accessible from the plugin's
initializer context), Mimicking the idea of ES's `version.buildFlavor`
field.

Note: this is not supposed to be a replacement for feature flags, but
can be useful when wanting to toggle features based on actual
capabilities of our serverless product. Also, we already expose this
value through the configuration via the `serverless` context value, so
it now adds another way to access the information.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-20 03:33:28 -07:00
Anton Dosov
f6e6b77efc
[Serverless] Add navigation functional tests (#161856)
## Summary

close https://github.com/elastic/kibana/issues/160011

This PR adds helpers for testing serverless specific navigation. There
are helpers for sidenav, breadcrumbs, global search, recent items, logo,
checking that no page reload happened during nav.

This PR also adds some serverless specific navigation tests. The should
serve as a navigation smoke check and testing helpers example. Solution
teams can improve them as they see fit.
2023-07-18 17:31:19 +02:00
Sébastien Loix
209d35365f
[Serverless nav] Update footer + project settings cloud links (#161971) 2023-07-18 08:39:14 -05:00
Aleh Zasypkin
303575544a
Updates header filters for request logs. (#162062)
## Summary

Updates
[header](https://www.elastic.co/guide/en/elasticsearch/reference/master/jwt-auth-realm.html#hmac-oidc-example-request-headers)
filters for request logs.

/cc @elastic/kibana-security
2023-07-18 10:56:07 +02:00
Patryk Kopyciński
b2b7cf6253
Bump jest@29.6.1 (#161630)
## Summary

Bump `jest@29.6.1` and resolve duplicated jest-related dependencies

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-15 17:42:30 +02:00
Cee Chen
fc9ac7a9c9
Upgrade EUI to v84.0.0 (#161716)
## Summary

`eui@83.1.0`  `eui@84.0.0`

---

## [`84.0.0`](https://github.com/elastic/eui/tree/v84.0.0)

- Updated `EuiDualRange`'s `minInputProps` and `maxInputProps` to
support passing more props to underlying inputs
([#6902](https://github.com/elastic/eui/pull/6902))
- `EuiFocusTrap` now supports configuring cross-iframe focus trapping
via the `crossFrame` prop
([#6908](https://github.com/elastic/eui/pull/6908))

**Bug fixes**

- Fixed `EuiFilterButton` icon display
([#6900](https://github.com/elastic/eui/pull/6900))
- Fixed `EuiCombobox` compressed plain text display
([#6910](https://github.com/elastic/eui/pull/6910))
- Fixed visual appearance of collapse buttons on collapsible
`EuiResizablePanel`s ([#6926](https://github.com/elastic/eui/pull/6926))

**Breaking changes**

- `EuiFocusTrap` now defaults to *not* trapping focus across iframes
([#6908](https://github.com/elastic/eui/pull/6908))

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-14 11:16:49 -07:00
Elena Stoeva
41056193d9
[Serverless] Add internal uiSettings routes and expose public routes in self-managed only (#160499)
Partially addresses https://github.com/elastic/kibana/issues/159590

## Summary

This PR adds an an internal uiSettings API that is a duplicate of the
public API and is intended for use by the browser-side uiSettings
client.

The PR also adds a config settings that is configured in serverless
context only and exposes the public uiSettings routes based on the value
of this setting (it defaults to false since we don't want to expose the
public routes in serverless).

**How to test:**

I. Verify that in serverless the internal routes are exposed but the
public ones aren't:
1. Start Es with `yarn es snapshot` and Kibana with `yarn
serverless-{mode}` where `{mode}` can be `es`, `oblt`, or `security`
(the public routes should be disabled for all projects).
2. Verify that the public endpoints are not accessible. For example,
`curl --user elastic:changeme
'http://localhost:5601/zhb/api/kibana/settings' -X 'GET'` should return
`{"statusCode":404,"error":"Not Found","message":"Not Found"}`.
3. Verify that the internal endpoints are accessible. For example, `curl
--user elastic:changeme
'http://localhost:5601/zhb/internal/kibana/settings' -X 'GET'` should
return
`{"settings":{"buildNum":{"userValue":9007199254740991},"isDefaultIndexMigrated":{"userValue":true},"defaultRoute":{"isOverridden":true,"userValue":"/app/elasticsearch"}}}`


II. Verify that the both public and internal routes are exposed in
self-managed:
1. Start Es with `yarn es snapshot` and Kibana with `yarn start`
2. Verify that the public endpoints are accessible. For example, `curl
--user elastic:changeme 'http://localhost:5601/zhb/api/kibana/settings'
-X 'GET'` should return
`{"settings":{"buildNum":{"userValue":9007199254740991},"isDefaultIndexMigrated":{"userValue":true}}}`
3. Verify that the internal endpoints are accessible. For example, `curl
--user elastic:changeme
'http://localhost:5601/zhb/internal/kibana/settings' -X 'GET'` should
return
`{"settings":{"buildNum":{"userValue":9007199254740991},"isDefaultIndexMigrated":{"userValue":true}}}`

III. Verify that the plugins/services that consume the internal
uiSettings endpoints work as expected in both self-managed and
serverless environment.

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-14 15:53:17 +01:00
Kurt
e5bcc87202
Fixing theme tag issue and adding more testing (#161910)
## Summary

Fixing calculated theme tags. An issue found was in the bootstrap
renderer when User Profile's Theme was set to 'Light' and Adv. Setting's
Theme was set to 'Dark'.

In my original PR, I had originally had the UserSettings > darkMode be a
string ('', 'light', 'dark'), but changed it to a boolean | undefined
and the conditional no longer worked.

This should fix a number of sporadic darkmode issues
2023-07-14 08:03:51 -04:00
Pierre Gayvallet
37b48d344f
[root] only shutdown once (#161869)
## Summary

Analyzing the MKI QA logs, I discovered that errors encountered during
shutdown were effectively triggering a second shutdown process, making
the logs unclear:

<img width="1564" alt="Screenshot 2023-07-13 at 16 07 22"
src="8d718a99-2187-4fa3-b6f6-9c3f0e7a3925">

it has the side effect to also make "normals" shutdown (e.g via SIGINT
like in the screenshot) to appear as error shutdowns because of the
error thrown during the shutdown.

This PR addresses it, by making sure that `Root` only shutdown once.
Errors occurring during the shutdown will be appearing in the logs, but
they will not surface as the cause of the shutdown (no `FATAL` log
entry).
2023-07-14 11:41:49 +02:00
Cee Chen
28e2d6dc70
[Core][Chrome] Fix misaligned header logo (#161812)
## Summary

### Problem

The `HeaderLogo` being used by Kibana's nav isn't actually using the
`<EuiHeaderLogo>` component, it's instead a completely custom logo that
happens to bogart `EuiHeaderLogo`'s CSS styles. When `EuiHeaderLogo` was
recently converted from Sass to Emotion, any styles attached to that CSS
completely disappeared, hence the misaligned appearance below:

### Before
<img width="432" alt=""
src="f28e870c-e407-4c8b-b144-dd65fb27708d">

### After
<img width="443" alt=""
src="8c3ab23d-f942-4473-b7d5-c8c558933eb9">

### Solution

I opted to resolve the bug with the following interim steps:

1. Remove the `euiHeaderLogo` className - it isn't doing anything, and
this isn't an EuiHeaderLogo, so it might as well go
2. Add a `chrHeaderLogo` className (based on the className of a nearby
child element) and reinstate the most relevant CSS (flex alignment and
layout) needed to restore the logo visual behavior

Long-term, fixing `HeaderLogo` to use `EuiHeaderLogo` (this will require
updating `EuiHeaderLogo` to facilitate loading behavior and non-text
children) is probably the better solution, instead of making Kibana use
its own custom logo component.

### Checklist

- [x] Snapshots ~[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
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
2023-07-13 12:00:49 -07:00
Cee Chen
b9eae62b5d
Order Emotion styles before Sass styles (#161592)
## Summary

fixes https://github.com/elastic/kibana/issues/161441
fixes https://github.com/elastic/kibana/issues/161464

The recent `EuiButtonEmpty`/`EuiButtonIcon` Emotion conversions have
highlighted a CSS order/specificity flaw in Kibana compared to EUI - EUI
orders its Sass _after_ its Emotion styles (see
https://elastic.github.io/eui/#/), and Kibana orders Sass _before_
Emotion styles.

I'm not totally sure why Greg set up Kibana's style order the way he did
in https://github.com/elastic/kibana/pull/134919, but at this point, EUI
has enough of its baseline atom components converted to Emotion that
remaining components in Sass are all generally molecules or higher level
components that need to come after Emotion.

### QA

- [x] Test as many pages in Kibana as possible to ensure no visual
regressions 🤞

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-13 07:41:17 -07:00
Pierre Gayvallet
808c28dd8e
Migrate from deprecated EUI components (#161548)
## Summary

Fix https://github.com/elastic/kibana/issues/161424

Migrate away from deprecated EUI components for Core-owned code.

Note: I only tested the production (and examples) pages properly, I
didn't make sure the test plugins where displayed correctly, as long as
the data structure was still here for the tests to pass.

### Screenshots

#### Status page

<img width="1388" alt="Screenshot 2023-07-10 at 17 14 24" 

src="d15adffa-d4fb-4dab-ad91-691a4c103541">

#### AppNotFound page

<img width="1352" alt="Screenshot 2023-07-10 at 17 14 40"
src="77dcc958-db53-4ec8-9a7f-af4ea0804a96">

#### Generated plugin landing page

<img width="1906" alt="Screenshot 2023-07-10 at 17 15 44"
src="7a45d1a3-181d-44c5-a4a1-d3bdb2ba6ee9">

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-13 03:22:02 -07:00
Christiane (Tina) Heiligers
f022456ad8
[http] Default route access to internal (#161672) 2023-07-12 10:19:20 -07:00
Sébastien Loix
8b72a32c13
[Chrome left nav] Fix infinite loop (#161773) 2023-07-12 18:15:18 +01:00
Pierre Gayvallet
ea1e6ed240
[root] add more logs for bootstrap and shutdown (#161629)
## Summary

Looking at the logs, I realized we were not logging anything in `info`
level when Kibana is starting up or shutting down at the `Root` level,
making it quite awkward when trying to understand when an instance / pod
was started or shut down and even why. Also, we were not logging the
stack trace of the shutdown reason when present.

FWIW, this is (the exhaustive list of) what's displayed in some shutdown
scenarios (most recent to least recent):

<img width="1579" alt="Screenshot 2023-07-11 at 11 41 27"
src="a1a069d1-84ba-4124-aea4-298a70adac58">

As you can see:
1. We have no idea why Kibana was shut down
2. We don't know where this `no element in sequence` error even comes
from


This PR adds a few logs:
- `Kibana is starting` during `bootstrap`
- `Kibana is shutting down` during `shutdown`
- The shutdown reason's stack when provided
- `SIGINT received - initiating shutdown` and `SIGTERM received -
initiating shutdown` when receiving the associated signals
2023-07-12 11:01:06 +02:00
Trevor Pierce
e58c455c56
Upgrade EUI to 83.1.0 (#161490)
`eui@83.0.0`  `83.1.0`

---

## [`83.1.0`](https://github.com/elastic/eui/tree/v83.1.0)

- Added `placeholder` prop to `EuiInlineEdit`
([#6883](https://github.com/elastic/eui/pull/6883))
- Added `sparkles` glyph to `EuiIcon`
([#6898](https://github.com/elastic/eui/pull/6898))

**Bug fixes**

- Fixed Safari-only bug for single-line row `EuiDataGrid`s, where cell
actions on hover would overlap instead of pushing content to the left
([#6881](https://github.com/elastic/eui/pull/6881))
- Fixed `EuiButton` not correctly merging in passed `className`s with
its base `.euiButton` class
([#6887](https://github.com/elastic/eui/pull/6887))
- Fixed `EuiIcon` not correctly passing the `style` prop custom `img`
icons ([#6888](https://github.com/elastic/eui/pull/6888))
- Fixed multiple components with child props (e.g. `buttonProps`,
`iconProps`, etc.) unsetting EUI's Emotion styling if custom `css` was
passed to the child props object
([#6896](https://github.com/elastic/eui/pull/6896))

**CSS-in-JS conversions**

- Converted `EuiHeader` and `EuiHeaderLogo` to Emotion
([#6878](https://github.com/elastic/eui/pull/6878))
- Removed Sass variables `$euiHeaderDarkBackgroundColor`,
`$euiHeaderBorderColor`, and `$euiHeaderBreadcrumbColor`
([#6878](https://github.com/elastic/eui/pull/6878))
- Removed Sass mixin `@euiHeaderDarkTheme`
([#6878](https://github.com/elastic/eui/pull/6878))
2023-07-11 15:51:06 -05:00
Rodney Norris
5935c4312e
[Enterprise Search] rebrand ent-search Kibana nav category to Search (#161593)
## Summary

Updated the Kibana collapsible nav Enterprise Search category to Search.
Updated the App Search & Workplace Search app navLinkStatuses to
`hidden` to remove them from the Kibana nav.

### Screenshots
<img width="270" alt="image"
src="1397e701-ca87-46f2-8c15-565bc3a9202c">
2023-07-11 13:59:46 -05:00