**Resolves: https://github.com/elastic/kibana/issues/164441**
## Summary
Skips all Cypress tests owned by
@elastic/security-detection-rule-management and
@elastic/security-detection-engine teams in Serverless using the new
`@skipInServerless` tag.
- Adds a new `@skipInServerless` tag
- Updates `x-pack/test/security_solution_cypress/cypress/README.md` to
explain when to use what tags
- Explicitly adds missing tags to all D&R tests
- Adds `// TODO:` comments to tests with links to follow-up tickets
- Fixes the
`x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts`
script (see below)
Follow-up work:
- https://github.com/elastic/kibana/issues/161540
- https://github.com/elastic/kibana/issues/161539
## Context
> Serverless test failures will soon block PR merge
> During the development of the serverless test infrastructure, we
decided that serverless tests will only soft-fail. That means you see
the test failure in your PR but you're still able to merge. We did that
mainly in order to not block delivery of stateful features and bug fixes
while serverless tests and pipelines were implemented and stabilized.
We now have the major building blocks for the serverless test
infrastructure in place and will integrate serverless tests in our
regular pipelines. As part of this process, we're skipping failing and
flaky serverless tests that came in during the soft-fail phase. Once
this is done, a PR with serverless test failures can no longer be
merged, similar to how we have it for stateful test failures.
> We plan to merge this in the next few days and we'll send out another
notification when it's done.
## Fixing `parallel.ts`
There were two problems with the
`x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts`
script we use for running Cypress tests:
- The script was broken in https://github.com/elastic/kibana/pull/162673
(here on [this
line](https://github.com/elastic/kibana/pull/162673/files#diff-9f40ced6d29c4fc2709af881680400293d8ce1bc9ebb07b9138d6d99c83c09c9R67))
- I think it has never supported situations when all tests matching a
spec pattern (such as
`./cypress/e2e/!(investigations|explore)/**/*.cy.ts`) end up being
skipped via Cypress tags (such as `@skipInServerless`)
Both the issues are fixed in this PR.
Code owners are added for this script in the CODEOWNERS file to prevent
breaking this script in future PRs.
## Summary
Let's revert https://github.com/elastic/kibana/pull/165293 until we
agree on the attributes of the error object that we want to log. Should
they be based on the `EcsError` interface?
## Summary
Part of https://github.com/elastic/ml-team/issues/1019. This PR removes
references to "nodes" in the UI.
- Nodes: # of nodes are removed in the bar stats
- Callout warning are removed
- Node column in Message are removed
- Nodes.name in Details tab are removed
Before
<img width="1382" alt="Screen Shot 2023-09-06 at 11 29 13"
src="4bc2f97a-db3a-4bdc-b9c3-c9530e68eafd">


After
<img width="1355" alt="Screen Shot 2023-09-06 at 11 50 31"
src="d5ce59de-87af-45ad-9186-d6cbdf300366">
### Checklist
Delete any items that are not applicable to this PR.
- [ ] 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/packages/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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] 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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
### Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.
When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:
| Risk | Probability | Severity | Mitigation/Notes |
|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces—unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |
### For maintainers
- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Closes https://github.com/elastic/kibana/issues/163460.
Instead of using the `EuiThemeProvider` to wrap the flyout content,
which added a `span` element causing the footer to not stick to the
bottom of the flyout, I pass `theme$` as a param in `toMountPoint` as
part of the `openFlyout` function available in services. This applies
dark mode support to any other consumer of `openFlyout` and fixes the
footer position issue for both dashboard and visualize listing pages and
preserves the dark mode colors.
<img width="604" alt="Screenshot 2023-09-06 at 12 45 08 PM"
src="c4c569cd-c070-4ab8-9de4-5dd8c5ec8cf8">
### Checklist
Delete any items that are not applicable to this PR.
- [ ] 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/packages/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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] 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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
### Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.
When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:
| Risk | Probability | Severity | Mitigation/Notes |
|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces—unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |
### For maintainers
- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
This PR fixes the serverless cases tests for MKI runs against
Observability and Security projects.
### The issues we were seeing
There were actually two issues where things worked locally but not in
MKI:
* A hard-coded `elastic_serverless` user
* Deleting from system indices directly
### How this PR solves them
* Replace the hard-coded `elastic_serverless` user with the one obtained
via the test config
* Replace deletion from system indices with saved object API `clean`
calls
### Other changes
I've noticed, that the tests are using local helper methods, but
observability and security helper methods were 99.9% the same code. In
order to make the code easier to re-use and also allow usage of other
services from within the helper methods, we recommend putting helper
methods into services. I've refactored the code to do this:
* Create a new serverless API integrations service `svlCases`
* Combine
`x-pack/test_serverless/api_integration/test_suites/observability/cases/helpers/api.ts`
and
`x-pack/test_serverless/api_integration/test_suites/security/cases/helpers/api.ts`
into the `svlCases.api` service
* Combine
`x-pack/test_serverless/api_integration/test_suites/observability/cases/helpers/omit.ts`
and
`x-pack/test_serverless/api_integration/test_suites/security/cases/helpers/omit.ts`
into the `svlCases.omit` service
* Clean up dependencies a bit ( e.g. no need to pass `supertest` around
since `svlCases.api` can load the supertest service on its own now)
This PR skips a flaky serverless observability cases list view test
suite.
Follow-up on #166093, where the `security` version of these serverless
test suite has been skipped.
This PR skips a flaky serverless security cases list view test suite.
#166027 already listed out the flakiness and skipped the corresponding
stateful test.
Closes#165812
## Summary
This PR renames:
- Disk Space / Disk Space Usage to Disk Usage
- Disk Space by Mount Point to Disk Usage by Mount Point
- Disk Space Usage (avg.) to Disk Usage (avg.)
in hosts view table and charts (as well as in the asset details view and
host flyout).
## Testing
Open hosts view and check the [issue
description](https://github.com/elastic/kibana/issues/165812#issue-1883596043)
to see which titles have changed. Example testing steps:
1404b215-bd45-48d7-96ca-ccc3c575123c
## Summary
Closes#165114
Closes https://github.com/elastic/kibana/issues/165368
Unable to create sample data index "kibana_sample_data_flights", error:
illegal_argument_exception Root causes: illegal_argument_exception:
Settings [index.auto_expand_replicas,index.number_of_shards] are not
available when running in serverless mode
<img width="1441" alt="Screenshot 2023-08-30 at 11 21 03 AM"
src="14f580f2-5dff-496f-907c-31007b3904f1">
found in
[logs](https://overview.qa.cld.elstc.co/s/appex/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:'2023-08-30T16:48:55.621Z',to:'2023-08-30T18:27:14.583Z'))&_a=(columns:!(),filters:!(),grid:(columns:(request_method.keyword:(width:814))),hideAggregatedPreview:!f,index:'2e3efa6b-bb9e-48a7-a1b5-af690e556a6b',interval:auto,query:(language:kuery,query:'kubernetes.labels.k8s_elastic_co%2Fproject-id:%20%22d660f827d17a4e3f9662d473461c099c%22%20'),sort:!(!('@timestamp',desc)),viewMode:aggregated))
in the message field when filtering by project by
kubernetes.labels.k8s_elastic_co/project-id:
"d660f827d17a4e3f9662d473461c099c"
- [x] TODO set up FTR that should have caught this to confirm this fix
works in serverless environments (based off the home page object)
---------
Co-authored-by: Sébastien Loix <sebastien.loix@elastic.co>
Resolves https://github.com/elastic/kibana/issues/162873
Resolves https://github.com/elastic/kibana/issues/165453
Integrates Change point detection chart in the Custom threshold alert
details page. A new tab "Related Events" is added.
The time range to find change points is calculated as follows: Start
time = Alert start time - 2 x rule interval, End time = alert last
updated time.
<img width="1903" alt="Screenshot 2023-09-05 at 14 21 33"
src="d2364321-e4a1-43a3-b6e5-1869c06a976c">
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Closes https://github.com/elastic/kibana/issues/165888
Move "delete policy" action from a button on the policy settings screen
to an action button on the agent policy list and in the "Actions" menu
on the policy details page. This aligns the delete action with other
Elastic/Kibana products, and with how we treat deletion for other
resource types.
<img width="592" alt="image"
src="0e893d34-fb80-4b40-933f-5c1145ab92e1">
<img width="665" alt="image"
src="fdcf76c3-2e29-4912-99de-3738c2cbbddb">
If an agent policy contains a managed package policy, the delete option
will be disabled with a tooltip, e.g:
<img width="514" alt="image"
src="d59226ab-a603-4a7f-80fd-9004382361f0">
I'd like to see if I can write a basic test case for the disabled logic
at least before this PR lands.
### Checklist
Delete any items that are not applicable to this PR.
- [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/packages/kbn-i18n/README.md)
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
closes [#164300](https://github.com/elastic/kibana/issues/164300)
## Summary
This PR enables state propagation between asset details flyout and full
page view.
7e05a3c9-afa1-447c-98fd-91c40ee6cefb
There are other places in Kibana that redirect to node details outside
the infra plugin such as APM and Observability/Overview. They use the
`link-to/${assetType}-detail` path, so It's best, for now, to keep
retro-compatibility with this route and propagate the state via query
string.
I've also refactored how we were persisting state via route navigation,
to use native the `state` attribute found in the `location` object from
`react-router`
### How to tests
- Start a Kibana instance
- Navigate to `Infrastructure` > `Host`
- Open the flyout, click in one of the tabs, and click on "Open as
Page". The page should open in the same state as the flyout.
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
closes: https://github.com/elastic/kibana/issues/146603
Introduce the telemetry service in APM which wraps the analytics module.
### New event-type telemetry
Event type: `Search Query Submitted`
Payload:
```json
{
"kuery_fields": ["service.name", "service.name", "span.id"],
"timerange": "2022-09-02T22:00:00.000Z - now+24h",
"action": "refresh"
}
```
In addition to the custom properties, core sends context properties. See
all the fields [here](
https://docs.elastic.dev/telemetry/collection/event-based-telemetry-context)
e1e9a02c-b010-49f3-be8c-4ab2817d5845
### Notes
- Timerange: For the visualizations and the analysis the current format
might not be the best.
TODO
- [x] Update documentation
- [x] Add tests
- [x] Check visualizations
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Closes#165098
## Summary
This PR fixes an issue with the optional filter component (the user is
not able to clear the prefilled input - described in [the
issue](https://github.com/elastic/kibana/issues/165098#issue-1871701462))
-
[commit](57b43b6ef9).
I saw deprecated styled components used in the component I was adding
the fix so I also fixed those - in case there is a valid reason to keep
the old version I can remove the [second
commit](351d997cb6).
## Testing
Open create alert rule flyout from the Inventory page
- Create a rule without the optional filter
- Create a rule with a new optional filter
Open create alert rule flyout from the Hosts view page
- Create a rule without the optional filter
- Create a rule with a new optional filter
8e9fb3f6-4774-4e06-9f49-16b83a60b7b6
## Summary
When I created the text based editor, the resizable button was not
exported from EUI so I had to create my own custom solution. It was
recently been exported and merged in kibana so now we can remove the
custom solution and use the EUI component instead!
https://github.com/elastic/eui/issues/6100
## Summary
Adds a callout to Discover table, indicating the number of selected vs
available columns. This is very useful in a case like `from * | keep *`
which returns a big number of fields. In that case we only select and
display in the table the first 50 columns.
<img width="1315" alt="image"
src="72c7cc75-bbd7-446f-a9cb-cbb0d8982274">
### 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/packages/kbn-i18n/README.md)
- [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: Matthias Wilhelm <ankertal@gmail.com>
## Summary
Updated the grok debugger and painless lab plugins to handle the
`enabled` config flag so they can easily be disabled for serverless
search.
### Screenshots
Before:

After:
<img width="1914" alt="image"
src="ad48ba1b-0f1d-4da3-aeac-4868781f6832">
## Summary
This PR adds a performance journey test for the Index data visualizer,
using the Kibana TSDB logs.
To run test:
```
node scripts/run_performance.js --journey-path x-pack/performance/journeys/tsdb_logs_data_visualizer.ts --skip-warmup
```
### Checklist
Delete any items that are not applicable to this PR.
- [ ] 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/packages/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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] 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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
### Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.
When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:
| Risk | Probability | Severity | Mitigation/Notes |
|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces—unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |
### For maintainers
- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Walter Rafelsberger <walter.rafelsberger@elastic.co>
Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>