Commit graph

32354 commits

Author SHA1 Message Date
Kevin Delemme
6f0443f932 Fix tests 2023-07-28 13:21:59 -04:00
Kevin Delemme
c0f6e53af2 Update documentation 2023-07-28 13:21:59 -04:00
Kevin Delemme
f78c523d57 feat(slo): Use summary search index with temporary documents (#162511) 2023-07-28 13:21:57 -04:00
Kevin Delemme
473b9a4a7c feat(slo): Update search with the new summary data (#162336) 2023-07-28 13:18:46 -04:00
Kevin Delemme
b760b2cbed feat(slo): Add more fields into the rollup and summary data (#162075) 2023-07-28 13:18:45 -04:00
Kevin Delemme
d9f098f210 Improve time window handling and validation (#161978) 2023-07-28 13:18:45 -04:00
Kevin Delemme
8721978c5b Always bump revision on update (#161897) 2023-07-28 13:18:45 -04:00
Kevin Delemme
b1cfbbd673 feat(slo): Add summary transform for rolling slo (#161698) 2023-07-28 13:18:42 -04:00
Kevin Delemme
39af36782e feat(slo): Add more data in SLO rollup index (#161392)
Resolves https://github.com/elastic/kibana/issues/161393

## Summary

This PR is the first of a series to implement the summary and search
improvement feature on SLO.
Every PR will be merged against the feature branch:
`slo/feature-branch`. And we'll update this feature branch with main as
often as possible to keep conflict as a minimum.

This PR changes the SLO rollup index mapping, adding more fields to it,
that we are going to use to summarize the SLO rollup data later.
It also includes the SLO summary index templates (mappings, settings,
template) and install them with the other templates.

Since this is a **breaking change**, any SLO running will be shown as
`NO_DATA`. You can remove the SLO through the API or the UI, or update
them (make sure you change something significant (time window, indicator
params, ...) in order to induce a revision bump) so the underlying
transform is recreated using the new index structure.
2023-07-28 12:52:04 -04:00
Clint Andrew Hall
477505a2dd
[context] Unify Contexts, deprecate others (#161914)
> Pre-req for https://github.com/elastic/kibana/issues/56406

## Summary

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

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

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

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


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

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

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

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

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

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

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

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

## Next steps
- [ ] Update deprecated uses to new contexts.
- [ ] Audit and update calls to `ReactDOM.render`.
- [ ] Add ESLint rule to warn for use of EUI contexts.
- [ ] Delete code from `kibanaReact`.
2023-07-28 09:30:08 -07:00
Faisal Kanout
0ecc28b3f2
[AO] Make "Alert me if there's no data" always active and remove the checkbox from the UI (#162559)
## Summary
It fixes https://github.com/elastic/kibana/issues/161005 by removing the
checkbox for `Alert me if there's no data` and make it always active
2023-07-28 18:10:12 +02:00
Dario Gieselaar
f0ebb7097d
[Observability AI Assistant]: Move to new plugin, update design and use connectors (#162243)
This PR makes the following changes:

- Update look & feel of contextual insights (previously called prompts)
according to the new design that is being developed. Some things might
still change, but hopefully not too much.
- Move all the Observability AI Assistant (previously called CoPilot)
code into a separate plugin for better isolation, more specific code
ownership and to solve some circular dependency issues
- Use connectors instead of a kibana.yml setting

Note: for OpenAI, the model is currently hardcoded to `gpt-4` until
https://github.com/elastic/kibana/issues/162204 has been addressed.


557676b6-065a-4b6f-86b2-1f0c2fd5e07e

---------

Co-authored-by: Coen Warmer <coen.warmer@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-28 11:52:00 -04:00
Francesco Gualazzi
ecb7f3eaf7
Profiling: get rid of apm policy modifications (#162663)
## Summary

Remove apm-related configurations from the Universal Profiling setup
logic.


Signed-off-by: inge4pres <francesco.gualazzi@elastic.co>
Co-authored-by: Joseph Crail <joseph.crail@elastic.co>
2023-07-28 17:44:56 +02:00
James Gowdy
716ecb8a04
[ML] Log pattern analysis field validation (#162319)
Uses the recently created [category validation
package](https://github.com/elastic/kibana/pull/161261) to perform
validation on the field selected for pattern analysis.

If the field is considered unsuitable for categorization, a warning
callout is displayed which lists the reasons it is unsuitable.
If the field is suitable, no callout is displayed.

Other changes:
- Adds the selected field to the URL state, so it is remembered on page
refresh.
- If no field is in the URL, it will look for a field called `message`
in the data view and auto select it.
- renames the ML route `/jobs/categorization_field_examples` to
`/jobs/categorization_field_validation` as it is a more accurate name
and it's consistent with the newly added route in AIOPs.

**Log Pattern Analysis page in ML**


![image](c0dfda8b-bc34-48b7-9e71-8bae9e65bdf3)


**Log Pattern Analysis flyout in Discover**


![image](b4d251f3-bae6-424f-9891-bda57ba1673d)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-28 16:44:23 +01:00
Maryam Saeidi
9584a3ae0d
[AO] Use data view timestamp in the new threshold rule (#162542)
Closes #159777

## 📝 Summary 

In this PR, I changed the timestamp used in rule execution and the
preview chart of the new threshold rule.

I created a separate ticket
(https://github.com/elastic/kibana/issues/162560) to implement
`infra/metrics_explorer` in the observability plugin, and in the
meantime, I adjusted the API also to accept timeFieldName.

Also, I have a separate ticket for improving data view validation
(https://github.com/elastic/kibana/issues/162554)

## 🧪 How to test
### New threshold rule
- Create a data view of a timestamp other than `@timestamp`
- Create a rule with this data view and make sure the preview and
generated alerts are as expected
- Create a rule with grouping and filtering and check the preview and
generated alerts

### Metric threshold rule
- Create a metric threshold rule to make sure preview and rule execution
works as before
2023-07-28 16:43:00 +02:00
Elena Stoeva
3eda5fca4e
[Index Management] Fix empty error toasts from index actions (#162656)
Fixes https://github.com/elastic/kibana/issues/156980
Fixes https://github.com/elastic/kibana/issues/123986
Addresses https://github.com/elastic/kibana/issues/162218

## Summary

This PR fixes the empty error toasts that are displayed when an index
action (delete, open, close, flush, etc.) is unsuccessful. The errors
from each of these actions are handled by the
[handleEsError](a3c0914dae/src/plugins/es_ui_shared/__packages_do_not_import__/errors/handle_es_error.ts (L24))
function which is why we need to use the `error.body.message` field to
get a correct error message (instead of `error.message` which is
undefined).

**How to test:**
Start Kibana and perform an invalid action on some index.
For example, to test the error toast from the Delete action, delete a
hidden index that is a write index of an existing data stream:

<img width="1553" alt="Screenshot 2023-07-27 at 18 19 52"
src="91b5e5db-3c1c-4c15-addd-83bedfac6785">

---------

Co-authored-by: Yulia Čech <6585477+yuliacech@users.noreply.github.com>
2023-07-28 15:11:51 +01:00
Christos Nasikas
f8a16009f9
[Actions] System actions enhancements (#161340)
## Summary

This PR:
- Handles the references for system actions in the rule
- Forbids the creation of system actions through the `kibana.yml`
- Adds telemetry for system actions
- Allow system action types to be disabled from the `kibana.yml`

Depends on: https://github.com/elastic/kibana/pull/160983,
https://github.com/elastic/kibana/pull/161341

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

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

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-28 05:53:34 -07:00
Shahzad
971c6bd5eb
[Synthetics] Upgrade synthetics to 1.3.0 (#152419)
## Summary
2023-07-28 14:52:00 +02:00
Ryland Herrick
8df89203c2
Risk Score Persistence API (#161503)
## Summary

* Introduces a new API, POST `/api/risk_scores/calculate`, that triggers
the code introduced here
* As with the [preview
route](https://github.com/elastic/kibana/pull/155966), this endpoint is
behind the `riskScoringRoutesEnabled` feature flag
* We intend to __REMOVE__ this endpoint before 8.10 release; it's mainly
a convenience/checkpoint for testing the existing code. The next PR will
introduce a scheduled Task Manager task that invokes this code
periodically.
* Updates to the /preview route:
* `data_view_id` is now a required parameter on both endpoints. If a
dataview is not found by that ID, the id is used as the general index
pattern to the query.
* Response has been updated to be more similar to the [ECS risk
fields](https://github.com/elastic/ecs/pull/2236) powering this data.
* Mappings created by the [Data
Client](https://github.com/elastic/kibana/pull/158422) have been updated
to be aligned to the ECS risk fields (linked above)
* Adds/updates the [OpenAPI
spec](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/risk_engine/schema/risk_score_apis.yml)
for these endpoints; useful starting point if you're trying to get
oriented here.


## Things to review
* [PR Demo
environment](https://rylnd-pr-161503-risk-score-task-api.kbndev.co/app/home)
* Preview API and related UI still works as expected
* Calculation/Persistence API correctly bootstraps/persists data
    * correct mappings/ILM are created
    * things work in non-default spaces
   



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


### 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&mdash;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&mdash;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)
2023-07-28 04:44:25 -07:00
Ignacio Rivas
180f86138b
[Remote Clusters] Clean up null properties depending on conection mode (#162405) 2023-07-28 11:53:37 +02:00
Miriam
0706dd3b1a
[APM] Api test for feature flags in serverless (#162128)
Closes https://github.com/elastic/kibana/issues/159020

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Achyut Jhunjhunwala <achyut.jhunjhunwala@elastic.co>
2023-07-28 10:06:12 +01:00
Walter Rafelsberger
45f7a0b2fc
Update "Gen AI Streaming Response Example" to make use of @kbn/ml-response-stream. (#162609)
## Summary

Follow up to #161676.

Since we added support for handling SSE-streams returned by OpenAI APIs
to `@kbn/ml-response-stream` in #162335, this updates the "Gen AI
Streaming Response" developer example to make use of the custom hook
`useFetchStream()` from `@kbn/ml-response-stream` instead of its inline
code to process the stream on the client.

It also improves the refresh behaviour: Previously, once a prompt was
entered and the accordion opened, every keystroke in the prompt textarea
would cause a new request to the AI endpoint. This update adds a
`Refresh prompt` to only do a new request on this user action. Support
for cancelling requests when unmounting the `StreamingResponse`
component was also added.


![gen-ai-streaming-0001](af81d3ac-cc03-4550-9aa5-8685c15304cd)

### Checklist

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-28 10:45:14 +02:00
Thomas Watson
d213ed274c
Upgrade ESLint React plugins (#162464) 2023-07-28 10:43:53 +02:00
Christos Nasikas
08db8eeece
[Cases] Fix case view participants tests (#162612)
## Summary

I removed the participants' tests from
`x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx`

There were a few things being tested:

| Old Test  | Where is it covered |
| ------------- | ------------- |
| should render the participants correctly  | Moved to an e2e test |
| should render Unknown users correctly  | Moved to  `UserList` |
| should render assignees in the participants section | Moved to an e2e
test |

I also added a small test for reporters.

Fixes #152204
Flaky test runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2734

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

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

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-28 01:40:14 -07:00
Janki Salvi
ec16896ec9
[Cases] Fix case view sort order flaky test (#162613)
## Summary

Fixes https://github.com/elastic/kibana/issues/152202



Old Test | Where is it covered
-- | --
should render by desc sort order | covered by [e2e test `sorts by newest
first successfully`
](https://github.com/elastic/kibana/blob/main/x-pack/test/functional_with_es_ssl/apps/cases/group1/view_case.ts)
should show all filter as active | Moved to e2e test `filters by all by
default`
should show comment filter as active | Added check in e2e test `filters
by comment successfully`
should show history as active filter correctly | Added check in e2e test
`filters by history successfully`

<br class="Apple-interchange-newline">

**Flaky test runner:**
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2735

## Checklist
Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

## For maintainers

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-28 10:02:15 +02:00
Shahzad
633a466336
[Synthetics] Fix flaky test (#162642) 2023-07-28 09:53:12 +02:00
Philippe Oberti
8543e8366b
[Security Solution] expandable flyout - highlighted fields enhancements (#162417) 2023-07-28 08:47:53 +02:00
Kevin Logan
7dd5334a58
[Security Solution] Add cluster and additional license info to Policy (#161131)
## Summary

Adds new meta fields for `license_uid`, `cluster_uuid`, and
`cluster_name` to Endpoint Policy for use by the Endpoint in the
upcoming Cloud Lookup feature. These values will be used by Endpoint to
call an external API for use in analyzing malware.

New policies will have the fields populated.

Existing policies will go through an SO migration to add the empty
fields. Users will turn on the Cloud Lookup feature via Policy (coming
in another PR) which will then trigger the update callback to populate
the fields for those existing policies.

Policy fields look like this (taken from my local dev instance):
```
...
    policy:
      meta:
        license: trial
        license_uid: 1a427caf-9417-442c-b674-84e4b7100c29
        cluster_uuid: DttCDxWnSF6UTSWvnUTZvg
        cluster_name: elasticsearch
        cloud: false
...
```

Policy in the app:

<img width="1728" alt="image"
src="480458fc-6096-422e-af3a-207b1b71b069">

### 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>
2023-07-27 15:44:54 -07:00
Marshall Main
5da645acee
[Security Solution] Move lists plugin API schemas to /common/api (#162489)
Closes https://github.com/elastic/security-team/issues/7102

Establishes the `/common/api` folder structure for the lists plugin.
This PR simply imports and re-exports the schemas from the schema
package since the schemas are all already separated from the `server`
code. Future PRs will replace these re-exports with schemas generated
from OpenAPI specs.
2023-07-27 15:22:00 -07:00
christineweng
a1be0029c3
[Security Solution] Expandable flyout - add rule preview skeleton (#161999)
## Summary

This PR adds a rule preview panel to the expandable flyout:

- Preview panel skeleton is added, now we can open a preview on top of
right section of flyout
- Go to rule details button is replaced by a button that will open a
rule preview panel
- The rule preview contains placeholder sections (About, Definition,
Schedule) and footer with a link to rule details page


![image](5510982a-91e5-4747-ae23-a8b5b87e0041)

**How to test**

- add `xpack.securitySolution.enableExperimental:
['securityFlyoutEnabled']` to the `kibana.dev.json` file
- go to the Alerts page, and click on the expand detail button on any
row of the table
- click on `Overview`, `About`, then `Rule summary`

### 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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-27 15:02:13 -05:00
Rodney Norris
a409f80444
[Serverless Search] Getting Started - Python PHP & Go code snippets (#162356)
## Summary

Adding code snippets for Python, PHP & Go to align with M0 designs

### Screenshots

![image](172224b8-a4c5-4739-95dc-dce93327a88a)
2023-07-27 14:22:09 -05:00
Tomasz Kajtoch
1c42ee9720
Upgrade @elastic/eui to 85.0.1 (#162209)
## Summary

`eui@84.0.0`  `eui@85.0.1`

## [`85.0.1`](https://github.com/elastic/eui/tree/v85.0.1)

**Bug fixes**

- Fixed `EuiFilterGroup`'s responsive styles
([#6983](https://github.com/elastic/eui/pull/6983))

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

- Updated `EuiThemeProvider` to set an Emotion theme context that
returns the values of `useEuiTheme()`
([#6913](https://github.com/elastic/eui/pull/6913))
- Added `size` prop to `EuiStepsHorizontal`, defaulting to the previous
size of `m` ([#6928](https://github.com/elastic/eui/pull/6928))
- Added new `s` sizing to `EuiStepsHorizontal`
([#6928](https://github.com/elastic/eui/pull/6928))
- Added `at` and `key` icon glyphs.
([#6934](https://github.com/elastic/eui/pull/6934))
- Added a new `cloneElementWithCss` Emotion utility
([#6939](https://github.com/elastic/eui/pull/6939))
- Updated `EuiPopover` to allow consumer control of all `focusTrapProps`
([#6955](https://github.com/elastic/eui/pull/6955))

**Bug fixes**

- Fixed `EuiDataGrid` height calculation bug when browser zoom levels
are not 100% ([#6895](https://github.com/elastic/eui/pull/6895))
- Fixed `EuiTab` not correctly passing selection color state to
`prepend` and `append` children
([#6938](https://github.com/elastic/eui/pull/6938))
- Fixed `EuiInputPopover` to allow consumer control of its focus trap
via `focusTrapProps` ([#6955](https://github.com/elastic/eui/pull/6955))

**Breaking changes**

- `EuiProvider` will no longer render multiple or duplicate nested
instances of itself. If a nested `EuiProvider` is detected, that
instance will return early without further processing, and will warn if
configured to do so via `setEuiDevProviderWarning`. For nested theming,
use `EuiThemeProvider` instead.
([#6949](https://github.com/elastic/eui/pull/6949))
- Removed `onTrapDeactivation` prop from `EuiPopover`. Use
`focusTrapProps.onDeactivation` instead
([#6955](https://github.com/elastic/eui/pull/6955))

**CSS-in-JS conversions**

- Converted `EuiFilterGroup` and `EuiFilterButton` to Emotion; Removed
styles attached to `.euiFilterGroup__popoverPanel`
([#6957](https://github.com/elastic/eui/pull/6957))

---------

Co-authored-by: Cee Chen <constance.chen@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-27 12:47:18 -06:00
Ievgen Sorokopud
5f913066a9
[Security Solution] Fix Accessibility Tests (#162143)
## Summary

This PR un-skips security solution a11y tests.

There were four main issues fixes:

1. All list items (`li`) must be contained within `ul` or `ol` parent
elements:
https://dequeuniversity.com/rules/axe/4.6/listitem?application=axeAPI
2. Lists must be marked up correctly, meaning they must not contain
content elements other than `li` elements:
https://dequeuniversity.com/rules/axe/4.6/list?application=axeAPI
3. Ensures elements marked `role="img"` elements have alternate text:
https://dequeuniversity.com/rules/axe/4.6/role-img-alt?application=axeAPI
4. Each `select` element must have a programmatically associated label
element:
https://dequeuniversity.com/rules/axe/4.6/select-name?application=axeAPI


Fixes next tests:
1. https://github.com/elastic/kibana/issues/95707
2. https://github.com/elastic/kibana/issues/101923
2023-07-27 20:41:16 +02:00
Jeramy Soucy
614044bff5
Fixes serverless common API security response headers API tests (#162655)
Unblocks #162149

## Summary
Fixes serverless security response headers tests by using the internal
request header. This PR also opts to use the `/logout` redirect endpoint
in testing, as it is more relevant to serverless.
2023-07-27 14:25:26 -04:00
Adam Demjen
b867d42f84
[Enterprise Search] Update ML inference field config UI (#162598)
## Summary

Minor updates to ML inference multi-field configuration UI (no
functional changes):
- Add spacer between field selector and selected field list
- Rename labels
- ~Remove "Actions" label (since there's only a single action)~

![Screenshot 2023-07-26 at 17 08
28](48505ac1-69f3-4c89-960b-68bb510ed830)
2023-07-27 14:04:47 -04:00
Quynh Nguyen (Quinn)
a3c0914dae
[ML] Unskip Data frame analytics feature importance tests (#162601) 2023-07-27 10:52:54 -05:00
Adam Demjen
c82b679c24
[8.10] [Enterprise Search] Make single target field editable in multi-field editor (#162512)
## Summary

This PR enhances the multi-field configuration screen for creating an ML
inference pipeline. It adds different behavior to the target field based
on the selected model:
- For ELSER pipelines the target field is not editable, and the output
field names are automatically generated as `ml.inference.<source
field>_expanded`
- For non-ELSER pipelines the target field is editable if there's a
single source field selected. For multiple source fields the names are
automatically generated as `ml.inference.<source field>`

The mapping auto-updater process now receives `model_id` and only
changes the mapping for ELSER pipelines.

In order to keep the scope of changes smaller, we're NOT switching over
to the multi-field selector for non-ELSER pipelines just yet. We're
making the logic ready for this here, but the actual switchover will
happen in a following PR.

Non-ELSER pipelines

![field_config_non_elser](2f74b01d-ac40-4656-9fd2-2843657d40c1)

ELSER pipelines

![field_config_elser](57f5d06a-fa61-4139-9ecf-007595670469)


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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-27 11:25:08 -04:00
Yngrid Coello
11e56ec4c4
[Logs onboarding] Align elastic-agent version with stackVersion (#162622)
Closes https://github.com/elastic/kibana/issues/159382.

### Changes
- `kibanaVersion` is passed as a resources to the routes.
- `elastic-agent` version is based on `kibanaVersion`.

#### Before
<img width="1073" alt="image"
src="00e291a2-3f8d-4d1d-9520-c0a29cc9454e">

#### After
<img width="1115" alt="image"
src="dffcf95f-f3a2-46f0-bb78-daebe8597b89">
2023-07-27 17:02:43 +02:00
Antonio
33195fb7df
[Cases] Total number of user actions on a case. (#161848)
Connected to https://github.com/elastic/kibana/issues/146945

## Summary

| Description  | Limit | Done? | Documented?
| ------------- | ---- | :---: | ---- |
| Total number of user actions and comments combined on a case | 10000 |
 | No |

### Checklist

Delete any items that are not applicable to this PR.

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

### Release Notes

Updating a case will now fail if the operation makes it reach more than
10000 user actions.
2023-07-27 16:41:36 +02:00
Konrad Szwarc
3136548545
[Defend Workflows] Alert should have Respond options available as long as agent.id has Endpoint installed (#162550)
Before:
If agent.type !== endpoint, we were disabling the Respond button in the
Take Action dropdown on the Alert Detail page. However, an alert coming
from, for example, filebeats, could be originating from an agent with
Defend integration, which supports respond actions.

After:
I removed the check for agent.type, resulting in the API
/endpoint/metadata/:id being called in all cases. If the API returns a
200 status code, we display the respond button since the endpoint
supports the response console. If the API returns a 404 status code, we
display a tooltip saying 'Please add Defend integration' and keep the
button disabled.`


Take Action button


![test](52e8bcda-39d6-4b4f-8979-7f20f0db7751)


Timelines


![test](3223636c-58bc-4bb8-b74f-938447218a67)
2023-07-27 15:14:18 +02:00
Alison Goryachev
c9c61544c7
[Index Management] Unskip nodes test (#162524) 2023-07-27 08:28:32 -04:00
Alex Szabo
8cf68dc6ba
[Ops] Bump Node.js to version 18 (#160289)
## Summary

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

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

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

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

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

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
Co-authored-by: Thomas Watson <w@tson.dk>
2023-07-27 14:12:48 +02:00
Achyut Jhunjhunwala
28800ef35e
[APM] Add range query to terms enum call (#162614)
Closes https://github.com/elastic/kibana/issues/159202
2023-07-27 13:49:05 +02:00
Oliver Gupte
7277dba30f
[Logs onboarding] Refactors the install elastic agent steps to own component (#162600) 2023-07-27 04:28:48 -07:00
Shahzad
698ff714de
[Synthetics] Clarify location geo property type (#162371) 2023-07-27 13:00:09 +02:00
Bena Kansara
5a2b80f8db
Add feature flag for new Threshold Alert details page (#162394)
Resolves https://github.com/elastic/kibana/issues/162393

Adds a new feature flag
`xpack.observability.unsafe.alertDetails.observability.enabled` to
show/hide threshold alert details page until it is ready for GA.
2023-07-27 11:53:29 +02:00
Elena Stoeva
fa90a2f080
[Snapshot Restore] Fix broken Snapshot restore form (#161113)
Fix https://github.com/elastic/kibana/issues/160974
Fix https://github.com/elastic/kibana/issues/160929

## Summary

From Es 8.10, the `version` field from the Get Snapshot response has a
different format - it will no longer be a string representing the
release version, but rather it will be a string representing the version
id (see
https://github.com/elastic/kibana/issues/160974#issuecomment-1618087194
for more details).

This PR replaces the use of the `version` field with the `versionId`
field when checking in the Snapshot Restore form if the current version
is greater than 7.12 (which corresponds to `versionID` 7120099).
The PR also unskips the functional test that failed with the promotion
of Es to 8.10.

**How to test:**

1. Start Es with `yarn es snapshot -E path.repo=./tmp/snap` and Kibana
with `yarn start`
2. Go to Stack Management -> Snapshot and Restore
3. Create a Shared File System repository with location `./tmp/snap`
4. Create a policy that uses the repository created in the previous
step.
5. Run the policy to create a snapshot.
6. Go to the Snapshots tab and click the Restore button for the created
snapshot.
7. Verify that the Snapshot restore form works as expected.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-27 09:42:15 +01:00
Antonio
88aa58c166
[Cases] Fix case view reporter tests. (#162567)
Fixes #152206

## Summary

I removed the reporter tests from
`x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx`

There were a few things being tested:

| Old Test  | Where is it covered |
| ------------- | ------------- |
| does the case view render `'case-view-user-list-reporter'` | [a
functional test already covers
this](https://github.com/elastic/kibana/blob/main/x-pack/test/functional_with_es_ssl/apps/cases/group1/view_case.ts#L47)
|
| Is a reporter name displayed correctly | covered in the UserList
component tests |
| a reporter without uid is rendered correctly | moved this logic to
`parseCaseUsers` and tested it there in this PR |
| fallbacks correctly to the caseData.createdBy user correctly | moved
this logic to `parseCaseUsers` and tested it there in this PR |
2023-07-27 09:19:49 +02:00
Walter Rafelsberger
0ab24e566c
[ML] AIOps: Use Kibana's http service instead of fetch, fix throttling. (#162335)
- Originally Kibana's `http` service did not support receiving streams,
that's why we used plain `fetch` for this. This has been fixed in
#158678, so this PR updates the streaming helpers to use Kibana's `http`
service from now on.
- The PR also breaks out the response stream code into its own package
and restructures it to separate client and server side code. This brings
down the `aiops` bundle size by `~300KB`! 🥳
- The approach to client side throttling/buffering was also revamped:
There was an issue doing the throttling inside the generator function,
it always waited for the timeout. The buffering is now removed from
`fetchStream`, instead `useThrottle` from `react-use` is used on the
reduced `data` in `useFetchStream`. Loading log rate analysis results
got a lot snappier with this update!
2023-07-27 08:57:10 +02:00
Karl Godard
c37b78ef68
[Cloud Security] Findings tab redirection logic. (#162289)
## Summary

Part of the CSP teams quick wins effort, this PR aims to improve the
experience for users first landing on the Findings page, or returning to
it.

Currently we always set the "Misconfigurations" tab as default
regardless of whether there are misconfigs or not. Even if there are
vulnerabilities (the primary tab), it will still default to misconfigs.

A small component was created to handle the root route for 'findings'
and decide which Tab to be redirected to. Vulnerabilities or
Misconfigurations. If a user has never made a tab selection, there are
no vulnerabilities, but there are findings, the user will be redirected
to the "Misconfigurations" tab. If the user had previously clicked to
select a tab, it will always remember which tab they came from last.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-26 16:39:55 -07:00