Commit graph

3650 commits

Author SHA1 Message Date
elastic-renovate-prod[bot]
08b13c13c3
Update dependency @xstate5/react to ^5.0.3 2025-04-15 07:18:27 +00:00
elastic-renovate-prod[bot]
7419bc354c
Update dependency cytoscape to ^3.31.2 (main) (#217567)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [cytoscape](http://js.cytoscape.org)
([source](https://redirect.github.com/cytoscape/cytoscape.js)) |
dependencies | patch | [`^3.31.1` ->
`^3.31.2`](https://renovatebot.com/diffs/npm/cytoscape/3.31.1/3.31.2) |

---

### Release Notes

<details>
<summary>cytoscape/cytoscape.js (cytoscape)</summary>

###
[`v3.31.2`](https://redirect.github.com/cytoscape/cytoscape.js/releases/tag/v3.31.2)

[Compare
Source](https://redirect.github.com/cytoscape/cytoscape.js/compare/v3.31.1...v3.31.2)

Release version v3.31.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJiYWNrcG9ydDphbGwtb3BlbiIsInJlbGVhc2Vfbm90ZTpza2lwIl19-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Sergi Romeu <sergi.romeu@elastic.co>
2025-04-11 19:27:54 +02:00
Maryam Saeidi
a616a40f93
Update apm-rum packages (#217800)
## Summary 

Updating apm-rum packages mostly to use this feature:
https://github.com/elastic/apm-agent-rum-js/pull/1594


Changes

|Package|Previous version|Current version|Change log
([PR](https://github.com/elastic/apm-agent-rum-js/pull/1599/files))|
|---|---|---|---|
|@elastic/apm-rum|^5.16.3|^5.17.0|add support for adding labels to
captured errors
([#1594](https://github.com/elastic/apm-agent-rum-js/pull/1594))|
|@elastic/apm-rum-core|^5.22.1|^5.23.0|add support for adding labels to
captured errors
([#1594](https://github.com/elastic/apm-agent-rum-js/pull/1594))|
|@elastic/apm-rum-react|^2.0.5|^2.0.6|version bump only for package
@elastic/apm-rum-react|
2025-04-10 16:57:06 +02:00
Weronika Olejniczak
1204458d2a
Upgrade EUI to v101.3.0 (#217491)
`101.2.0`  `101.3.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Package updates

### `@elastic/eui`

#### [`v101.3.0`](https://github.com/elastic/eui/releases/v101.3.0)

- Updated 78 existing and added two new glyphs (`code` and
`checkCircle`) for `EuiIcon`
([#8530](https://github.com/elastic/eui/pull/8530))
- Changed `gutterSize` to `m` between right side items on
`EuiPageHeader` ([#8529](https://github.com/elastic/eui/pull/8529))

**Bug fixes**

- Fixed a visual bug on disabled `EuiButton` in high contrast mode where
wrong text colors were applied
([#8550](https://github.com/elastic/eui/pull/8550))
2025-04-09 08:05:42 +02:00
Dominique Clarke
9d56263413
[Chore] Remove Investigate plugin, Investigate app plugin, and Investigation-schema package (#216342)
## Summary

Removes unused code from the Investigate and Investigate app plugin.

Removes all references to those plugins in storybook, i18n, types, etc.

Removes codeowner requirements for those plugins

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-08 12:25:21 -04:00
elastic-renovate-prod[bot]
1db06dc93c
Update dependency @launchdarkly/node-server-sdk to ^9.7.7 (main) (#216931)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[@launchdarkly/node-server-sdk](https://redirect.github.com/launchdarkly/js-core/tree/main/packages/sdk/server-node)
([source](https://redirect.github.com/launchdarkly/js-core)) |
dependencies | patch | [`^9.7.6` ->
`^9.7.7`](https://renovatebot.com/diffs/npm/@launchdarkly%2fnode-server-sdk/9.7.6/9.7.7)
|

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkNvcmUiLCJUZWFtOlNlY3VyaXR5IiwiYmFja3BvcnQ6cHJldi1taW5vciIsInJlbGVhc2Vfbm90ZTpza2lwIl19-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-04-08 03:02:06 +02:00
elastic-renovate-prod[bot]
ae433cd0a3
Update dependency @redocly/cli to ^1.34.1 (main) (#217267)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@redocly/cli](https://redirect.github.com/Redocly/redocly-cli) |
devDependencies | patch | [`^1.34.0` ->
`^1.34.1`](https://renovatebot.com/diffs/npm/@redocly%2fcli/1.34.0/1.34.1)
|
| [@redocly/cli](https://redirect.github.com/Redocly/redocly-cli) |
dependencies | patch | [`^1.34.0` ->
`^1.34.1`](https://renovatebot.com/diffs/npm/@redocly%2fcli/1.34.0/1.34.1)
|

---

### Release Notes

<details>
<summary>Redocly/redocly-cli (@&#8203;redocly/cli)</summary>

###
[`v1.34.1`](https://redirect.github.com/Redocly/redocly-cli/releases/tag/%40redocly/cli%401.34.1)

[Compare
Source](https://redirect.github.com/Redocly/redocly-cli/compare/@redocly/cli@1.34.0...@redocly/cli@1.34.1)

##### Patch Changes

-   Improved OpenTelemetry data serialization.
- Updated
[@&#8203;redocly/respect-core](https://redirect.github.com/redocly/respect-core)
to v1.34.1.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkNvcmUiLCJiYWNrcG9ydDpwcmV2LW1pbm9yIiwicmVsZWFzZV9ub3RlOnNraXAiXX0=-->

---------

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-08 03:01:25 +02:00
elastic-renovate-prod[bot]
04a3d3308f
Update dependency @types/semver to ^7.7.0 (main) (#216932)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[@types/semver](https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/semver)
([source](https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver))
| devDependencies | minor | [`^7.5.8` ->
`^7.7.0`](https://renovatebot.com/diffs/npm/@types%2fsemver/7.5.8/7.7.0)
|

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkNvcmUiLCJiYWNrcG9ydDphbGwtb3BlbiIsInJlbGVhc2Vfbm90ZTpza2lwIl19-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Jean-Louis Leysens <jeanlouis.leysens@elastic.co>
2025-04-07 22:36:17 +02:00
Tomasz Kajtoch
b920c645c2
Upgrade EUI to v101.2.0 (#216655) 2025-04-07 17:25:22 +02:00
Aleh Zasypkin
a0b0de16c8
chore(deps): upgrade tar-fs from 2.1.1 to 2.1.2 (#217173)
## Summary

Upgrade `tar-fs` from `2.1.1` to `2.1.2`.
2025-04-04 16:18:38 +02:00
Alejandro Fernández Haro
b5ad8bc00b
Upgrade ES client to 9.0.0-alpha.4 (#213375)
## Summary

Upgrading the ES client to v9.0.0-alpha.4 to test the changes mentioned
in https://github.com/elastic/elasticsearch-js/issues/2584

This new version introduces some type changes, most notably, the
`FieldValue` is `string | number | boolean | null | undefined` instead
of `any`, leading to some new type checks to be implemented (like on
aggregation results `bucket.key`, `search_after`, and `sort` options).

On top of that, it adds the new behavior where unknown properties are
placed in the `body` (when the request has a body). If they must be in
as a query parameter, they should be placed under the `querystring`
option.

cc @JoshMock 

TODO:
- [x] Stabilize the type errors
- [x] Address all the query parameters that are now placed in the body
(by wrapping them inside the option `querystring: {}`)

I will address `// @ts-expect-error elasticsearch@9.0.0
https://github.com/elastic/elasticsearch-js/issues/2584` in a separate
PR to reduce noise.


Related https://github.com/elastic/kibana/pull/208776
2025-04-03 21:54:55 +01:00
Irene Blanco
5c950b4f3e
[Discover][APM] Add duration section to overview tab in flyout and include basic duration information (#216291)
## Summary

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

This PR introduces a new section in the span/transaction overview flyout
that will display the duration information along with a latency chart.
For now, only the duration data is included.

|Scenario||
|-|-|
|Span w/ `transaction.id`|![Screenshot 2025-03-28 at 13 00
04](https://github.com/user-attachments/assets/66b54f58-0474-4424-81ad-688ae0492273)|
|Span w/o `transaction.id`|![Screenshot 2025-03-28 at 13 00
27](https://github.com/user-attachments/assets/ed76c0e4-e5a3-465a-86b4-4e507237f5ac)|
|Transaction w/ `parent.id`|![Screenshot 2025-03-28 at 13 01
25](https://github.com/user-attachments/assets/14ec2d14-33ab-41de-a2e7-3c3d85f69cc3)|
|Transaction w/o `parent.id` (root transaction)|![Screenshot 2025-03-28
at 13 01
57](https://github.com/user-attachments/assets/5345bee5-3b64-45b8-91e3-374444b11b40)|


Given that both spans and transactions require retrieving data from
their respective parents, a loader has been added to reflect the ongoing
data-fetching process:

![Screen Recording 2025-03-28 at 13 02
04](https://github.com/user-attachments/assets/6fdebfda-c5e2-487a-a3af-e84d192fd512)

## Tech details

The UI for displaying the duration and its percentage relative to the
parent is already in use in APM for spans and transactions, so the logic
is consistent with that.

To avoid duplicating components and formatters, as seen in previous PRs
for Traces in Discover, a new `Duration` component has been created in a
newly created `kbn-apm-ui-shared` package. This component will be used
in Discover and [later](https://github.com/elastic/kibana/issues/211781)
in APM as well.

## How to test

- Enable the discover profiles by adding this to the` kibana.yml `file:
```discover.experimental.enabledProfiles:
  - observability-traces-data-source-profile
  - observability-traces-transaction-document-profile
  - observability-traces-span-document-profile
```
- Open Discover and select or create a data view that includes any APM
traces index (`traces-*`), or query them using ES|QL.
- Apply a filter for `data_stream.type:"traces"` to ensure only trace
documents are retrieved.
- Open the flyout.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
2025-04-03 10:37:55 +01:00
Jiawei Wu
4bdea60433
[Response Ops][Task Manager] Run tasks as the current user (#205577)
## Summary

Resolves: https://github.com/elastic/kibana/issues/190661

This PR allows tasks to be ran scoped as the current user. It
accomplishes this by creating an API when the user schedules this task.
It will then persist the API key in the task instance which allows the
task handler to have access to the user's privileges.

To test: 

1. Run `yarn start --run-examples`
2. Navigate to
`http://localhost:5601/app/triggersActionsUiExample/task_manager_with_api_key`
3. Click on `Schedule Task 1 and 2`, this will schedule a mock test that
is defined in
`x-pack/platform/plugins/shared/alerting/server/plugin.ts`, which prints
out the task instance and the scoped clients.
4. Click on `Remove` to cancel the task, which then cleans up and
invalidates the API keys.
5. Reschedule the 2 tasks and click on `Remove All Tasks` which will
bulk remove tasks and invalidate API keys.

Limitation of this approach:
- Because we depend on a request, this would mean every schedule that is
tied to a user needs to be triggered using a request. (Unless we have a
way of generating an API key without using the request).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-02 19:09:07 -06:00
Alexi Doak
8c4dc2e77b
Update puppeteer to 24.4.0 (#215944)
Resolves https://github.com/elastic/response-ops-team/issues/287
## Summary

Updates puppeteer to 24.4.0

 Tested locally, on cloud, and on windows


> [!NOTE]
> There is a known issue that print-mode PDF is not working for Mac
arm64, but will be fixed in this
[PR](https://github.com/elastic/kibana/pull/216688)
2025-04-02 14:08:02 -07:00
elastic-renovate-prod[bot]
34ba08d0cb
Update LaunchDarkly (main) (#216366) 2025-04-02 21:52:36 +01:00
Weronika Olejniczak
7e46d2e756
chore: update eslint-plugin-eui to 0.1.1 (#210082)
## Summary

Bring in the changes from https://github.com/elastic/eui/pull/8304,
specifically ESLint rules:

- `no-restricted-eui-imports`
- `no-css-color` (migrated from `@kbn/eslint-plugin-css`)
- `prefer-css-attribute-for-eui-components` (migrated from
`@kbn/eslint-plugin-css`)

Relates to https://github.com/elastic/eui/issues/8201,
https://github.com/elastic/eui-private/issues/275

## QA

### Instructions

1. Checkout this branch: `gh pr checkout 210082`.
2. Reinstall dependencies: `yarn kbn bootstrap`.
3. See output of ESLint. There should be no errors.
4. Test below cases.

### Test cases

#### `no-restricted-eui-imports`

Example files:

- JSON imports: `src/platform/packages/shared/kbn-ui-theme/src/theme.ts`
- `@kbn/ui-theme`:
`src/platform/plugins/private/vis_types/vega/public/data_model/utils.ts`

#### `no-css-color`

Example file:
`src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.tsx:50`

![Screenshot 2025-02-26 at 15 01
53](https://github.com/user-attachments/assets/ec6f49bd-5832-4d1c-9cfd-74c40ad5498e)

#### `prefer-css-attribute-for-eui-components`

Example file:
`x-pack/examples/alerting_example/public/alert_types/always_firing.tsx:166`
2025-04-02 14:06:17 +02:00
Pierre Gayvallet
c05dda37e2
[workchat] reintegrate into main (#215627)
## Summary

~**DO NOT MERGE:** depends on
https://github.com/elastic/kibana/issues/213468~

This PR reintegrates the work from the `workchat_m1` branch into `main`:

- introduces a 4th solution type, `chat`, that will be used for the
*WorkChat* project type.
- edit things in various platform code to introduce/handle that new
project type
- add plugins and packages for the workchat app. 

### To AppEx reviewers:

File change count is scary, but you can safely ignore anything from
`xpack/solutions/chat` (given it's solution code), and focus on your
owned changes, which are way more reasonable

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Joe McElroy <joseph.mcelroy@elastic.co>
Co-authored-by: Rodney Norris <rodney.norris@elastic.co>
Co-authored-by: Jedr Blaszyk <jedrazb@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Meghan Murphy <meghan.murphy@elastic.co>
2025-04-02 11:00:32 +01:00
Tiago Costa
420512a53a
chore(NA): replaces native-hdr-histogram with hdr-histogram-js (#216715)
`native-hdr-histogram` is a native module and its prebuilds are failing
the bootstrap on macos machines during bootstrap since early today.

Its usage its contained in a single dev package and therefore this PR
attempts to port into `hdr-histogram-js`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-02 10:27:11 +02:00
Dario Gieselaar
d1493b98e7
@kbn/profiler-cli: collect and display CPU profiles (#216356)
# @kbn/profiler-cli

Profile Kibana while it's running, and open the CPU profile in
Speedscope.

## Usage

Run a command by either preceding it with the profiler script:
`node scripts/profile.js -- $command`

Or by piping it in:
`$command | node scripts/profile.js`

You can also just run it until SIGINT:

`node scripts/profile.js`

Or with a timeout:

`node scripts/profile.js --timeout=10000`

## Examples

### Commands

You can copy a curl request from the browser, and place it after the
command:

`node scripts/profile.js --connections=10 --amount=50 -- curl ...`

You can also use stdin for this, for example:

`pbpaste | node scripts/profile.js`

When using stdin, take into consideration that there is some lag between
starting the script and connecting the profiler, so the profiler might
miss the first second or so of the running process.

You can also use any other command, like `autocannon`, `sleep` or
`xargs`.

### SigInt

By default, the profiler will run until the process exits:`node
scripts/profile.js`. This is useful when you have a long running process
running separately and you want to collect the profile over a longer
time period. Be aware that this might cause memory issues because the
profile will get huge. When you press Cmd+C, the profiler will
gracefully exit and first write the profile to disk and open Speedscope.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-02 08:47:33 +02:00
Nathan Reese
756333db0f
[maps] upgrade to maplibre 5.3 (#216476)
[Maplibre
5.3](https://github.com/maplibre/maplibre-gl-js/blob/main/CHANGELOG.md#530)
release fixes circle layer hitbox in Globe projection mode
(https://github.com/maplibre/maplibre-gl-js/pull/5599). This issue is
noticeable in Kibana and makes it difficult to open tooltips with circle
markers (default point marker) and globe projection.
2025-04-01 09:46:09 -06:00
Marco Vettorello
f8b3e93573
Upgrade @elastic/charts to 69.2.1 (#216430)
## Summary

This PR updates `@elastic/charts` library to 69.2.1, that reverse the
wrongly merged multi-time axis breaking change and keeps only the new
feature added to Metric about exposing the fontsize and the color
styling


[v69.2.0](https://redirect.github.com/elastic/elastic-charts/blob/HEAD/CHANGELOG.md#6920-2025-03-26)
[Compare
Source](https://redirect.github.com/elastic/elastic-charts/compare/v69.1.1...v69.2.0)

Features
metric: Expose both font size and color stylings on the extra prop
([#​2627](https://redirect.github.com/elastic/elastic-charts/issues/2627))
([2d21118](2d21118995))
2025-04-01 11:31:12 +02:00
elastic-renovate-prod[bot]
5b3db2b69b
Update dependency @types/diff to ^7.0.2 (main) (#216427)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[@types/diff](https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/diff)
([source](https://redirect.github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/diff))
| devDependencies | patch | [`^7.0.1` ->
`^7.0.2`](https://renovatebot.com/diffs/npm/@types%2fdiff/7.0.1/7.0.2) |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkRhdGFEaXNjb3ZlcnkiLCJiYWNrcG9ydDphbGwtb3BlbiIsInJlbGVhc2Vfbm90ZTpza2lwIl19-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-31 19:16:59 -03:00
elastic-renovate-prod[bot]
1846807c25
Update dependency lru-cache to ^11.1.0 (main) (#216517)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [lru-cache](https://redirect.github.com/isaacs/node-lru-cache) |
dependencies | minor | [`^11.0.2` ->
`^11.1.0`](https://renovatebot.com/diffs/npm/lru-cache/11.0.2/11.1.0) |

---

### Release Notes

<details>
<summary>isaacs/node-lru-cache (lru-cache)</summary>

###
[`v11.1.0`](https://redirect.github.com/isaacs/node-lru-cache/compare/v11.0.2...v11.1.0)

[Compare
Source](https://redirect.github.com/isaacs/node-lru-cache/compare/v11.0.2...v11.1.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkNvcmUiLCJiYWNrcG9ydDphbGwtb3BlbiIsInJlbGVhc2Vfbm90ZTpza2lwIl19-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-31 22:58:09 +01:00
Jean-Louis Leysens
606472a756
[Saved objects] Update forward compatibility schema to only return known values w/o converting them (#216081) 2025-03-31 23:54:21 +02:00
elastic-renovate-prod[bot]
4fe7fe3f71
Update dependency @redocly/cli to ^1.34.0 (main) (#216050)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@redocly/cli](https://redirect.github.com/Redocly/redocly-cli) |
devDependencies | patch | [`^1.33.1` ->
`^1.34.0`](https://renovatebot.com/diffs/npm/@redocly%2fcli/1.34.0/1.34.0)
|
| [@redocly/cli](https://redirect.github.com/Redocly/redocly-cli) |
dependencies | patch | [`^1.33.1` ->
`^1.34.0`](https://renovatebot.com/diffs/npm/@redocly%2fcli/1.34.0/1.34.0)
|

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkNvcmUiLCJiYWNrcG9ydDpwcmV2LW1pbm9yIiwicmVsZWFzZV9ub3RlOnNraXAiXX0=-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-31 12:55:38 +02:00
Lene Gadewoll
2cd777d969
Upgrade EUI to v101.0.1 (#215698)
`100.0.0`  `101.0.1`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Package updates

### `@elastic/eui`
[`v101.0.1`](https://github.com/elastic/eui/releases/v101.0.1)

- Updated `EuiProvider` and `EuiThemeProvider` with a new
`highContrastMode` ([#8444](https://github.com/elastic/eui/pull/8444))
- This prop allows toggling a higher contrast visual style that
primarily affects borders and shadows
- On `EuiProvider`, if the `highContrastMode` prop is not passed, this
setting will inherit from the user's OS/system settings
- If the user is using a forced colors mode (e.g. Windows' high contrast
themes), this system setting will take precedence over any
`highContrastMode` or `colorMode` props passed
- Added `highContrastModeStyles` and `preventForcedColors` styling utils
([#8444](https://github.com/elastic/eui/pull/8444))
- Updated `EuiRangeTooltip` to be easier to see in dark mode
([#8444](https://github.com/elastic/eui/pull/8444))
- Updated some deprecated color token usages that have direct
substitutes ([#8444](https://github.com/elastic/eui/pull/8444))
  - `text` -> `textParagraph`
  - `title` -> `textHeading`
  - `subduedText` -> `textSubdued`
  - `disabledText` -> `textDisabled`
  - `accentText` -> `textAccent`
  - `dangerText` -> `textDanger`
  - `warningText` -> `textWarning`
- `useEuiShadow()` now accepts a second `options` argument
([#8234](https://github.com/elastic/eui/pull/8234))
- `useEuiShadowFlat()` now accepts an `options` object instead of only a
color ([#8234](https://github.com/elastic/eui/pull/8234))
- Updated `EuiPopover` and `EuiToolTip` to be easier to see in dark
mode. ([#8174](https://github.com/elastic/eui/pull/8174))

**Bug fixes**

- Fixed a visual bug where a transparent border would create visible
empty space (`LIGHT` mode only) for the components:
([#8427](https://github.com/elastic/eui/pull/8427))
  - `EuiPanel`
  - `EuiPopover`
  - `EuiToolTip`
  - `EuiToast`
  - `EuiTour`
  
  --- 
  
### `@elastic/eui-theme-common`
[`v0.1.0`](https://github.com/elastic/eui/releases/v0.1.0)

- Removed type `EuiShadowCustomColor`
([#8444](https://github.com/elastic/eui/pull/8444))
- Added types:  ([#8444](https://github.com/elastic/eui/pull/8444))
  - `EuiShadowOptions`
  - `EuiThemeHighContrastModeProp`
  - `EuiThemeHighContrastMode`
- Updated shadow utils to accepts a second `options` argument and return
borders in high contrast mode:
([#8444](https://github.com/elastic/eui/pull/8444))
  - `euiShadow`
  - `euiShadowXSmall`
  - `euiShadowSmall`
  - `euiShadowMedium`
  - `euiShadowLarge`
  - `euiSlightShadowHover`
  - `euiShadowFlat`
  
  ---
  
### `@elastic/eui-theme-borealis`
[`v0.1.0`](https://github.com/elastic/eui/releases/v0.1.0)

- Added new component level tokens:
([#8444](https://github.com/elastic/eui/pull/8444))
  - `buttonGroupBackgroundDisabledSelected`
  - `overlayMaskBackground`
  - `overlayMaskBackgroundHighContrast`
  - `skeletonBackgroundSkeletonMiddleHighContrast`
  

## Additional changes

The latest `@elastic/eui` package introduces high contrast mode support.
This PR sets all usages of `EuiProvider` to use
`highContrastMode={false}` to introduce it in disabled state (this
reflects the current functionality in Kibana). This is because the UI
for the high contrast mode functionality (and style adjustments) need to
first be implemented on Kibana side (by shared-ux).

## QA

Adding high contrast mode in disabled state should result in no visual
changes in Kibana. Please ensure your product view remain unchanged.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-28 19:29:23 +01:00
Aleh Zasypkin
69bd83e69e
chore(deps): upgrade vega from 5.31.0 to 5.33.0 (#216284)
## Summary

Upgrade `vega` from `5.31.0` to `5.33.0`:
* https://github.com/vega/vega/releases/tag/v5.32.0
* https://github.com/vega/vega/releases/tag/v5.33.0
2025-03-28 16:07:14 +01:00
Coen Warmer
54add717b6
Create eslint-plugin-eui-a11y plugin (#215859)
## Summary

This adds an additional custom ESLint rule package which checks certain
Eui elements for the existence of an `aria-label` prop.

If it exists, it will leave it untouched. If it doesn't, it will warn
the engineer it needs to be added, and offers a autofix suggestion for
those engineers who have fix on save enabled in their IDE.

<img width="739" alt="Screenshot 2025-03-25 at 13 59 28"
src="https://github.com/user-attachments/assets/0813b317-c752-40d7-b569-e866a3ecf6b0"
/>

<img width="804" alt="Screenshot 2025-03-25 at 13 59 36"
src="https://github.com/user-attachments/assets/3c45c49c-6db8-4740-b5de-89aa534c248b"
/>

This package is an offshoot of the `kbn-eslint-plugin-i18n` and
`kbn-eslint-plugin-telemetry` packages.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-26 23:00:31 +02:00
elastic-renovate-prod[bot]
11f66e750c
Update dependency @redocly/cli to ^1.33.1 (main) (#215038)
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| [@redocly/cli](https://redirect.github.com/Redocly/redocly-cli) |
devDependencies | patch | [`^1.33.0` ->
`^1.33.1`](https://renovatebot.com/diffs/npm/@redocly%2fcli/1.33.0/1.33.1)
| `1.34.0` |
| [@redocly/cli](https://redirect.github.com/Redocly/redocly-cli) |
dependencies | patch | [`^1.33.0` ->
`^1.33.1`](https://renovatebot.com/diffs/npm/@redocly%2fcli/1.33.1/1.33.1)
| `1.34.0` |

---

### Release Notes

<details>
<summary>Redocly/redocly-cli (@&#8203;redocly/cli)</summary>

###
[`v1.33.1`](https://redirect.github.com/Redocly/redocly-cli/releases/tag/%40redocly/cli%401.33.1)

[Compare
Source](https://redirect.github.com/Redocly/redocly-cli/compare/@redocly/cli@1.33.0...@redocly/cli@1.33.1)

##### Patch Changes

- Fixed `generate-arazzo` command to properly handle output file paths.
The `output-file` parameter must have a value when provided.
- Updated
[@&#8203;redocly/respect-core](https://redirect.github.com/redocly/respect-core)
to v1.33.1.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkNvcmUiLCJiYWNrcG9ydDpwcmV2LW1pbm9yIiwicmVsZWFzZV9ub3RlOnNraXAiXX0=-->

---------

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-26 14:56:31 +01:00
Umberto Pepato
7aac590af4
[ResponseOps][Rules] Create Rules APIs package (#214187)
## Summary

- Creates a `@kbn/response-ops-rules-apis` package, following the
proposed structure for ResponseOps Management Experiences package.
- Moves relevant rules API fetchers and react-query hooks to the new
package.
- Adds an internal variant of the `/api/alerting/rule_types` endpoint
(`/internal/alerting/_rule_types`), that returns the same value as the
public one + the newly added internal [`solution`
field](https://github.com/elastic/kibana/issues/212017), that we don't
want to expose publicly.

## Verification steps

1. Create rules that fire alerts
2. Verify the usages of the moved/changed hooks, with limited privileges
as well (i.e. only `Rules Settings` but not `Stack Rules`):
2.1. Stack management and Observability rules, rule details and alerts
pages
2.2. Rules tab in the Connector editor flyout
2.3. Alerts table row actions (••• icon)
2.4. Tags filter in the rules list page
3. Using the DevTools, compare the response of the public and internal
`rule_types` endpoins:
    ```
    GET kbn:/api/alerting/rule_types
    GET kbn:/internal/alerting/_rule_types
    ```
Checking that the `solution` field is present only in the internal one

## References 

Closes #213059 

### 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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-26 10:01:51 +01:00
elastic-renovate-prod[bot]
109d79d3f0
Update dependency @launchdarkly/node-server-sdk to ^9.7.5 (main) (#215812)
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
|
[@launchdarkly/node-server-sdk](https://redirect.github.com/launchdarkly/js-core/tree/main/packages/sdk/server-node)
([source](https://redirect.github.com/launchdarkly/js-core)) |
dependencies | patch | [`^9.7.4` ->
`^9.7.5`](https://renovatebot.com/diffs/npm/@launchdarkly%2fnode-server-sdk/9.7.4/9.7.5)
| `9.7.6` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkNvcmUiLCJUZWFtOlNlY3VyaXR5IiwiYmFja3BvcnQ6cHJldi1taW5vciIsInJlbGVhc2Vfbm90ZTpza2lwIl19-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-25 19:11:33 +02:00
Brad White
31aa294124
Storybook 8 Upgrade Follow Up (#214684)
## Summary

These Stories were missed in [Upgrade to Storybook 8
(#195148)](https://github.com/elastic/kibana/pull/195148) and should be
migrated to the same format as other stories for consistency and to make
future migrations easier. They technically work in SB8, I forgot to run
the migration script again later on while working on the original PR.

The changes have already been backported to #214680 and #214681
2025-03-24 20:28:19 +02:00
elastic-renovate-prod[bot]
f81572e462
Update dependency elastic-apm-node to ^4.11.2 (main) (#214940)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[elastic-apm-node](https://redirect.github.com/elastic/apm-agent-nodejs)
| dependencies | patch | [`^4.11.1` ->
`^4.11.2`](https://renovatebot.com/diffs/npm/elastic-apm-node/4.11.1/4.11.2)
|

---

### Release Notes

<details>
<summary>elastic/apm-agent-nodejs (elastic-apm-node)</summary>

###
[`v4.11.2`](https://redirect.github.com/elastic/apm-agent-nodejs/releases/tag/v4.11.2)

[Compare
Source](https://redirect.github.com/elastic/apm-agent-nodejs/compare/v4.11.1...v4.11.2)

For more information, please see the
[changelog](https://www.elastic.co/guide/en/apm/agent/nodejs/current/release-notes-4.x.html#release-notes-4.11.2).

##### Elastic APM Node.js agent layer ARNs

|Region|ARN|
|------|---|

|af-south-1|arn:aws:lambda:af-south-1:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|ap-east-1|arn:aws:lambda:ap-east-1:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|ap-northeast-1|arn:aws:lambda:ap-northeast-1:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|ap-northeast-2|arn:aws:lambda:ap-northeast-2:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|ap-northeast-3|arn:aws:lambda:ap-northeast-3:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|ap-south-1|arn:aws:lambda:ap-south-1:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|ap-southeast-1|arn:aws:lambda:ap-southeast-1:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|ap-southeast-2|arn:aws:lambda:ap-southeast-2:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|ap-southeast-3|arn:aws:lambda:ap-southeast-3:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|ca-central-1|arn:aws:lambda:ca-central-1:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|eu-central-1|arn:aws:lambda:eu-central-1:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|eu-north-1|arn:aws:lambda:eu-north-1:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|eu-south-1|arn:aws:lambda:eu-south-1:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|eu-west-1|arn:aws:lambda:eu-west-1:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|eu-west-2|arn:aws:lambda:eu-west-2:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|eu-west-3|arn:aws:lambda:eu-west-3:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|me-south-1|arn:aws:lambda:me-south-1:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|sa-east-1|arn:aws:lambda:sa-east-1:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|us-east-1|arn:aws:lambda:us-east-1:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|us-east-2|arn:aws:lambda:us-east-2:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|us-west-1|arn:aws:lambda:us-west-1:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

|us-west-2|arn:aws:lambda:us-west-2:267093732750:layer:elastic-apm-node-ver-4-11-2:1|

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkNvcmUiLCJiYWNrcG9ydDpwcmV2LW1pbm9yIiwicmVsZWFzZV9ub3RlOnNraXAiXX0=-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-24 10:55:26 +02:00
Sergi Romeu
965a69d9fb
[Storybook] Use native theme switcher (#215443)
## Summary

Closes #213294

This PR replaces the custom theme switcher in favor of the native
toolbar customization SB has integrated.

Also removed `@storybook/icons` which was only used in the theme
switcher component.

## How to test
1. Run `yarn storybook <plugin>`
2. You should be able to change between themes on the toolbar.
2025-03-24 10:54:15 +02:00
Efe Gürkan YALAMAN
62f8027c57
[Query Rules]Query rules UI plugin (#215029)
## Summary

Adds Query Rules UI Plugin. It is disabled and pretty much empty as we
want to split the implementation in multiple parts and enable the
feature once implementation is done.

It is disabled for Security.
It is disabled for Observability.
It is enabled but behind a feature flag for Search while it is not
useful to enable it with partial implementations.


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] 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
- [ ] [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)
2025-03-21 15:19:25 +01:00
Gloria Hornero
d5a0501fb8
initial @kbn/scout-security plugin (#210433)
## Summary

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

In this PR we are adding the initial structure for the
@kibana/scout-security package, note that this is not ready to be used
and any new test using this package, is not going to be executed as part
of the regular pipelines, meaning, you are not going to add coverage to
the application.


@kibana/scout-security package is a test package that extends @kbn/scout
with test helpers specifically designed to test Security Solution
functionalities in Kibana. All tests under Security plugins should only
import from @kbn/scout-security, not from @kbn/scout.



This PR is a POC to start testing development by providing custom
Playwright fixtures, page objects, and utilities tailored for
Security-related testing scenarios.

Things to follow-up:



- CustomQueryRule interface is already declared in
`x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_schemas.gen.ts`
as `QueryRuleCreateProps`

- DETECTION_ENGINE_RULES_URL and DETECTION_ENGINE_RULES_BULK_ACTION are
already declared in `@kbn/security-solution-plugin/common/constants`

It would be great if all of that is extracted from the plugin to a
package so it can be reused instead of having to duplicate the code.

Until the package is not ready to be used and has not been introduced to
the different teams, appex-qa and myself will be the owners of it to
make sure that best practices are followed

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
2025-03-21 12:59:30 +02:00
elastic-renovate-prod[bot]
0aa226cad4
Update dependency oniguruma-to-es to v4 (main) (#215073)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[oniguruma-to-es](https://redirect.github.com/slevithan/oniguruma-to-es)
| dependencies | major | [`^3.1.1` ->
`^4.1.0`](https://renovatebot.com/diffs/npm/oniguruma-to-es/3.1.1/4.1.0)
|

---

### Release Notes

<details>
<summary>slevithan/oniguruma-to-es (oniguruma-to-es)</summary>

###
[`v4.1.0`](https://redirect.github.com/slevithan/oniguruma-to-es/releases/tag/v4.1.0)

[Compare
Source](https://redirect.github.com/slevithan/oniguruma-to-es/compare/v4.0.1...v4.1.0)

##### 🚀 Features

- Added partial support for nested, negated classes with `target`
`ES2018` (supports top-level-nested, negated classes in non-negated
classes).
- Allows supporting output from `oniguruma-parser/optimizer` in older
environments.

###
[`v4.0.1`](https://redirect.github.com/slevithan/oniguruma-to-es/releases/tag/v4.0.1)

[Compare
Source](https://redirect.github.com/slevithan/oniguruma-to-es/compare/v4.0.0...v4.0.1)

##### 🐞 Fixes

- Bumped the `oniguruma-parser` dependency to fix a bundle size
regression.

###
[`v4.0.0`](https://redirect.github.com/slevithan/oniguruma-to-es/releases/tag/v4.0.0)

[Compare
Source](https://redirect.github.com/slevithan/oniguruma-to-es/compare/v3.1.1...v4.0.0)

##### 🚨 Breaking

- Removed `toOnigurumaAst`. Its functionality has moved to the new,
dedicated library
[oniguruma-parser](https://redirect.github.com/slevithan/oniguruma-parser),
which includes many improvements, new features, and changes to the AST
structure.

##### 🚀 Features

- `toRegExp`/`toRegExpDetails`: Throw if the second argument isn't an
object or `undefined`.
-   Shorter output for POSIX classes `cntrl`, `graph`, `print`.

##### 🐞 Fixes

- Fixed a regression in support for comment groups in v3.1.1.
([#&#8203;31](https://redirect.github.com/slevithan/oniguruma-to-es/issues/31))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOm9icy11eC1sb2dzIiwiYmFja3BvcnQ6YWxsLW9wZW4iLCJyZWxlYXNlX25vdGU6c2tpcCJdfQ==-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Kerry Gallagher <kerry.gallagher@elastic.co>
2025-03-21 10:19:28 +00:00
Umberto Pepato
4aab9d4c48
[ResponseOps][Alerts] Create embeddable alerts table plugin (#213909)
## Summary

Creates a wrapper plugin around the alerts table, that registers a basic
alerts table embeddable panel for dashboards.

> [!NOTE]
> This PR is a preparation work for the [embeddable alerts
table](https://github.com/elastic/kibana/issues/197483). The feature is
disabled for end-users while waiting for other dependent PRs to be
integrated with this, and uses a partially hard-coded table
configuration for testing purposes. The final panel will be fully
configurable by the user.

## Verification steps

1. Uncomment this line

4d49e98b4d/x-pack/platform/plugins/shared/embeddable_alerts_table/public/plugin.ts (L34)
(I'm using a comment to avoid polluting the embeddable examples app with
this panel for a short time)
2. Create one or more ES Query rules that fire alerts
3. Visit the Dashboards page and create a dashboard, then enter edit
mode
4. Click "Add panel"
5. Under "Visualizations" choose "Alerts table"
6. Check that the table panel was created correctly
6.1. Shows any alerts fired by the ES Query rule(s)
6.2. Check that the table adapts correctly to the panel when resizing,
and all normal interactions with the alerts table work correctly
(adding/removing fields, opening alerts in flyouts, using row/bulk
actions)
6.3. Check that panels respond to the global time filter (only time
filters, not KQL search or filters)
6.4. Check that panels respond to individual time filters (⛭ icon >
Apply custom time range)
11. Create a role with access to dashboards but without any alerting
capability and a user assigned to that role
12. Repeat steps 3 and 4, and verify that the "Alerts table" option
isn't available under "Visualizations"
13. Add any alerting capability to the role, such as Management > Stack
rules
14. Repeat steps 3 and 4, and verify that the "Alerts table" is
available again

## References

Closes #203611

### Checklist

- [x] 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)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-21 12:02:54 +02:00
elastic-renovate-prod[bot]
933564d713
Update dependency @openfeature/launchdarkly-client-provider to ^0.3.2 (main) (#215232)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| @&#8203;openfeature/launchdarkly-client-provider | dependencies |
patch | [`^0.3.1` ->
`^0.3.2`](https://renovatebot.com/diffs/npm/@openfeature%2flaunchdarkly-client-provider/0.3.1/0.3.2)
|

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkNvcmUiLCJUZWFtOlNlY3VyaXR5IiwiYmFja3BvcnQ6cHJldi1taW5vciIsInJlbGVhc2Vfbm90ZTpza2lwIl19-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-21 07:57:46 +01:00
Gerard Soldevila
adb4bdf8d8
SKA: Extract list of Kibana solutions into a dedicated package (#213353)
## Summary

The intent is to have a centralised place to store the list of Kibana
solutions and serverless project types.
To that end, this PR creates a `@kbn/projects-solutions-groups` package.
It also adds the new solution type `'chat'`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-20 10:20:07 +01:00
Gonçalo Rica Pais da Silva
54d9cf45cb
[Discover][APM] Refactor APM sources for better trace enablement (#212634)
## Summary

This PR reworks how APM handles getting its sources data, elevating the
necessary code to a private shared plugin so that Discover for Traces
can access the data and handle user provided configuration. It also
removes the need for Discover for Traces to rely on the APM static data
view, so the Trace data source and document profile will work on any
compatible/configured index, even in ESQL mode.

Closes #211414

<img alt="ESQL Discover Traces Screenshot 2025-03-04 173032"
src="https://github.com/user-attachments/assets/f5bbb736-8b8b-45dc-ac23-4bf7083aa47e"
/>

## How to test

Test with olbt-cli instance for now, will post for doing with synthtrace
data. Ensure the following is added to your kibana.dev.yml:

```yaml
discover.experimental.enabledProfiles:
  - observability-traces-data-source-profile
```

- Make sure your space has the Observability solution view configured
- Go to Discover page
- Select Data Views mode if required and create a view with a `traces`
specific index. Or use the APM static data view.
- The default columns on the page should show the summary column with
four of the following badges: `service.name`, `event.outcome`,
`transaction.name`, `transaction.duration.us`, `span.name`,
`span.duration.us`
- Go to ESQL mode with the query targetting a `traces` index
- The default columns should show the same as in Data View mode

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Irene Blanco <irene.blanco@elastic.co>
2025-03-19 15:52:30 +01:00
Kerry Gallagher
f9783504bb
[Streams] [Dedicated Grok UI] Package / highlight matched parts / suggestions (#213278)
## Summary

Closes https://github.com/elastic/streams-program/issues/170 and
https://github.com/elastic/streams-program/issues/171

## Reviewer notes

It's worth reading the research in
https://github.com/elastic/streams-program/issues/168 to understand why
certain decisions were made. Some of the resolving code is inspired by
`grok-js`, unfortunately this wasn't something we could use directly.

The design / UX is **not** final. This is just a functional version. The
editor is currently on the streams > enrichment page so it can be played
with, this will **not** be merged.

There is pattern support for our ECS patterns, I have not added the
legacy ones.

There will almost certainly be some edge cases that don't work, every
repo for a Grok tool I looked at had their own 😅 I've tried to test this
with lots of varied examples though.

I'd recommend unticking "No extension" from the file filter to remove
the pattern files.

<img width="323" alt="Screenshot 2025-03-06 at 22 40 19"
src="https://github.com/user-attachments/assets/5b594f5f-0b0f-4ed0-ae10-2412fcf9e31a"
/>

## Possible improvements / followups

- We could in the future expand the UI to toggle on and off certain
pattern collections.

- Ability to add custom patterns (like in our Grok debugger). This can
still be achieved with `(?<queue_id>[0-9A-F]{10,11})` syntax.

- Point out when regex is invalid (right now it's silent).

- I've copied over the patterns from the ES repo for now, with a light
script to generate an object from them. There's a CLI skeleton in place
if we feel we want to actually pull these from the ES repo directly.
These patterns don't change often, and aren't heavy size wise.

- Debouncing etc for processing, but I'd like to see how the final UX
ends up.

## Media

Screenshot

![Screenshot 2025-03-06 at 11 58
56](https://github.com/user-attachments/assets/158b2a6f-df26-490e-b9f8-63ae69625607)

Simple example


![simple_example](https://github.com/user-attachments/assets/36f36505-eb0b-45d6-bd24-1dbef769658d)

Complex example


![complex_example](https://github.com/user-attachments/assets/968cc935-d208-4ef0-a64d-452995dccd5e)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-18 22:56:58 +00:00
Dario Gieselaar
70f1880e4f
[Inference] Inference CLI client (#214691)
Exposes an Inference (plugin) API client for scripts, that mimicks the
`chatComplete` and `output` APIs that are available on its start
contract. It depends on the KibanaClient that is exposed from the
`@kbn/kibana-api-cli` package. It automatically selects a connector if
available.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-18 13:33:30 +01:00
Alex Szabo
f0a9bb01d3
upgrade axios to 1.8.3 (#214843)
## Summary
Updates [axios to
1.8.3](https://github.com/axios/axios/releases/tag/v1.8.3).

Axios 1.8.2 fixed a vulnerability, but forgot to reflect the new flag in
their type definitions. This is probably required to allow the changes
smoothly.
2025-03-18 11:24:09 +01:00
Dominique Clarke
71b7458767
[Incident Management] add recommended dashboards api (#213287)
## Summary

Adds a basic api for finding suggested dashboards by alert.

This internal API is currently not in use anywhere.

This api finds suggested dashboards in two ways:
1. Finding dashboards with lens visualizations that query against the
same data view
2. Finding dashboards with lens visualizations that utilize fields in
the rule configuration, or alert data.

These are two naive approaches to finding suggested dashboards. These
heuristics will be improved over time and incorporate more sophisticated
approaches that have been explored by numerous engineers across
Observability.

## Testing

A basic api integration test is included that covers matching dashboards
by index and field, across spaces. As we develop this feature further
over time more fine grain tests will be added

### Manual Testing

1. Run
```
node x-pack/scripts/data_forge.js --events-per-cycle 200 --lookback now-1h --ephemeral-project-ids 10 --dataset fake_stack --install-kibana-assets --kibana-url http://localhost:5601 --event-template bad
```
2. Save the file as a .ndjson file and import it via saved objects
import
https://p.elstc.co/paste/3BWKIHLU#f0WfGYx7G9DhWy88yDXhaEXTX16Fn+ovDcomNIx6E3a
3. Navigate to the alert details page, you should start to see a lot of
alerts
4. Click on one, and copy the alert id
5. Navigate to console and paste `GET
kbn:/internal/observability/alerts/suggested_dashboards?alertId=[YOUR_ALERT_ID]`
to see the recommended dashboards

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nick Peihl <nickpeihl@gmail.com>
2025-03-17 15:13:04 -04:00
Jeramy Soucy
da7e44988d
Upgrade xml-crypto 6.0.0 → 6.0.1 (#214792)
## Summary

Upgrades `xml-crypto` from v6.0.0 to v6.0.1
2025-03-17 18:57:41 +01:00
elastic-renovate-prod[bot]
b3010930f9
Update dependency elastic-apm-node to ^4.11.1 (main) (#214504)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[elastic-apm-node](https://redirect.github.com/elastic/apm-agent-nodejs)
| dependencies | patch | [`^4.11.0` ->
`^4.11.1`](https://renovatebot.com/diffs/npm/elastic-apm-node/4.11.0/4.11.1)
|

---

### Release Notes

<details>
<summary>elastic/apm-agent-nodejs (elastic-apm-node)</summary>

###
[`v4.11.1`](https://redirect.github.com/elastic/apm-agent-nodejs/releases/tag/v4.11.1)

[Compare
Source](https://redirect.github.com/elastic/apm-agent-nodejs/compare/v4.11.0...v4.11.1)

For more information, please see the
[changelog](https://www.elastic.co/guide/en/apm/agent/nodejs/current/release-notes-4.x.html#release-notes-4.11.1).

##### Elastic APM Node.js agent layer ARNs

|Region|ARN|
|------|---|

|af-south-1|arn:aws:lambda:af-south-1:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|ap-east-1|arn:aws:lambda:ap-east-1:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|ap-northeast-1|arn:aws:lambda:ap-northeast-1:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|ap-northeast-2|arn:aws:lambda:ap-northeast-2:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|ap-northeast-3|arn:aws:lambda:ap-northeast-3:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|ap-south-1|arn:aws:lambda:ap-south-1:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|ap-southeast-1|arn:aws:lambda:ap-southeast-1:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|ap-southeast-2|arn:aws:lambda:ap-southeast-2:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|ap-southeast-3|arn:aws:lambda:ap-southeast-3:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|ca-central-1|arn:aws:lambda:ca-central-1:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|eu-central-1|arn:aws:lambda:eu-central-1:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|eu-north-1|arn:aws:lambda:eu-north-1:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|eu-south-1|arn:aws:lambda:eu-south-1:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|eu-west-1|arn:aws:lambda:eu-west-1:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|eu-west-2|arn:aws:lambda:eu-west-2:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|eu-west-3|arn:aws:lambda:eu-west-3:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|me-south-1|arn:aws:lambda:me-south-1:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|sa-east-1|arn:aws:lambda:sa-east-1:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|us-east-1|arn:aws:lambda:us-east-1:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|us-east-2|arn:aws:lambda:us-east-2:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|us-west-1|arn:aws:lambda:us-west-1:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

|us-west-2|arn:aws:lambda:us-west-2:267093732750:layer:elastic-apm-node-ver-4-11-1:1|

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOkNvcmUiLCJiYWNrcG9ydDpwcmV2LW1pbm9yIiwicmVsZWFzZV9ub3RlOnNraXAiXX0=-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-03-14 23:26:57 +00:00
Brad White
403b5f2363
Upgrade to Storybook 8 (#195148)
## Summary

Depends on #191106
Closes #171591

This PR migrates Storybook from `6.x` to `8.x`. Please see the
[migration
guide](https://storybook.js.org/docs/migration-guide/from-older-version)
for an overview of the changes because there are many breaking changes
which effect Kibana. The TODO list below is not inclusive of all the
changes.

## Reviewers
### Each commit contains all files changed for a specific codeowner,
please find your respective commit to make review easier.

A **first step before code review** should be checking the [`Storybooks
Preview`](https://ci-artifacts.kibana.dev/storybooks/pr-195148/index.html)
from CI for any runtime or style issues which were missed. The preview
can be compared to a build from `main`
[here](https://ci-artifacts.kibana.dev/storybooks/pr-212585/index.html).
It is worth noting that some stories have runtime issues which existed
before this migration.

Most stories appear to have been migrated properly, but the Operations
team does not have prior knowledge into every story. Some of the
migration was able to be automated through Storybook provided scripts.
It is possible this wasn't entirely correct due to the structure of some
stories. Additionally, part of this migration is moving Storybook to
Webpack 5 which changed how styles are being loaded.

#### TODO
- [x] Migrate `stories.mdx`
- [x] storyshots
- [x] [Migrate
packages](https://storybook.js.org/docs/migration-guide/from-older-version#package-structure-changes)
which were removed in `8.0`
- [x] `react-doc-gen` resolution
- [x] [Migrate
blocks](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#addon-docs-removed-deprecated-blocksjs-entry)
- [x] Migrate deprecated `addon-knobs` to
[addon-controls](https://www.npmjs.com/package/@storybook/addon-controls)
- [x] React Fast Refresh support
- [x] Watch flag callback
- [x] `canvas` webpack
- [x] Rerun CSF migrations for new stories
- [x] Handle ESM import for `addon-docs`
- [x] `'@storybook/addon-actions' should be listed in the project's
dependencies. Run 'npm i -S @storybook/addon-actions' to add
iteslint[import/no-extraneous-dependencies](https://github.com/import-js/eslint-plugin-import/blob/v2.28.0/docs/rules/no-extraneous-dependencies.md)`
- [x] `addDecorator` migration 
- [x] `addParameter` migration
- [x] static build
- [ ] determine if #176500 is solved or push to followup PR
  - This will need to be fixed separately
- [x] revert `.buildkite/pipelines/pull_request/base.yml` &
`.buildkite/scripts/pipelines/pull_request/pipeline.ts` to `main`

---------

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jacek Kolezynski <jacek.kolezynski@elastic.co>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>
2025-03-14 15:41:03 -07:00
Dzmitry Lemechko
b5f158bc42
[Space time] extending Scout with perfTracker fixture (#212397)
## Summary

On-Week project "Client-side performance insights with Playwright &
Lighthouse"

revisiting old PR #66224

This PR extends Scout with `perfTracker` fixture designed to analyze
JavaScript bundle performance and page-level performance metrics in
Kibana by leveraging Chrome DevTools Protocol (CDP).

It intercepts network requests, filters static bundles, and computes
bundle size statistics per page load. Additionally, it collects CDP
Performance Domain Metrics, allowing in-depth analysis of rendering and
script execution times.


[README](c013c39b7e/src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/performance/README.md)
file with more details and examples was added

Output example for `/app/discover` (shorten, just to share the idea):

```
{
  "url": "http://localhost:5620/app/discover#/",
  "bundleCount": 87,
  "totalSize": 3133420,
  "pluginCount": 9,
  "plugins": [
    {
      "name": "aiops",
      "bundlesCount": 2,
      "totalSize": 5982,
      "bundles": [
        {
          "name": "aiops.chunk.1.js",
          "transferredSize": 2013
        },
        ...
      ]
    },
    {
      "name": "discover",
      "bundlesCount": 17,
      "totalSize": 631605,
      "bundles": [
        {
          "name": "discover.chunk.1.js",
          "transferredSize": 41915
        },
        ...
      ]
    },
    {
      "name": "eventAnnotation",
      "bundlesCount": 1,
      "totalSize": 8652,
      "bundles": [
        {
          "name": "eventAnnotation.chunk.1.js",
          "transferredSize": 8652
        }
      ]
    },
    {
      "name": "expressionXY",
      "bundlesCount": 5,
      "totalSize": 203127,
      "bundles": [
        {
          "name": "expressionXY.chunk.2.js",
          "transferredSize": 5328
        },
        ...
      ]
    },
  ]
}
```

You can create a Scout UI test and start bundle tracker whenever you
want to compute collected stats when all loading is done. Designed as
test, it allows you to have individual validations for plugins, total
bundle size, individual plugin size, etc.

```
      // Ensure all JS bundles are loaded
      await perfTracker.waitForJsLoad(cdp);

      // Collect and validate stats
      const stats = perfTracker.collectJsBundleStats(currentUrl);
      expect(
        stats.totalSize,
        `Total bundles size loaded on page should not exceed 3.0 MB`
      ).toBeLessThan(3 * 1024 * 1024);
      expect(stats.bundleCount, {
        message: `Total bundle chunks count loaded on page should not exceed 100`,
      }).toBeLessThan(100);
      expect(
        stats.plugins.map((p) => p.name),
        { message: 'Unexpected plugins were loaded on page' }
      ).toStrictEqual([
        'aiops',
        'discover',
        'eventAnnotation',
        'expressionXY',
        'kbn-ui-shared-deps-npm',
        'lens',
        'maps',
        'unifiedHistogram',
        'unifiedSearch',
      ]);
      // Validate individual plugin bundle sizes
      expect(stats.plugins.find((p) => p.name === 'discover')?.totalSize, {
        message: `Total 'discover' bundles size should not exceed 625 KB`,
      }).toBeLessThan(625 * 1024);
```

Full test example:
7b18e85541/x-pack/platform/plugins/private/discover_enhanced/ui_tests/tests/discover_cdp_perf.spec.ts

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-14 18:35:31 +01:00
Christos Nasikas
1054799f9c
[Cases] Improve unit test flakiness (#212489)
## Summary

This PR attempts (I have lost count of how many there have been so far)
to stabilize the flakiness of cases tests.

## Approach

Based on our investigations, I believe a common factor that causes all
tests to time out is how we wrap the tests with the needed providers.
Instead of figuring out why they time out (which is very difficult), I
tried a different approach. I rewrote how we initialize the testing
dependencies, mocks, and providers on tests. To test my theory, I
created a VM instance in GCloud with the same configuration as the one
running in the CI, specifically the n2-standard-4 (4 vCPUs, 16 GB
Memory) machine type. I ran the tests 100 times, which took almost two
days. In 10 of the runs, a random test was timeouted. I noticed that the
machine was stressed while running the tests, and the CPU frequently
spiked to 100%, especially at the beginning of each test. Then, I
increased the timeout for all cases tests to 10 seconds and ran the
tests again 100 times. No timeouts occurred. Lastly, I created a VM
instance in GCloud with the same configuration as the one running in the
CI, specifically the n2-standard-8 (8 vCPUs, 32 GB Memory) machine type.
I ran the tests again 100 times. In 1 of the runs, a random test was
timeouted. The machine on the CI cannot handle the cases tests. I
believe the work in this PR is a step in the right direction either way,
and we will benefit from it. I also believe increasing the timeout is a
good decision as we need it based on the experiments and the research we
have done in the last months.

CPU usage on n2-standard-4


https://github.com/user-attachments/assets/36b035df-310f-4906-98ba-688d57b97c7e

CPU usage on n2-standard-8


https://github.com/user-attachments/assets/3b1b6351-d48e-41da-a413-a56e52b54b82

## RLT eslint rules
I enabled the [RLT eslint
rules](https://testing-library.com/docs/ecosystem-eslint-plugin-testing-library/)
for Cases and resolved any eslint errors. The process revealed small
bugs in the tests, which I fixed them.

## Testing utils

I removed the `appMockRender` and any usage in favor of the new
`renderWithTestingProviders` utility function and the improved
`TestProviders` component. The `renderWithTestingProviders` follows the
principals
[suggested](https://github.com/testing-library/react-testing-library/issues/780#issuecomment-689053441)
by the RLT team. Specifically:
- The `renderWithTestingProviders` is a wrapper of the `render` function
of the RTL library.
- The `renderWithTestingProviders` does not create the services or any
component inside it.
- The `renderWithTestingProviders` cannot be used in `beforeEach`
functions. It should be called separately on each test.
- The `renderWithTestingProviders` accepts props to override the default
mocks.
- The `renderWithTestingProviders` passes the `TestProviders` in the
`wrapper` argument of the RLT `render` function.
- The `TestProviders` component initializes and memoizes all services
and dependencies. It accepts props to override the default mocks.
- Mock overrides (like core services) should be created and passed to
`renderWithTestingProviders` on each test, even if it means duplication.
We favor test isolation.

### Checklist

Check the PR satisfies the following conditions. 

Reviewers should verify this PR satisfies this list as well.

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

## Issues
<details>
<summary>List</summary>

Fixes: https://github.com/elastic/kibana/issues/207712
Fixes: https://github.com/elastic/kibana/issues/192739
Fixes: https://github.com/elastic/kibana/issues/174682
Fixes: https://github.com/elastic/kibana/issues/206366
Fixes: https://github.com/elastic/kibana/issues/207427
Fixes: https://github.com/elastic/kibana/issues/175239
Fixes: https://github.com/elastic/kibana/issues/177334
Fixes: https://github.com/elastic/kibana/issues/208443
Fixes: https://github.com/elastic/kibana/issues/187526
Fixes: https://github.com/elastic/kibana/issues/208310
Fixes: https://github.com/elastic/kibana/issues/192640
Fixes: https://github.com/elastic/kibana/issues/207077
Fixes: https://github.com/elastic/kibana/issues/197304
Fixes: https://github.com/elastic/kibana/issues/207249
Fixes: https://github.com/elastic/kibana/issues/202761
Fixes: https://github.com/elastic/kibana/issues/202115
Fixes: https://github.com/elastic/kibana/issues/193026
Fixes: https://github.com/elastic/kibana/issues/177304
Fixes: https://github.com/elastic/kibana/issues/208415
Fixes: https://github.com/elastic/kibana/issues/174661
Fixes: https://github.com/elastic/kibana/issues/201611
Fixes: https://github.com/elastic/kibana/issues/182364
Fixes: https://github.com/elastic/kibana/issues/175841
Fixes: https://github.com/elastic/kibana/issues/207907
Fixes: https://github.com/elastic/kibana/issues/171177
Fixes: https://github.com/elastic/kibana/issues/196628
Fixes: https://github.com/elastic/kibana/issues/194703
Fixes: https://github.com/elastic/kibana/issues/207241
Fixes: https://github.com/elastic/kibana/issues/206056
Fixes: https://github.com/elastic/kibana/issues/207328
Fixes: https://github.com/elastic/kibana/issues/205953
Fixes: https://github.com/elastic/kibana/issues/176524
Fixes: https://github.com/elastic/kibana/issues/176335
Fixes: https://github.com/elastic/kibana/issues/207404
Fixes: https://github.com/elastic/kibana/issues/207384
Fixes: https://github.com/elastic/kibana/issues/208380
Fixes: https://github.com/elastic/kibana/issues/207248
Fixes: https://github.com/elastic/kibana/issues/207444
Fixes: https://github.com/elastic/kibana/issues/175240
Fixes: https://github.com/elastic/kibana/issues/178001

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-14 17:17:13 +00:00