Commit graph

7636 commits

Author SHA1 Message Date
Achyut Jhunjhunwala
4b6dbdcd2c
Replace lens embeddable for most used charts (#155026)
## Summary

This PR closes https://github.com/elastic/kibana/issues/152139

This change brings a big performance improvement in Loading of the
Charts

### Checklist

- [x] Add new endpoint to retrieve filtered data based on URL params
- [x] Replace Embeddables with Elastic Charts
- [x] Delete existing code for Embeddables
- [x] Handle Loaders
- [x] Add similar No results found visualisations
- [x] Add Cy Tests
- [x] Add API Tests

## Demo



https://user-images.githubusercontent.com/7416358/232797685-1b009d5d-cd4a-4041-aa33-872647491ced.mov

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-20 14:50:58 +02:00
Mike Côté
5a4dd3fccd
Remove alerting_framework_heath from the alerting framework health API response (#154276)
Resolves https://github.com/elastic/kibana/issues/135035.

In this PR, I'm removing the deprecated attribute
`alerting_framework_heath` from the alerting framework health API.

## To verify

1. Start Kibana.
2. Call `/api/alerting/_health`.
3. Notice `alerting_framework_heath` is no longer part of the HTTP API
response.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: lcawl <lcawley@elastic.co>
2023-04-20 07:16:27 -04:00
Katerina Patticha
7c70508b7b
[APM] Add transaction name filter in latency threshold rule (#154241)
Part of the #152329

1. Adds a synthrace scenario that generates many transactions per
service
2. Fixes the duration chart preview when selecting All option -
https://github.com/elastic/kibana/issues/152195
3. Introduces the `Transaction name` filter in the rule type. 


### Pages loading the rule type
1. APM
2. Alert
3. Management rule 


### Consider 
- [ ] Update/Adding documentation example
https://www.elastic.co/guide/en/kibana/master/apm-alerts.html#apm-create-transaction-alert
## Creating a rule

https://user-images.githubusercontent.com/3369346/231740745-425c8eb8-6798-4ce4-b375-4ef96afdb334.mov

## Updating a rule


https://user-images.githubusercontent.com/3369346/231742035-28f50dfd-64bb-475d-b037-331eea4188d7.mov


### Before



https://user-images.githubusercontent.com/3369346/232799038-2edaa199-b970-48f2-b3ca-728273e4bf44.mov



### Notes

#### Feedback
The default action messages don't include any links. I will create a
follow-up ticket to improve the messages with actionable links.

Related bugs but out of the scope of the PR

- https://github.com/elastic/kibana/issues/154818
- https://github.com/elastic/kibana/issues/154704

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-20 13:01:16 +02:00
Stratoula Kalafateli
544f908fd6
Heatmap small multiples (#154434)
## Summary

Enables split chart in agg based heatmaps (small multiples) and makes
the EC implementation the default. It also marks the advanced setting
that changes the implementation as deprecated.

<img width="2493" alt="image"
src="https://user-images.githubusercontent.com/17003240/230048435-f8b20240-5005-4343-ba18-e2c7307945e0.png">


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

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Marco Vettorello <marco.vettorello@elastic.co>
Co-authored-by: Nick Partridge <nick.ryan.partridge@gmail.com>
Co-authored-by: nickofthyme <nicholas.partridge@elastic.co>
2023-04-20 10:07:42 +03:00
Jiawei Wu
4d89152326
[RAM] Maintenance Window - Expose Active Maintenance Window Route (#155321)
## Summary
Resolves: https://github.com/elastic/kibana/issues/155306

Exposes the `/_active` route to get all currently active maintenance
windows

```
GET `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/_active`
body: {}

Response: MaintenanceWindow[] 
```
### 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
2023-04-19 17:31:48 -07:00
Maxim Palenov
6994c9f901
[Security Solution] Remove the automatic rule mute/unmute logic from all our BE endpoints (#154804)
**Addresses:** https://github.com/elastic/kibana/issues/147736

## Summary

This PR removes automatic rule muting and unmuting at Security solution's APIs.


### Checklist

- [ ] [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
2023-04-19 23:13:56 +02:00
Jeramy Soucy
03a2cd7aea
[Failing Test] Fixes intermittent failures in audit log integration tests (#154935)
resolves #119267

## Summary
As [discussed in the
issue](https://github.com/elastic/kibana/issues/119267#issuecomment-1370135711),
we believed the issue to be timing between file write and read, however
this is not the case. I found that two 'saved_object_find' events were
being logged - the expected user one (for a 'dashboard'), and one by the
fleet app (for 'epm-packages'). Should the 'epm-packages' event get
logged before the 'dashboard' event, the test fails because the first
'saved_object_find' event it finds does not contain the expected user
data in the audit. This appears to happen much less frequently in CI
than locally for whatever reason.

## Fix
I have added additional criteria when looking for the
'saved_object_find' event so it will only find an event for a
'dashboard' object.

## Testing
Flaky Test Runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2150
2023-04-19 16:22:30 -04:00
Julia Rechkunova
cac928b956
[Discover] Drag & drop for adding columns to the table (#153538)
Closes https://github.com/elastic/kibana/issues/151703

## Summary

This PR:
- changes design of field list item in Lens and Discover
- changes design of dimension triggers in Lens panels
- changes design "Add layers" button
- adds "+" action to field items in Lens
- unifies the logic of rendering Lens field items for text-based and
form-based views
- adds Drag&Drop functionality to Discover to add columns to the table
by dragging a field from the sidebar
- adds functional tests for drag&drop in Discover
- shows fields popover in text-based mode too so users can copy field
names


[Figma](https://www.figma.com/file/SvpfCqaZPb2iAYnPtd0Gnr/KUI-Library?node-id=674%3A198901&t=OnQH2EQ4fdBjsRLp-0)

<details>
<summary>Gifs</summary>

![Apr-04-2023
14-38-47](https://user-images.githubusercontent.com/1415710/229795117-712267ba-f5e0-42ca-a2e5-e23759d5ddda.gif)
![Apr-04-2023
14-40-59](https://user-images.githubusercontent.com/1415710/229795133-7b618566-e73a-4303-97d7-b2840d1fc006.gif)

</details>


### 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
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [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>
Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-04-19 19:17:54 +02:00
Jan Monschke
c3c55e7aa8
[SecuritySolution] Use correct queries and filters for prevalence calls (#154544)
## Summary

Bug ticket https://github.com/elastic/kibana/issues/131967 describes an
issue where the alert prevalence count is not correct for fields that
have array values (such as `process.args`).

## Solution

Getting the correct count for those fields involved adding more `term`
conditions to the prevalence query and the timeline filter. This ensures
that only alerts with the *exact* same array values match instead of
partial matches as before.




https://user-images.githubusercontent.com/68591/231395154-b5a1c968-8308-49fb-a218-f3611f8331c3.mov


### 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
- [x] Get approval from the product team

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-19 10:03:12 -07:00
Shahzad
2fbfb33bed
[Synthetics] Enable throttling in synthetics app (#154378)
## Summary

Enable throttling config in synthetics app !!

<img width="1773" alt="image"
src="https://user-images.githubusercontent.com/3505601/229875799-d87b0ad6-c318-4a17-9012-c56666841b5c.png">

---------

Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
2023-04-19 18:14:11 +02:00
Jiawei Wu
14f01672c7
[RAM] Maintenance Window Task Runner Integration + New AAD/Event Log Fields (#154761)
## Summary

Resolves: https://github.com/elastic/kibana/issues/153468
Maintenance window API PR: https://github.com/elastic/kibana/pull/153411

This PR does the following: 
- Skip alert notifications for rules in maintenance
- Add `maintenance_window_ids` field to alert events in the event log
- Add `maintenance_window_ids` attribute to AAD

### 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-04-19 08:48:23 -07:00
Jonathan Buttner
8d96fc82cf
[Cases] Delete file attachments when files do not exist (#155088)
This PR modifies the bulk delete files API to support deleting the case
attachments even when the file does not exist. We could run into this
scenario if a user deleted the file outside of cases first and then
attempts to delete the case attachment.
2023-04-19 10:10:22 -04:00
Carlos Crespo
fce3664397
[Infrastructure UI] KPI charts with Lens Embeddable (#154903)
## Summary

This PR replaces all but Host Count metric charts with Lens and aligns
the formulas used in Lens with the formulas used in the Snapshot API.

The Hosts Count was not converted yet, because Snapshot API
[post-process the results and filters out hosts that don't have metrics
and come from
APM](47c71b3025/x-pack/plugins/infra/server/routes/snapshot/lib/transform_metrics_ui_response.ts (L61)).
I decided to keep it unchanged until we start using a new API, which
won't have that step.

In order to avoid multiple requests going to the server simultaneously,
I introduced an intersection observer in the Lens chart component. It
will make them only trigger a request once the user has scrolled over a
chart component. This aims to prevent the occurrence of
`circuit_breaking_exception` exceptions when async_search has to process
too much data.

### Differences between Lens and current KPI charts

<img width="533" alt="image"
src="https://user-images.githubusercontent.com/2767137/232526591-4812059e-ba1f-4e59-a060-820570230084.png">

Currently, Lens doesn't provide an option for adding a suffix to the
metric value nor set a max number of decimal places. (e.g (e.g 3.8 Mbit
**/s**)

### For reviewer

Unfortunately, it's a big PR. Everything in the `lens/formulas` folder
is just related to the metric formulas that are reused between KPIs and
Metrics Charts.

The core of the changes is in the `lens/visualization_types` folder. It
contains the details on how to build different objects to render either
a metric type of chart or a lineXY one.

I have also aligned `cpu` and `memory` formulas with what we have in the
Inventory Model. When comparing the current KPI with the new ones in
Lens Embeddable, the results were not matching.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-19 11:04:51 -03:00
Oliver Gupte
d1dff0b2c7
[APM] Fleet migration support for bundled APM package (#153159)
Closes #149342.

It accomplishes this by returning the ArchivePackage, unzipped bundled
package that includes most of the same fields as the RegistryPackage.
These fields are used in APM to support the fleet migration workflow.
2023-04-19 09:31:15 -04:00
jennypavlova
25df1feee3
[Infrastructure UI] Hosts View: Filtering by metadata functionality (#155170)
Closes #151010

## Summary

This PR adds filtering functionality to the metadata table. After some
discussions there are changes in the design - see the [last
comments](https://github.com/elastic/kibana/issues/151010#issuecomment-1513005095)

## Additional changes

As the filters will change the order I changed the id to not depend on
the table index anymore (used os instead) inside [hosts table

](https://github.com/elastic/kibana/pull/155170/files#diff-168ba138bc6696100078e3e9cbc438ed7646d6336e9ef85a9c88553c9d8956f5)

## Testing
- Open the single host view for one of the hosts available in the table
- Inside the flyout select the Metadata tab
- Click on any of the available filter icons to add a filter 
- Check if the filter is applied and a toast is displayed
- Click on the same filter icon to remove it and check that it is
removed
- If there are other filters applied they should combined with the
metadata filters (so if filter A is added and then a metadata filter is
applied both filters should be visible)



https://user-images.githubusercontent.com/14139027/232837814-7292c7ec-8b63-4172-bcd9-2d49daf3b145.mov
2023-04-19 14:21:26 +02:00
Vitalii Dmyterko
f8c16c159c
[RAM][Security Solution][Alerts] moves legacy actions migration to rulesClient (#153101)
## Summary
- this PR is the first part of work related to conditional logic
actions. The rest of PRs, will be merged after this one. As they depend
on a work implemented here. [List of
tickets](https://github.com/elastic/security-team/issues/2894#issuecomment-1480253677)
- addresses https://github.com/elastic/kibana/issues/151919
- moves code related to legacy actions migration from D&R to
RulesClient,
[details](https://github.com/elastic/kibana/issues/151919#issuecomment-1473913699)
- similarly to D&R part, now rulesClient read APIs, would return legacy
actions within rule
- similarly, every mutation API in rulesClient, would migrate legacy
actions, and remove sidecar SO
- each migrated legacy action will have also [`frequency`
object](https://github.com/elastic/kibana/blob/8.7/x-pack/plugins/alerting/server/types.ts#L234-L238),
that would allow to have notifyWhen/throttle on action level once
https://github.com/elastic/kibana/issues/151916 is implemented, which is
targeted in 8.8, right after this PR.
But before it's merged, `frequency` is getting removed in
[update/bulk_edit/create
APIs](https://github.com/elastic/kibana/blob/8.7/x-pack/plugins/alerting/server/rules_client/methods/update.ts#L151-L160).
Hence it's not reflected in most of the tests at this point.
- cleanup of legacy actions related code in D&R
- adds unit tests for RulesClient
- keeps functional/e2e tests in D&R

Changes in behaviour, introduced in this PR:
- since, migration happens within single rulesClient API call, revision
in migrated rule will increment by `1` only.
- legacy actions from sidecar SO, now will be merged with rules actions,
if there any.
Before, in the previous implementation, there was inconsistency in a way
how legacy and rules actions were treated.
- On read: actions existing in rule, [would take precedence over legacy
ones
](https://github.com/elastic/kibana/blob/8.7/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_actions.ts#L94-L114)
- On migration: SO actions [only
saved](https://github.com/elastic/kibana/blob/8.7/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/rule_actions/legacy_action_migration.ts#L114).
If any actions present in rule, they will be lost. Here is an example
video from **main** branch
      <details>
<summary>Here is an example video from MAIN branch, where action in rule
is overwritten by legacy action</summary>
      

https://user-images.githubusercontent.com/92328789/230397535-d3fcd644-7cf9-4970-a573-18fd8c9f2235.mov

      </details>

So, depends on sequence of events, different actions could be saved for
identical use case: rule has both legacy and existing action.
- if rule migrated through update API, existing in rule action will be
saved
- if rule migrated through enable/disable API, bulk edit, legacy action
will be saved

In this implementation, both existing in rule and legacy actions will be
merged, to prevent loss of actions
      <details>
<summary>Here is an example video from this PR branch, where actions are
merged</summary>
<video
src="https://user-images.githubusercontent.com/92328789/230405569-f1da38e9-4e36-46a8-9654-f664e0a31063.mov"
/>
      </details>
      
- when duplicating rule, we don't migrate source rule anymore. It can
lead to unwanted API key regeneration, with possible loss of privileges,
earlier associated with the source rule. As part of UX, when duplicating
any entity, users would not be expecting source entity to be changed
  
TODO:
- performance improvement issue for future
https://github.com/elastic/kibana/issues/154438
- currently, in main branch, when migration is performed through rule
enabling, actions not showing anymore in UI.
Relevant ticket is https://github.com/elastic/kibana/issues/154567
I haven't fixed it in this PR, as in[ the next one
](https://github.com/elastic/kibana/pull/153113), we will display
notifyWhen/throttle on action level in UI, rather than on rule level.
So, once that PR is merged, actions should be displayed in new UI
  
### 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

- [ ] 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>
Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
2023-04-19 11:48:37 +01:00
Nick Peihl
98843eeef4
[Maps] Use PageObject service methods to fix flaky test (#155161)
Fixes #154913 

## Summary

Changes functional test to use the maps PageObject methods for entering
and exiting fullscreen. These methods provide better retry handling.
2023-04-18 16:22:49 -04:00
Alejandro Fernández Haro
613619bee2
[Telemetry] Use soClient in FTRs (#155175) 2023-04-18 12:38:18 -07:00
Christos Nasikas
42effff78d
[Cases] Remove case id from alerts when deleting a case (#154829)
## Summary

This PR removes the case id from all alerts attached to a case when
deleting a case. It also removes any alert authorization when removing
alerts from a case.

### 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)
2023-04-18 09:20:59 -07:00
Kyle Pollich
136876091a
[Fleet] Fix policy editor error when validationResults.inputs is null (#155079)
Improve various typings and remove non-null assertions to ensure the
policy editor doesn't break when rendering a policy template without
`vars` or `streams` in its inputs.

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


![image](https://user-images.githubusercontent.com/6766512/232572327-df4ee721-722a-4d10-8eba-5ff048f5536b.png)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-18 09:17:06 -07:00
Xavier Mouligneau
ad2d5adf43
[RAM] ResponseOps saved object updates (#152857)
## Summary

This PR is just the first phase for response ops to go through their
saved object attributes. The idea is to comment out all the attributes
that we all agree that we do not need to filter/search/sort/aggregate
on.

After, in a second phase/PR, we will create a new file who will
represent all of attributes in our saved object as a source of truth.
Then, we will generate our SO mappings from this source of truth to
register our saved object.

Phase 3, we will try to generate also our type from our source of truth.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-18 08:02:25 -07:00
Antonio
0a38f85002
[Cases] Attaching files to cases (#154436)
Fixes #151595 

## Summary

In this PR we will be merging a feature branch into `main`.

This feature branch is a collection of several different PRs with file
functionality for cases.

- https://github.com/elastic/kibana/pull/152941
- https://github.com/elastic/kibana/pull/153957
- https://github.com/elastic/kibana/pull/154432
- https://github.com/elastic/kibana/pull/153853

Most of the code was already reviewed so this will mainly be used for
testing.

- Files tab in the case detail view.
- Attach files to a case.
- View a list of all files attached to a case (with pagination).
- Preview image files attached to a case.
- Search for files attached to a case by file name.
- Download files attached to a case.
- Users are now able to see file activity in the case detail view.
- Image files have a different icon and a clickable file name to
preview.
- Other files have a standard "document" icon and the name is not
clickable.
- The file can be downloaded by clicking the download icon.

## Release notes

Support file attachments in Cases.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-18 16:02:11 +02:00
Walter Rafelsberger
5b1b15af7a
[ML] AIOps: Fix race condition where stale url state would reset search bar. (#154885)
Fixes an issue there the global state `_g` and app state `_a` would get
out of sync and overwrite each other. For example, a click on Refresh in
the date picker (global state) could reset the search bar (app state) to
empty.

The issue was that in `x-pack/packages/ml/url_state/src/url_state.tsx`
the `searchString` could become a stale value in `setUrlState`. This PR
fixes it by using the approach already used in `usePageUrlState`: The
`searchString` is passed on to be stored via `useRef` so that the
`setUrlState` setter can always access the most recent value.
2023-04-18 15:17:49 +02:00
Paul Tavares
6f0b64ce63
[Security Solution][Endpoint] Update test data for endpoint list FTR tests and un-skip test suite (#155060)
## Summary

- Update test data for endpoint list FTR tests and un-skip test suite

Fixes #154916 
Fixes #154917
2023-04-18 08:34:07 -04:00
Josh Dover
9f126a95b0
[Fleet] Add support for dynamic_namespace and dynamic_dataset (#154732)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-18 05:20:52 -07:00
Marco Liberati
0ce4f2de8a
[Lens] Reenable reporting functional tests (#155118)
## Summary

Fixes #155047, #154958, #154957, #154956, #154955, #154954

Flaky runner with 50 runs:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2146

### 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&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-04-18 12:44:51 +02:00
Marco Liberati
779e553f81
[Lens] Improve Ignore global filters UI (#154441)
## Summary

Fixes #154316 

This PR revisits partially the Layer Settings UI in order to support the
`Data` and `Appereance` split in the UI and enhance the `ignore global
filters` UI to make it clearer for the user the state of this setting.

<img width="353" alt="Screenshot 2023-04-05 at 11 57 55"
src="https://user-images.githubusercontent.com/924948/230057975-37f92e6f-c70c-4509-a351-6eb932889d0c.png">

when the setting is disabled (to use global filters) then nothing is
shown:
<img width="336" alt="Screenshot 2023-04-05 at 11 59 18"
src="https://user-images.githubusercontent.com/924948/230058311-6f8f6dab-7a2f-42f1-b899-de371ed9f0b0.png">

On Annotations layer that is the only available setting:

<img width="374" alt="Screenshot 2023-04-05 at 11 58 03"
src="https://user-images.githubusercontent.com/924948/230058004-016e99b0-0786-46fa-aaed-a0c42ebc18b6.png">

The new refactoring can now handle multiple settings for each panel
section as shown in the Partition charts settings panel:

<img width="375" alt="Screenshot 2023-04-05 at 12 20 35"
src="https://user-images.githubusercontent.com/924948/230058207-fe2c7d64-e25b-43a3-a612-b63aa46e35c6.png">


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

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-04-18 11:31:37 +02:00
Cristina Amico
970de9147e
[Fleet] Surface new overview dashboards in fleet (#154914)
Closes https://github.com/elastic/kibana/issues/153848

## Summary
- Adds two link buttons on top of agent list page to access "Ingest
overview" and "Agent Info" dashboards
<img width="1444" alt="Screenshot 2023-04-13 at 15 22 53"
src="https://user-images.githubusercontent.com/16084106/231772174-00c00a8e-62f1-43ea-a935-bc12f56f3e50.png">

The links are built using the new URL service
[locator](e80abe8108/x-pack/plugins/fleet/public/hooks/use_locator.ts (L14))
and the
[getRedirectLink](https://github.com/elastic/kibana/blob/main/src/plugins/share/README.mdx#using-locator-of-another-app)
method;

- Refactoring existing instances of `useKibanaLink` to use the url
locator instead;

These new dashboards were already accessible from the ` elastic_agent.*`
datastreams table actions, however I replaced the `useKibanaLink` hook
there as well:

<img width="1412" alt="Screenshot 2023-04-13 at 16 03 47"
src="https://user-images.githubusercontent.com/16084106/231784273-693c7f36-4545-4c06-a05e-4f09e53bd903.png">


TODO: I don't know where to add the "Integrations" dashboard yet, I'm
not sure it should go on the Integrations details page.

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

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-18 08:44:16 +02:00
Rickyanto Ang
28b1f96d47
[Cloud Posture] Fix for Flaky test Column Sort (#154877)
## Summary
This PR for fixing the 'Flakiness' for our FTR Column Sort test cases.
The fix includes adding a 1 second delay or sleep between the test
clicking on the column its trying to sort and the test getting values
for that column.

There seems to be a problem from time to time where the values on that
column is not correct for a split second after clicking on the column to
sort it. Adding 1 second delay allows enough time for the column to sort
and show the correct value before we get the value for comparison with
the sorted (using our sorting function on the test)

This delay also fix the issue where the test fails because it checks for
an element while the page is still loading. I ran this 'fix' on our
flaky test runner for over 1000 runs and it hasn't fail so far, whereas
back then It would fail 3-4 times out of 450 runs

### Some other stuff that I tried before choosing this fix includes:

- Breaking the Column sort test cases into smaller test, currently we
test all Column sort in 1 test thus when 1 fail it might fail the next
one too.
- wait until loading element doesn't exist but I seem to be encountering
some issue when i use waitFor. Thus, I switch it to check if loading
element don't exist but It doesnt seem to help that much on fixing
column sort issue

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-17 15:18:27 -07:00
Nicolas Chaulet
ce912a9231
[Fleet] Fix request diagnostics tests (#155092) 2023-04-17 18:06:35 -04:00
Kibana Machine
22956209ac skip failing test suite (#154578) 2023-04-17 13:59:15 -04:00
Kibana Machine
55d5f11d13 skip failing test suite (#154726) 2023-04-17 13:58:58 -04:00
Kibana Machine
3925e93dbc skip failing test suite (#154640) 2023-04-17 13:13:57 -04:00
Kibana Machine
8360064a39 skip failing test suite (#154958) 2023-04-17 12:54:35 -04:00
Kibana Machine
6259bb9098 skip failing test suite (#154913) 2023-04-17 12:03:49 -04:00
Kibana Machine
644e0a81d4 skip failing test suite (#154452) 2023-04-17 11:44:58 -04:00
Kibana Machine
404ec58660 skip failing test suite (#137032) 2023-04-17 11:44:31 -04:00
Patrick Mueller
bcfe4b0005
[ResponseOps] provide config to turn off email action footer (#154919)
resolves https://github.com/elastic/kibana/issues/135402

Allows deployments to not have the default footer added to alerting
emails via the new `xpack.actions.enableFooterInEmail` config setting.
The default value is `true`, which renders the footer.  Setting the
value to `false` will cause no footer to be rendered.

Also changes the footer separator from `--` to `---`, which renders
nicer in HTML, as a `<hr>` element.
2023-04-17 11:19:16 -04:00
Kibana Machine
07a341277e skip failing test suite (#151636) 2023-04-17 10:55:17 -04:00
Coen Warmer
035d28e757
Remove Has Data check from Alerts page so page is always accessible (#154851)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-17 15:15:15 +02:00
Mike Côté
046d97c357
Require config, secrets and params validation for connector types (#153969)
Resolves https://github.com/elastic/kibana/issues/153769

In this PR, I'm making `config`, `secrets` and `params` require a
validation in their connector type definition. Even in scenarios no
values are used, an empty object validation is required. This prevents
arbitrary data from being passed through.

Only `ES Index`, `Server Log` and `Teams` had some empty validators.
Adding them won't be a breaking change because the HTTP API defaults
missing `config` and `secrets` to `{}` ([see
here](https://github.com/elastic/kibana/blob/main/x-pack/plugins/actions/server/routes/create.ts#L19-L24)).

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-17 05:22:13 -07:00
Dominique Clarke
dcfff4fd56
[Synthetics] report error when synthetics agent sends an invalid location (#154876)
Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: shahzad31 <shahzad31comp@gmail.com>
2023-04-17 14:02:11 +02:00
Michael Dokolin
a9ea301a8a
[Migrations] Remove migrationVersion mappings (#154711) 2023-04-17 09:53:22 +02:00
Jen Huang
73be560e29
[Fleet] Re-enable skipped tests on main (#154960)
## Summary

Closes #154739. Re-enables skipped suites now that #154741 is resolved.
2023-04-14 17:05:09 +02:00
Jiawei Wu
3b07f96b44
[RAM] Window Maintenance Client/Saved Object and Mapping/REST APIs (#153411)
## Summary
Resolves: https://github.com/elastic/kibana/issues/152270
Specs:
https://docs.google.com/document/u/1/d/1-QblF6P19W9o5-10Us3bfgN80GRfjSIhybHrvJS_ObA/edit

This PR implements the following:
- New maintenance window SO
- New maintenance window client in the alerting plugin (generates and
queries maintenance window events, and other CRUD functionality around
the SO)
- New maintenance window REST APIs 
- Kibana privileges for reading/writing maintenance window

This PR does not include integration with task runner, a new PR will be
created to do that work.
 
## APIs:

```
Find all maintenance windows in current space
GET `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/_find`
body: {}
```

```
Create maintenance window:
POST `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window`
body: {
  title: string,
  duration: number,
  r_rule: RRule
}
```

```
Update maintenance window by ID:
POST `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}`,
body: {
  title?: string,
  duration?: number,
  enabled?: boolean,
  r_rule?: RRule,
}
```

```
Get maintenance window by ID:
GET `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}`,
```

```
Delete maintenance window by ID:
DELETE `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}`,
```

```
Archive maintenance window by ID:
POST `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}/_archive`,
body: {
  archive: boolean
}
```

```
Finish maintenance window by ID:
POST `${INTERNAL_BASE_ALERTING_API_PATH}/rules/maintenance_window/{id}/_finish`,
```


## Maintenance window response schema:
```
{
  id: string;
  title: string;
  enabled: boolean;
  duration: number;
  expirationDate: string;
  events: DateRange[];
  rRule: RRuleParams;
  status: 'running' | 'upcoming' | 'finished' | 'archived';
  startDate: string | null;
  endDate: string | null;
  createdBy: string | null;
  updatedBy: string | null;
  createdAt: string;
  updatedAt: string;
}
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-13 13:02:28 -07:00
Coen Warmer
7199327bca
[Cases] Remove no-data gate for Cases page (#154909) 2023-04-13 18:48:28 +02:00
Kibana Machine
b1882495f0 skip failing test suite (#154916) 2023-04-13 10:52:29 -04:00
Kibana Machine
b07203d937 skip failing test suite (#154917) 2023-04-13 10:50:10 -04:00
Melissa Alvarez
c7c5a21680
[ML] Data Frame Analytics: support custom urls in jobs (#154287)
## Summary

Related meta issue: https://github.com/elastic/kibana/issues/150375

This PR:
- adds the ability to create custom urls for data frame analytics job -
accessible in the 'Edit' flyout in the jobs list
- adds access to the created custom urls in the data frame analytics
results table (in the 'Actions' column)
- moves the custom url component to a shared directory and is used in
both anomaly detection and data frame analytics



https://user-images.githubusercontent.com/6446462/229624946-b860c13d-19bb-4951-aeac-e7409864b56c.mp4

<img width="1023" alt="image"
src="https://user-images.githubusercontent.com/6446462/229625754-6a9277be-0da3-4f69-8a9a-f4a6fd1b632c.png">



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

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-13 08:47:44 -06:00
Christos Nasikas
9cc51bf65b
[Cases] Do not add already attached alerts to the case (#154322)
## Summary

This PR filters out all alerts that are already attached to the selected
case. To avoid breaking changes and not confuse the users (trying to
find which alert is attached to which case) the UI will not produce any
error.

### 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)
2023-04-13 07:29:20 -07:00