Commit graph

85675 commits

Author SHA1 Message Date
Anton Dosov
ef0322d8d0
[jest] @emotion/babel-preset-css-prop (#216489)
## Summary

Partially address https://github.com/elastic/kibana/issues/216459

This PR adds `@emotion/babel-preset-css-prop` to jest config to improve
jest and emotion integration. There are some tradeoffs: this is a better
setup for emotion + testing library, but there are some seemingly
regressions for enzyme. We think these are right tradeoffs to make,
since we optimize for emotion+testing library.

### Main upsides are 😄 

#### 🟢 Fixes snapshots with css prop

`You have tried to stringify object returned from \`css\` function. It
isn't supposed to be used directly (e.g. as value of the \`className\`
prop), but rather handed to emotion so it can handle it (e.g. as value
of \`css\` prop).` is replaced with proper emotion css classname.

![Screenshot 2025-04-04 at 14 57
52](https://github.com/user-attachments/assets/f4a746d6-2451-4703-ab39-57be7171b10b)

#### 🟢 We will be able to use jest style matchers for emotion
`toHaveStyleRule`

https://emotion.sh/docs/@emotion/jest#tohavestylerule

_they can be used locally now, but we plan to follow up with global
extend_

###  Considerations 🫤  

#### 🟡 jsx doesn't work inside jest.mock function 

Example: 

```
jest.mock('./components/alert_header_title', () => ({
    > 27 |   AlertHeaderTitle: jest.fn().mockReturnValue(<div></div>), 
         |                                                                           ^
      28 | }));
```

Fails with an error. `can't read jsx of undefined`. 

This is because babel compiles this into: 

```
import { jsx as ___EmotionJSX } from '@emotion/react'

jest.mock('./components/alert_header_title', () => ({
    > 27 |   AlertHeaderTitle: jest.fn().mockReturnValue(___EmotionJSX.jsx(….)), 
         |                                                                                   ^
      28 | }));
```

And, apparently, due to how jest imports work, __EmotionJSX is not yet
in the scope.

The applied workaround is to rewrite to: 

```
jest.mock('./components/alert_header_title', () => ({
  AlertHeaderTitle: jest.fn(() => <div></div>), 
     }));
```


#### 🟡 euiTheme needs to be available when euiTheme is accessed inside
`css` function

Example: 

```
DashboardGrid removes panel when removed from container
    TypeError: Cannot read properties of undefined (reading 'size')
      42 |     margin: '-2px',
      43 |     position: 'absolute',
    > 44 |     width: euiTheme.size.l,
```

The fix was to wrap failing tests with `<EuiProvider/>` 

### Drawbacks 😢 

Mostly related to Enzyme 

#### 🔴  Enzyme shallow snapshot no longer include `css` prop 

Since `css` prop is compiled away there are bunch of snapshots that
looks like a regression:

Example:

![Screenshot 2025-04-04 at 15 50
16](https://github.com/user-attachments/assets/61c1d027-1e8a-48e6-a242-1fa53f8ec9b7)

This is unfortunate. We've tried `@emotion/jest/enzyme-serializer` but
it didn't work (likely because enzyme ecosystem no longer supported?)
If it is important that the snapshot captures css, we recommend to use
mount or rtl

#### 🔴 Asserting against `css` prop with shallow render also doesn't
work

Possible solution is to use 

```
import { matchers } from '@emotion/jest';
expect.extend(matchers);
```

(We plan to add these matches globally in a follow up)

and 

```
 expect(button).toHaveStyleRule('background-color', '#FFFFFF');
```



#### 🔴 Some shallow Enzyme tests `find()` breaks because of code
transformations of emotion

Example:

```
const component = shallow(
      <MetricVisValue />
)

component.find('button') // fails because instead of <button/> there is <EmotionInternalCss/> element now 

```

Solutions:
- Use full mount or react testing library 
- Or target by data-test-subj

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Karen Grigoryan <karen.grigoryan@elastic.co>
2025-04-14 14:29:47 +02:00
Kibana Machine
478011f3a8
[ES|QL] Update grammars (#218046)
This PR updates the ES|QL grammars (lexer and parser) to match the
latest version in Elasticsearch.

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2025-04-14 14:27:44 +02:00
Marco Antonio Ghiani
d46a89e4a5
[Streams 🌊] Update condition editor enabling and fixes (#218055)
## 📓 Summary

Closes #217884 

- Updates the condition editor to have a more consistent behaviour for
enabled/disabled routing.
- A more explicit tooltip is added to describe how the status flag
affects the routing behaviour.
- The status switch is visible by default, while before it was shown
only in edit mode for a routing condition.
  - Fixed crashes when manually working on the syntax editor.
- Removes the routing status flag from the condition editor in the
processors' config.

<img width="763" alt="Screenshot 2025-04-14 at 10 23 42"
src="https://github.com/user-attachments/assets/8521739a-ac53-4751-9ad3-4400a84c5a8d"
/>
2025-04-14 14:25:46 +02:00
Francesco Fagnani
89e385ec96
[Synthetics] Enable KQL filter for TLS rules (#216973)
This PR follows #215110 by enabling the KQL filter for TLS alerting
rules and closes #214346.
2025-04-14 14:24:31 +02:00
Stratoula Kalafateli
3ac4ac5b57
[ES|QL] Fixes the broken tooltip suggestions descriptions (#218067)
## Summary

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

Fixes the descriptions problem in some markdown texts in the editor (the
markdown is correct)

![image
(93)](https://github.com/user-attachments/assets/0b2c9d75-1933-4345-8a2d-aae9a2c778c9)
2025-04-14 14:17:33 +02:00
Jean-Louis Leysens
c10cd622e2
[SO] Harden structural selection logic (#218073)
## Summary

Adds a basic sanity check before pulling a value from the target object.
Under the hood `lodash` will drive this check by running `Object.
hasOwnProperty` for each segment of the path we are querying. Guards
against theoretical attacks from SOs that might allow ill-defined
structures in documents.


### 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
2025-04-14 14:06:35 +02:00
Pablo Machado
47090f198e
[SecuritySolution] Bootstrap Initial Privileges User Monitoring Onboarding Workflow (#217180)
## Summary

Bootstrap the initial page structure for Privileges User Monitoring
Onboarding Workflow

### What's included
* Create Entity Analytics Page
* Create Privileged User Monitoring Page
* Add the pages to the SecuritySolution and the global menu
* Hide the page when the experimental flag is disabled
`privilegeMonitoringEnabled`

### What's not included
* The content of the Entity Analytics and Privileged User Monitoring
pages

### Answered Questions
* The path `entity_analytics` has already been taken. I chose
`entity_analytics_landing`
* Should the link show up on the global EA page? Yes
* Navigation Menu for ESS? Good for now
* Which permission/capabilities are required? Same as risk engine

### How to test it?
* You only need to run Kibana and check if the navigation item is in the
menu
* The page should show up on the global nav
* The page should show up on the global search bar

* Visibility constraints
  * It should be hidden when `privilegeMonitoringEnabled` is not enabled
* It should be visible when the user has access to the entity analytics
feature
  * It should be visible for platinum users


### 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)
- [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-04-14 13:26:11 +02:00
Joe Reuter
f3042efa8f
🌊 Streams: Fix listing page for orphaned streams (#217854)
The listing page didn't handle "orphaned" streams properly (classic data
streams which have a configuration on the stream level but the
underlying data stream is not available because it got deleted).

This PR fixes that and adds an integration test for it

<img width="774" alt="Screenshot 2025-04-10 at 16 07 15"
src="https://github.com/user-attachments/assets/da15c56b-7dbd-4070-ab6d-4235132da8ed"
/>

In this picture, `logs-test-default` is orphaned.

To test:
* Create a new classic stream (e.g. via executing
```
POST logs-mylogs-default/_doc
{ "message": "Test" }
```
* Go into the streams UI and add a processor for this stream
* Delete the data stream via stack management or via
```
DELETE _data_stream/logs-mylogs-default
```
* Go to the streams listing page
2025-04-14 13:24:33 +02:00
elastic-vault-github-plugin-prod[bot]
574ef298f2
[main] Sync bundled packages with Package Storage (#218016)
Automated by
https://buildkite.com/elastic/package-storage-infra-kibana-discover-release-branches/builds/2616

Co-authored-by: elasticmachine <elasticmachine@elastic.co>
Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
2025-04-14 13:24:18 +02:00
Arturo Lidueña
8dc8e931b7
[Obs-AI-Assistant] Audit log level (#217645)
part of [[Meta] Audit log level in observability
plugins](https://github.com/elastic/observability-dev/issues/4373)
2025-04-14 13:06:45 +02:00
Shahzad
92556a37a7
[FTR] Added pause on error when error happens !! (#216165)
## Summary

Added pause on error when error happens !!

<img width="1728" alt="image"
src="https://github.com/user-attachments/assets/1d649224-64a0-4a22-b526-9fdbd348efb0"
/>

---------

Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
2025-04-14 13:02:16 +02:00
Stratoula Kalafateli
708917df6e
[ES|QL] Adds license knowledge to the editor (#217796)
## Summary

Part of https://github.com/elastic/kibana/issues/216791

- Suggests remote indices if ES license plugin enables it 

<img width="580" alt="image"
src="https://github.com/user-attachments/assets/a237f646-286e-489c-b41b-a1ce7d82440a"
/>



- Doesn't suggest remote indices for basic license
<img width="292" alt="image"
src="https://github.com/user-attachments/assets/2bc9e512-91ab-4b20-94ce-d1931732567e"
/>


### Checklist

- [ ] [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-04-14 12:52:10 +02:00
Alex Szabo
a1a0d3462d
[ci] increase inspector limit to allow for recent updates (#218053)
## Summary
It seems there's been some sort of unintended bundle limit branch
through 2 minor changes (greenlit separately on PRs) - and this one
broke the camel's back: https://github.com/elastic/kibana/pull/212163
2025-04-14 10:56:32 +02:00
Tim Sullivan
584875e666
[Core] Update RenderingService withaddContext public method (#212163)
## Summary

Epic: https://github.com/elastic/kibana-team/issues/1435
Closes https://github.com/elastic/kibana/issues/205413
Closes https://github.com/elastic/kibana/issues/205411

This PR creates a new way to expose stateful service dependencies needed
for rendering React elements in Kibana. The concept of the changes is
that `KibanaRenderContextProvider` should not be a shared module, but
should be wrapped by a core service (the `RenderContextService` name is
TBD). The next steps in this direction would be to coordinate teams to
migrate away from directly using `KibanaRenderContextProvider`.

### Background

Today, the dependencies for `KibanaRenderContextProvider` are declared
as separate services which can be found in the `CoreStart` context. This
has created a situation where enhancing the module with more
dependencies creates widespread changes needed for the UI codebase.

The @elastic/appex-sharedux team is looking to solve this situation by
defining a less impactful way to make future enhancements. The solution
is one that can be gradually migrated towards, so the SharedUX team can
ask Kibana contributors to migrate towards in their own code. This PR
offers a POC for that solution.

### Details of this POC

The driving goal for this refactor is to lessen the impact across the
Kibana codebase whenever the `KibanaRenderContext` module needs to
require additional services from the `CoreStart` context.

#### Rendering a React Element with `ReactDOM.render`: Before
```tsx
const renderApp = ({ core, targetDomElement }: { core: CoreStart; targetDomElement: HTMLElement; }) => {
  // If `KibanaRenderContextProvider` needs to expand its scope, more services could be needed here,
  // updating all the places throughout the code to pass those is a ton of work 👎🏻 
  const { i18n, theme, analytics, userProfile, executionContext } = core;
  ReactDOM.render(
    <KibanaRenderContextProvider {...{ i18n, theme, analytics, userProfile, executionContext }}>
      <MyApplication />
    </KibanaRenderContextProvider>,
    targetDomElement
  );
  return () => ReactDOM.unmountComponentAtNode(targetDomElement);
};
```

#### Rendering a React Element with `ReactDOM.render`: After

```tsx
const renderApp = ({ core, targetDomElement }: { core: CoreStart; targetDomElement: HTMLElement; }) => {
  // So much less code, so much more future-proof 👍🏻 
  ReactDOM.render(core.rendering.addContext(<MyApplication />), targetDomElement);
  return () => ReactDOM.unmountComponentAtNode(targetDomElement);
};
```

### Alternatives considered

See https://github.com/elastic/kibana/pull/209161

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### FAQ

1. **Q**: This is React-centric. Does this give Kibana more commitment
towards React?
**A:** For now, yes. But if we want to Kibana to remain
framework-agnostic we may be able to add more extensions to the
RenderContextService that support other frameworks.
1. **Q:** Why not have a service that wraps `ReactDOM.render`?
**A:** As we steer towards upgrading to React 18 in Kibana, staying
agnostic of how React is rendered benefits us. React 18 has different
ergonomics based on whether you want to update an existing tree or mount
a new one.
1. **Q:** Does the API have to be named `rendering.addContext`?
**A:** No, it does not. Please suggest a better name if you have one in
mind.
1. **Q:** What are the next steps?
**A:** Refer to the
[Epic](https://github.com/elastic/kibana-team/issues/1435). This PR
started as a POC but became ready for merge. After it is delivered to
the codebase, the next steps are to improve documentation and engage in
"sheparding." That is, socialize the new way of injecting dependencies
into the context, support teams in their migration, and track the
progress of migration.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [x] Care is needed to ensure this doesn't not negatively impact
performance with unnecessary re-renders.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-12 00:23:40 +02:00
Meghan Murphy
c2f34954fb
[M1 Salesforce] add search and get tools (#217258)
## Summary

This PR adds the integration's 'search' and 'get' tools as part of the
Workchat architecture.

Also added some refactoring for building queries :) 


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

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

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jedr Blaszyk <jedrazb@gmail.com>
2025-04-11 16:41:47 -04:00
Lukas Olson
ff34965cc4
[Discover] Use search cache when returning to a tab (#216742)
## Summary

Resolves https://github.com/elastic/kibana/issues/214871.
Related to https://github.com/elastic/kibana/issues/216475.

This PR updates the behavior when returning to an existing tab in
Discover to re-use the `searchSessionId` that was used prior to
switching tabs. This has the effect of utilizing the
`searchResponseCache` that is part of the data plugin, effectively
making it so we don't re-issue the data requests:


https://github.com/user-attachments/assets/9ffea23f-bc7d-4d39-90f2-57313d6f1e56

### Checklist

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

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
2025-04-11 11:16:14 -07: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
Joe Reuter
77ff3c2f62
🌊 Enable streams in the UI for serverless observability (#215533)
# Only merge this if you want streams to go public

This PR changes the logic for the client side "status$" observable for
streams to look for whether it's on serverless in an observability
project (because this is where we want to launch first).

Later on, this logic can be adjusted as necessary for on-prem launches
etc.

To make this work locally, you need to add
`xpack.cloud.serverless.project_id: "project_id"` to your
`config/kibana.dev.yml`

It still shows the streams app if wired streams are enabled (basically
it keeps the old behavior plus always defaulting to `enabled` if it's an
observability serverless project.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-11 18:53:10 +02:00
elastic-vault-github-plugin-prod[bot]
e0f106f1b7
[main] Sync bundled packages with Package Storage (#217539)
Automated by
https://buildkite.com/elastic/package-storage-infra-kibana-discover-release-branches/builds/2596

---------

Co-authored-by: elasticmachine <elasticmachine@elastic.co>
Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
2025-04-11 17:21:29 +02:00
Jill Guyonnet
5c78ff1848
[Fleet] Reuse shared integration policies when duplicating agent policies (#217872)
## Summary

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

Currently, when an agent policy is duplicated, shared integration
policies are also duplicated. This PR adds logic where the duplicated
agent policy also shares these integration policies.

### Testing

* Run ES with an [Entreprise
license](https://www.elastic.co/subscriptions) to avail of reusable
integration policies.
* Create an agent policy with a shared integration policy and a
non-shared integration policy.
* Duplicate the agent policy: the duplicated policy should only
duplicate the non-shared integration policy and the shared integration
policy should be reused.

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

### Identify risks

Incorrect package policies in duplicated agent policies.
2025-04-11 17:16:17 +02:00
Alex Szabo
a3766fd1ef
[CI] Also download FIPS artifacts before validating (#217986)
## Summary
Attempts to fix:
https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/5949#01962428-99a7-4481-8b8b-95685d1d4d79

The step was trying to validate cloud fips artifacts (after:
https://github.com/elastic/infra/pull/42268) but these were never
downloaded in that step.
2025-04-11 08:19:28 -06:00
Kibana Machine
10b7669436 skip failing test suite (#204139) 2025-04-11 16:17:13 +02:00
Kibana Machine
eca817466b skip failing test suite (#207913) 2025-04-11 16:01:31 +02:00
Julia Rechkunova
f7f3ce8654
[Discover Tabs] Enable tabs reordering with drag & drop (#216013)
- Closes https://github.com/elastic/kibana/issues/210510
- Closes https://github.com/elastic/kibana/issues/217121
- Closes https://github.com/elastic/kibana/issues/201107

## Summary

This PR adds drag&drop support for reordering tabs.

With mouse:
![reordering with
mouse](https://github.com/user-attachments/assets/47de2903-e4ff-4da2-b5c5-af74b330983a)


With keyboard (press "Space" and then "Arrow Left"/"Arrow Right" and
complete with "Space"):
![reordering tabs with
keyboard](https://github.com/user-attachments/assets/8921261d-2203-497b-a18a-6a07b8678196)

Also I changed how "Tab" navigation is working. Now pressing "Tab" will
select the active tab, next "Tab" will navigate outside of the tabs
group instead of focusing the next tab. This seemed to align better with
the instruction I saw for tabs a11y
https://www.w3.org/WAI/ARIA/apg/patterns/tabs/

Navigating between tabs is possible within tabs group with "Arrow
Left"/"Arrow Right". This will also switch the content accordingly.

![switching tabs with
keyboard](https://github.com/user-attachments/assets/cf68e2a8-d688-4068-98a2-1f441e84cb2b)


## Testing

Three options are possible:

1. start Storybook with `yarn storybook unified_tabs` and navigate to
`http://localhost:9001`.
2. start Kibana with `yarn start --run-examples`. Then navigate to the
Unified Tabs example plugin
`http://localhost:5601/app/unifiedTabsExamples`.
3. edit the flag to `true` in
bf7de0e6b9/src/platform/plugins/shared/discover/public/application/main/discover_main_route.tsx (L38)
and open Discover

### 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
2025-04-11 16:00:29 +02:00
George Wallace
db555fdebf
Removing Italics from links (#217926) 2025-04-11 07:55:35 -06:00
Maxim Kholod
8f83ae23ff
remove Cloud Security Posture team from codeowners of serverless config.feature_flags.ts (#217982)
Removing Cloud Risk Apps team from the owners of serverless tests config
file
2025-04-11 15:20:00 +02:00
Marco Liberati
6984530aa0
[Expression] Cached expression can keep their own side effects (#216519)
## Summary

Fixes the #207204 

This PR introduces a new complementary function for an Expression
definition named `sideEffects`, this goes together with the other `fn`
function and it is used to restore any side effect when the caching
system kicks in.


![side_effects_cache](https://github.com/user-attachments/assets/74b1ddff-a45c-4983-ac09-57559155fba8)

I haven't found how to programmatically test this.
Will add an FTR if it can be reliable to reproduce an expression caching
scenario.

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

### Release notes

The request inspector now shows the correct request and response in any
successful scenario.
2025-04-11 14:50:47 +02:00
Tiago Vila Verde
1bf39845da
[Entity Analytics][Privilege Monitoring] Engine initialization API (#215663)
## Summary 

This PR introduces the first building blocks for the [Entity Analytics
Privileged
Monitoring](https://github.com/elastic/security-team/issues/9971).
We follow the approach used in the Entity Store and add a new "Engine",
which consists of the following components:
* Public API
  * INIT and HEALTH routes
* Kibana task 
* Privilege Monitoring Data Client
* Engine Saved Object
* API key manager
* Related storage indices
* Feature Flag: `privilegeMonitoringEnabled` set to `false` by default.
* API integration test configuration
  * only tests that the health endpoint is available
* Auditing and Telemetry 


## Testing steps

1. Make sure to add `privilegeMonitoringEnabled` to your
`kibana.dev.yaml`
2. In devtools, ensure the API is working with `GET
kbn:/api/entity_analytics/monitoring/privileges/health`
3. Start the engine with: `POST
kbn:/api/entity_analytics/monitoring/engine/init`
4. Look for `DEBUG` logs mentioning the
`entity_analytics:monitoring:privileges:engine` task

---------

Co-authored-by: CAWilson94 <charlotte.wilson@elastic.co>
Co-authored-by: Charlotte Alexandra Wilson <CAWilson94@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-11 13:25:24 +02:00
Georgii Gorbachev
b4d3a2a8f2
[Security Solution] Remove hardcoded ids of preconfigured connectors from Security Solution Cypress tests (#217847)
## Summary

[Preconfigured
connectors](https://www.elastic.co/guide/en/kibana/current/pre-configured-connectors.html)
are those that are specified via the `kibana.yml` config, and thus they
can't be deleted. In tests, we've hardcoded their ids to skip deleting
them when we need to clean up the tests' state.

Sometimes, the id of a preconfigured connector gets changed by somebody,
which breaks tests of multiple teams in MKI pipelines, such as the
periodic pipeline or the release quality gates. The problem is that it
doesn't happen on CI where Kibana doesn't have any preconfigured
connectors, so this feedback loop is too long. When tests in an MKI
pipeline break, it's not immediately clear what happened and who should
fix it. Eventually it gets fixed by someone [like
this](https://github.com/elastic/kibana/pull/217570/files).

Instead of hardcoding the ids, we should dynamically determine if a
connector is preconfigured and if it should be deleted by a test or not.
This is possible to do as each connector has the corresponding
`is_preconfigured` property.

<img width="1073" alt="Screenshot 2025-04-10 at 14 16 15"
src="https://github.com/user-attachments/assets/e330cd5f-c9f0-43da-b4b4-f2a0a2fd10a5"
/>

### 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
- [ ] [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-04-11 12:47:23 +02:00
Kerry Gallagher
4f131cf6fd
[Streams] Fix invalid mapping parameter (#217940)
## Summary

Fixes https://github.com/elastic/kibana/issues/217935 (in the quickest
way possible for now).

## Possible followups

- We could potentially move these advanced parameters to a sub object.
However, the idea was that `FieldDefinitionConfig` utilises a union of
`MappingProperty` (from ES) so that this wasn't needed 🤔

- The types can definitely be improved (`getAdvancedParameters` takes in
`fieldConfig: FieldDefinitionConfig` and this missed the possibility of
`InheritedFieldDefinitionConfig`, for example). We could also make the
stripping schema driven.
2025-04-11 11:28:38 +01:00
Marco Antonio Ghiani
7812de377e
[Streams 🌊] Update link to management (#217942)
## 📓 Summary

Fixes a link targeting the overview page while it should have gone to
the management section.
Also fixes broken redirect when targeting `/{key}/management`
2025-04-11 12:26:04 +02:00
Pierre Gayvallet
cb5ae3a483
[workchat] correctly persist failing tool calls (#217936)
## Summary

- Fix a bug that was causing failing tool invocations to not being
persisted to the conversation history, corrupting the conversation for
following rounds.
- Optimize the researcher's prompts (leading to ~50% latency cut, mostly
on the summarization step)
2025-04-11 11:26:24 +02:00
Giorgos Bamparopoulos
5fbe1c01c8
Fix typo in the reroute pipeline description (#217894)
Fix typo in the reroute pipeline description
2025-04-11 10:56:20 +02:00
Georgiana-Andreea Onoleață
afc5274fb8
[ResponseOps][Rules]Hide rule actions instead of disabling them in the rules list (#216783)
Closes https://github.com/elastic/kibana/issues/210979

## Summary

- This PR updates the rules list and rules details pages to hide actions
for the users with read-only access. Previously, these actions were
disabled, but now they are completely hidden. Specifically:
- on the `Rules List` page, the snooze bell icon and the table row
actions are now hidden for the users with read-only access
- on the `Rule Details` page, the actions button is now hidden
(previously, the users could click on it, but the options were disabled)
    
<img width="1899" alt="Screenshot 2025-04-02 at 14 06 53"
src="https://github.com/user-attachments/assets/712297bf-b807-4ecc-87da-a32cd67d169f"
/>

<img width="1899" alt="Screenshot 2025-04-02 at 14 07 06"
src="https://github.com/user-attachments/assets/a88762fa-feeb-4117-9dc4-31744c752d82"
/>
2025-04-11 11:52:35 +03:00
Sergi Romeu
429a9db67d
[APM][Cypress] Attempt to fix mobile transactions test (#217648)
## Summary

Closes #207040
2025-04-11 10:28:49 +02:00
Alejandro Fernández Haro
f7e9b4c591
[ES 9.0] Remove body workaround (@elastic/response-ops) (#217216) 2025-04-11 10:27:29 +02:00
Jill Guyonnet
2231ba624f
[Fleet] Sync uninstalled integrations typo fix (#217875)
## Summary

Quick followup to https://github.com/elastic/kibana/pull/217144 to fix
the typo reported in
https://github.com/elastic/kibana/pull/217144#discussion_r2037503127 (I
had auto-merge enabled and the PR got approved before I pushed the fix
🙈).
2025-04-11 09:26:43 +02:00
Pierre Gayvallet
d9d9fba3d6
[workchat] add tracing configuration (#217825)
## Summary

Allow enabling langsmith tracing via kibana config file

### Example

```yaml
xpack.workchatApp.tracing.langsmith:
  enabled: true
  apiKey: {API-KEY}
  project: {project-name}
```
2025-04-11 08:11:27 +02:00
Kibana Machine
3068c83f9c
[api-docs] 2025-04-11 Daily api_docs build (#217934)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/1039
2025-04-11 08:05:00 +02:00
Lisa Cawley
3908dc8b29
[DOCS] Use new responseOps URLs in doc link service and APIs (#217601) 2025-04-10 17:18:12 -07:00
Lisa Cawley
388a6fcfbd
[DOCS] Fix path to images in connector docs (#217920) 2025-04-10 17:16:06 -07:00
Rodney Norris
0f79990912
refactor(search_playground): prep for saved playgrounds (#217251)
## Summary

Renaming types and files as well as moving providers around to make
implmentating saved playground routes more straightforward. Naming
updates to reduce future confusion from generic names that didn't fit
when there are multiple providers etc.
2025-04-11 01:20:09 +02:00
José Luis González
3485e52340
[Search][Query Rules] Rule sets filtering search (#217477)
## Summary

Search filtering over the query rulesets table:

![CleanShot 2025-04-09 at 10 25
00@2x](https://github.com/user-attachments/assets/78be7842-f892-454d-a01e-50dee27bdf18)

[Jira ticket](https://elasticco.atlassian.net/browse/SEARCH-928)


### 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
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-04-11 00:09:00 +02:00
Kibana Machine
51074fc9cc skip failing test suite (#217739) 2025-04-11 00:07:54 +02:00
Kibana Machine
4bc9524aad skip failing test suite (#144057) 2025-04-10 22:31:30 +02:00
Tiago Costa
4408a0c536
skip flaky suite (#214053) 2025-04-10 21:29:29 +01:00
Kibana Machine
cb55321ada skip failing test suite (#181977) 2025-04-10 22:28:26 +02:00
Tiago Costa
e7a04661f4
skip flaky suite (#217012) 2025-04-10 21:27:09 +01:00
Tiago Costa
bed0cb4462
skip flaky suite (#214862) 2025-04-10 21:25:39 +01:00
Alison Goryachev
8c8ccbb3ea
update codeowners file + add data_usage readme (#216486) 2025-04-10 21:35:36 +02:00