Commit graph

7808 commits

Author SHA1 Message Date
Hannah Mudge
deeb783f8b
[Dashboard] [Controls] Fix inherited input race condition (#154293)
Closes https://github.com/elastic/kibana/issues/154071

## Summary

**Before:**

Before this PR, the dashboard's children would start being
loaded/initialized **before** the control group was necessarily ready -
this caused a race condition where, when the children tried to get their
inherited input, if the control group wasn't quite ready yet, then they
would not receive the control group's filters for their initialization.

So, on first load of a dashboard with one or more controls with
selections, it was possible for the contents of a dashboard to **not
reflect** the control selections, like so:

![Screenshot 2023-04-06 at 1 54 16
PM](https://user-images.githubusercontent.com/8698078/230481821-624221ff-cbee-4288-af24-c7cede312f14.png)

This obviously caused flakiness for the drilldown test, because if the
children in the source dashboard did not receive the inherited input
from the control group, then the drilldown **also** wouldn't pass down
the control group filters.

**After:**

To avoid this race condition, the dashboard now waits until the control
group is ready **before** the children can be loaded - so, when the
children try to get their inherited input, it should **always** contain
the control group's output filters:

![Screenshot 2023-04-06 at 1 59 15
PM](https://user-images.githubusercontent.com/8698078/230484589-a43c3292-3a6b-4f07-8a89-8ec181141024.png)




### Flaky Test Runner

<a
href="https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2099"><img
src="https://user-images.githubusercontent.com/8698078/230492496-d9f6e3c0-5a20-4c1e-bbab-fe90a275229e.png"/></a>

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



### 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-06 19:42:56 -04:00
Davis McPhee
25b8f92753
[Discover] [Saved Search] Cleanup saved search mappings (#154016)
## Summary

This PR cleans up saved search mappings, removing all fields that aren't
being searched or aggregated on.

Continuation of the work started in #153129.

### Checklist

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

### 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>
2023-04-06 12:50:58 -03:00
Nathan Reese
2a4415f1a4
[maps] unskip Failing test: Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/maps/group4/lens/choropleth_chart·ts (#154474)
Fixes https://github.com/elastic/kibana/issues/154065

flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2092

Tests failing because of lack of EMS access. The test requires EMS
access. Fix is to add check for EMS so failure message points to failure
cause. This data can be used to help track faulty CI environments where
EMS is not available.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-06 09:44:36 -06:00
Christos Nasikas
3f7df8636f
[Cases] Attachment framework improvements (#154450)
## Summary

This PR adds the ability for consumers of the attachment framework to a)
define their own label for the removed attachment user action and b)
register custom action either as primary or as property actions.

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

### 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-06 07:12:06 -07:00
jennypavlova
8c2ff54c96
[Infrastructure UI] Hosts view: Add links to apm and uptime for a single host (#154269)
Closes #150985 

## Summary

This PR adds links to APM Traces and Uptime.
<img width="1909" alt="image"
src="https://user-images.githubusercontent.com/14139027/229580612-a3d0c03a-4f68-4b09-b333-ffa79c8454e6.png">

# Testing
1. Open Hosts view 
2. Click on the button to open the flyout for a single host
- Click on the APM traces link and verify the query parameters are
correct
- Click on the uptime link and verify the query parameters are correct
   


https://user-images.githubusercontent.com/14139027/229581672-3c50ea55-e834-4431-aac6-3ed3ff9f96cc.mov

---------

Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
2023-04-06 03:23:03 -07:00
Milton Hultgren
49d8e0e8ff
[asset_manager] Add /assets/diff endpoint (#153730)
This PR adds a `/diff` endpoint that given two time ranges will return
which assets exist only in either time range and which assets exist in
both time ranges.

### How to test
Start up a local ES and Kibana instance and run these commands to setup
the test data:

```curl
curl -X POST http://localhost:5601/ftw/api/asset-manager/assets/sample \
  -u 'elastic:changeme' \
  -H 'kbn-xsrf: xxx' \
  -H 'Content-Type: application/json' \
  -d '{"baseDateTime":"2022-02-07T00:00:00.000Z", "excludeEans": ["k8s.pod:pod-200wwc3","k8s.pod:pod-200naq4","k8s.pod:pod-200ohr5","k8s.pod:pod-200yyx6","k8s.pod:pod-200psd7","k8s.pod:pod-200wmc8","k8s.pod:pod-200ugg9"]}'
```

```curl
curl -X POST http://localhost:5601/ftw/api/asset-manager/assets/sample \
  -u 'elastic:changeme' \
  -H 'kbn-xsrf: xxx' \
  -H 'Content-Type: application/json' \
  -d '{"baseDateTime":"2022-02-07T01:30:00.000Z", "excludeEans": ["k8s.pod:pod-200wwc3","k8s.pod:pod-200naq4", "k8s.pod:pod-200xrg1","k8s.pod:pod-200dfp2"]}'
```

```curl
curl -X POST http://localhost:5601/ftw/api/asset-manager/assets/sample \
  -u 'elastic:changeme' \
  -H 'kbn-xsrf: xxx' \
  -H 'Content-Type: application/json' \
  -d '{"baseDateTime":"2022-02-07T03:00:00.000Z", "excludeEans": ["k8s.cluster:cluster-001","k8s.cluster:cluster-002","k8s.node:node-101","k8s.node:node-102","k8s.node:node-103","k8s.pod:pod-200xrg1","k8s.pod:pod-200dfp2"]}'
```

From there you can test based on the requests described in the
[documentation](063b730c7a/x-pack/plugins/asset_manager/docs/index.md (get-assetsdiff)).

Closes #153489
2023-04-06 11:55:13 +02:00
Julia Rechkunova
bb8bb361b4
[Discover] Unskip flaky alerts tests (#154308)
Closes https://github.com/elastic/kibana/issues/152477
Closes https://github.com/elastic/kibana/issues/152478
Closes https://github.com/elastic/kibana/issues/152479

250x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2070
2023-04-06 11:21:24 +02:00
Joey F. Poon
514ea0e9ac
[Security Solution] fix endpoint data generator (#154383) 2023-04-05 21:03:07 +02:00
Dominique Clarke
0e748cfd3c
[Synthetics] add migration to supported monitor schedules and remove deprecated zip url fields (#154010)
## Summary

Relates to https://github.com/elastic/kibana/issues/142655
Resolves https://github.com/elastic/kibana/issues/142653

All monitor schedules in Uptime Monitor Management/Synthetics app apart
from the [supported
schedules](https://github.com/elastic/kibana/pull/154010/files#diff-6e5ef49468e646b5569e213b03876de143291ca3870a7092974793837f1ddc61R33)
have been deprecated.

The only allowed schedules are the below:

<img width="1241" alt="Screen Shot 2023-04-02 at 10 28 20 PM"
src="https://user-images.githubusercontent.com/11356435/229397972-fe2fcaa2-d3c7-450b-9b40-f8c71e6c7dcf.png">

Adds a migration to transform unsupportes schedules from Uptime Monitor
Management to supported Synthetics app schedules. Also adds validation
when an invalid schedule is used.

Also removes zip url fields from monitors. These fields were originally
included in the saved object spec anticipating a future zip url feature.
That feature has now been replaced by project monitors, removing the
need for zip url fields.

## Testing

⚠️ Note ⚠️ 
--

It's suggested that you use a fresh instance of ES to test this PR. This
can either be done by creating a brand new oblt cluster via oblt-cli, or
by running `yarn es snapshot`. If you run this PR on an existing
oblt-cluster, then switch back to main on that same cluster before this
PR is broken, you'll break the cluster.

Instructions
--
1. Check out 8.7.0
2. Create Uptime monitors with invalid schedules. Ideally, create one of
each monitor type. Some example invalid schedules are 4, 8, 11, and 16,
for example.
3. Create at least one of each type of project monitor by pushing
monitors via the synthetics agent
4. Check out this branch
5. Navigate to Synthetics or Uptime once Kibana is done loading. Observe
that each one of the invalid schedules was transformed into a supported
schedule.
6. (Testing that decryption is still working after migration). Navigate
to each one of the UI monitors' edit pages. Click save to resave each
monitor. Then, visit the edit page again. If you don't see any page
level errors, decryption is still working successfully
7. (Testing that decryption is still working after migration for project
monitors). Change the global schedule your project monitors and repush.
Check the global schedule of your project monitors one more time and
repush again. If both pushes are successful, decryption is still working
after the migration.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-05 10:18:05 -04:00
Quynh Nguyen (Quinn)
ab1ac1b25d
[ML] Enhance support for counter fields in data visualizer / field statistics (#153893)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-04 17:14:25 -05:00
Ying Mao
3b951e16cb
[Response Ops][Alerting] Enable framework alerts as data by default (#154076)
## Summary

Setting `xpack.alerting.enableFrameworkAlerts` to true by default. This
causes alerts-as-data resource installation to be handled by the
alerting plugin and not the rule registry. We're keeping the feature
flag in case we run into issues but eventually we'll clean up the code
to remove the feature flag and clean up the rule registry code that
relies on the feature flag. Changing this default setting early will
allow us to identify issues before the 8.8 FF where we can revert if
needed.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-04 12:05:14 -07:00
Kibana Machine
5537414d2d skip failing test suite (#150772) 2023-04-04 14:43:59 -04:00
Maryam Saeidi
ce277ceb7d
[AO] Add functional test for alert summary widget on alerts page. (#154219)
Resolves #148645

## Summary

This PR adds a functional test for the alert summary widget on the
alerts page.

Flaky test runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2069
2023-04-04 09:18:40 -07:00
Maryam Saeidi
6350e146fa
[AO] Metric threshold alert details - custom time range and alert start annotation (#153954)
Closes #153202, closes #153850

## Summary

This PR adds alert start annotation and also uses a custom time range
for the alert details' charts depending on the alert duration. The logic
to calculate the time range was added in a separate package to be used
in other use cases as well.


![image](https://user-images.githubusercontent.com/12370520/228583927-bf90cc13-53d5-4824-9b3b-ed6e6ffd06f5.png)

## 🧪 How to test

Create a metric threshold alert and go to the related alert details
page, verify:
- Alert start annotation
- The time range of the charts should be before the alert was started
(1/8 of the duration was added to each side)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-04 09:08:27 -07:00
Mark Hopkin
62868e7fc0
[Fleet] un-skip flaky pipeline tests (#154317) 2023-04-04 15:05:17 +01:00
Robert Oskamp
98df0c25d3
[FTR] Switch to new browser headless mode (#153828)
## Summary

This PR updates the way how we start the headless browser for testing.

The current way of starting in headless mode is eventually going away
and the new headless mode offers more capabilities and stability, see
https://www.selenium.dev/blog/2023/headless-is-going-away/ and
https://developer.chrome.com/articles/new-headless/.

### Test adjustments

All the adjusted discover, dashboard, maps and infra tests showed the
same pattern during failure investigation that's around the fact that
the new headless mode is closer to the regular / non-headless mode:
* Tests passed with the old headless mode
* Tests failed in regular / non-headless mode the same way they failed
in new headless mode
* The failure reasons were mostly around slightly different font
rendering and slightly different browser sizes
2023-04-04 15:53:56 +02:00
Christos Nasikas
66ad9e0ba5
[Cases] Delete alerts when deleting all comments (#154202)
## Summary

This PR remove the case id from the alerts when deleting all cases
comments

### 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-04 15:24:55 +03:00
Marco Liberati
606eb9cd61
[Lens] Enabling Random Sampling (#151749)
## Summary

This PR is a design implementation to improve the Random sampling
feedback for the user.
Some work has been done to extract locally the `SamplingSlider`
component, that will be eventually moved into a separate package outside
of Lens.

In terms of design, to start, the Layer setting now inherits the same
`Data/Appearance` design from the dimension editor:
<img width="377" alt="Screenshot 2023-03-28 at 12 10 57"
src="https://user-images.githubusercontent.com/924948/228204053-06bbbbf8-5eda-4765-b401-fb8976a4b107.png">

Next, on the dataView picker of the layer panel the random sampling
information is shown when enabled:
<img width="356" alt="Screenshot 2023-03-28 at 12 06 15"
src="https://user-images.githubusercontent.com/924948/228204168-3514952c-09e7-40f0-acbd-c3f1fe66dc27.png">

when transitioning to `Maximum`/`Minimum` operation during editing the
sampling is disabled and a info toast is shown:

<img width="344" alt="Screenshot 2023-02-21 at 17 15 46"
src="https://user-images.githubusercontent.com/924948/220409514-667a0dc0-4247-44ea-98bf-9e4660ab1799.png">

The toast will show only when transitioning to such operations. If the
user goes from `Maximum`/`Minimum` to other supported operations then
the toast flag is reset, therefore going again into `Maximum` will
trigger a new toast.
Transitioning from a quick function `Maximum` into a formula `max(...)`
will not trigger a toast as the flag is persisted within the same
"editing session".

If the user configured a random sampling setting but then picked a
`Maximum` operation the Layer setting becomes disabled:
<img width="379" alt="Screenshot 2023-03-28 at 12 15 40"
src="https://user-images.githubusercontent.com/924948/228205186-a7b587bf-6c97-4546-9f85-b8dce0debbec.png">

and last the embeddable view with the new visualization modifiers view
on the bottom-left:
<img width="759" alt="Screenshot 2023-03-28 at 12 13 36"
src="https://user-images.githubusercontent.com/924948/228204606-3878e953-1027-4184-b2d7-d017cf56b319.png">
<img width="770" alt="Screenshot 2023-03-28 at 12 12 57"
src="https://user-images.githubusercontent.com/924948/228204428-73f54add-90af-42e8-9d85-709914a58e62.png">
<img width="761" alt="Screenshot 2023-03-28 at 11 59 27"
src="https://user-images.githubusercontent.com/924948/228204463-c6ab16f2-10bb-4bb6-9cf9-2ecf331eabf8.png">
<img width="759" alt="Screenshot 2023-03-28 at 11 56 19"
src="https://user-images.githubusercontent.com/924948/228204479-e997ea40-e102-4026-a0f2-5794baccfa0b.png">


<details>
  <summary>Previous PoC design</summary>
This PR works as a PoC for random sampling with the current state of the
design.
The UI is still a bit rough and not final.

<img width="329" alt="Screenshot 2023-02-21 at 17 52 23"
src="https://user-images.githubusercontent.com/924948/220409386-763a17f7-e120-4caf-bc63-2b87871af9dc.png">

when transitioning to `Maximum`/`Minimum` operation:

<img width="344" alt="Screenshot 2023-02-21 at 17 15 46"
src="https://user-images.githubusercontent.com/924948/220409514-667a0dc0-4247-44ea-98bf-9e4660ab1799.png">

The toast will show only when transitioning to such operations. If the
user goes from `Maximum`/`Minimum` to other supported operations then
the toast flag is reset, therefore going again into `Maximum` will
trigger a new toast.
Transitioning from a quick function `Maximum` into a formula `max(...)`
will not trigger a toast as the flag is persisted within the same
"editing session".

If the user configured a random sampling setting but then picked a
`Maximum` operation the Layer setting becomes disabled:
<img width="377" alt="Screenshot 2023-02-21 at 17 15 35"
src="https://user-images.githubusercontent.com/924948/220410419-ec853a23-5718-48bf-bbc2-824285fbce9d.png">

At dashboard level the random sampling is notified via an icon on the
bottom left:
<img width="1434" alt="Screenshot 2023-02-21 at 17 14 50"
src="https://user-images.githubusercontent.com/924948/220410051-37588420-aac3-41d2-ac74-9ab6bda2f046.png">

Hovering the icon will show a detailed tooltip:
<img width="626" alt="Screenshot 2023-02-21 at 17 15 00"
src="https://user-images.githubusercontent.com/924948/220410216-f8602681-886d-4468-8e98-8267cabb9d6a.png">

At the dashboard level a new `i` icon is displayed when a random
sampling feature is enabled in the panel and a popup with more details
is shown on hover:

<img width="755" alt="Screenshot 2023-03-20 at 10 08 23"
src="https://user-images.githubusercontent.com/924948/226294970-356fc2b2-e254-44c3-adba-89896dfecce2.png">
</details>

### 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>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Michael Marcialis <michael.l.marcialis@gmail.com>
2023-04-04 12:42:13 +02:00
Janki Salvi
6eb2c5ed91
[Cases] Filter user activities pagination (#152702)
## Summary

Implements #130227



https://user-images.githubusercontent.com/117571355/224038340-6b1c8cc7-3795-4412-8e67-a026dfe10776.mov



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

### Flaky Test Runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2059

### 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-04-04 09:25:21 +02:00
Marius Dragomir
b41e6cf4f6
[Stack Functional Integration] Fix test from #154115 (#154289)
## Summary

Fixes the context in the check added by #154115
2023-04-03 15:16:18 -07:00
Milton Hultgren
210a7eb335
[asset_manager] Add tests for ean filtering (#153725)
## Summary

- Added some tests that verify the functionality already added by
@jasonrhodes
- Made some small changes to the types and used kbn.schema in route
validation
- Swapped from `term` to `terms` filter for the `ean` filter
- Added a check that throws a 400 if both `type` and `ean` are used at
the same time
- Updated the docs to show the new request responses
- Mark `from` option as optional since it has a default value

Closes #153461
2023-04-03 20:54:11 +02:00
Tiago Costa
06f5a0185c
skip failing es promotion suite (#154277) 2023-04-03 19:48:07 +01:00
Jonathan Budzenski
711b8e031f skip flaky suite (#152477, #152478, #152479) 2023-04-03 13:23:49 -05:00
jennypavlova
ef4afdd64d
[Infrastructure UI] Show processes on a single hosts (#153866)
Closes #150907

## Summary
This PR adds the Processes tab to the single host flyout. The component
is already implemented in Inventory so we can reuse it here

## Testing
- Go to hosts view
- Open the flyout for any host to see the single host details
- Click on the processes tab 
⚠️ If you want to see the processes summary on top (where the total
processes are displayed) you need inside your metricbeat modules yml
configuration to include the `process_summary` so your config should
include:
```
metricbeat.modules:
  - module: system
    metricsets:
      ..... other data  .......
      - process # Per process metrics
      - process_summary # Process summary
    ..... other data  .......
```
<img width="1913" alt="image"
src="https://user-images.githubusercontent.com/14139027/228534978-c38437e4-4279-4ad4-9fc8-5222cbd15c2e.png">

---------

Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-03 19:24:11 +02:00
Jonathan Buttner
1e63515170
[Cases] Delete file API (#153604)
This PR adds a new API for deleting a file within a case given the file
id.

This API will retrieve the file saved object provided in the query and
perform an authorization check using each file's file kind. It will also
retrieve all the attachments associated with the files and perform an
authorization check for each attachment. This api supports calling it
with ids that only have the file saved objects and not the corresponding
attachments. For the deletion sub privilege to work correctly, it must
have access to updating the file saved objects. Therefore we also had to
give the delete sub privilege all access to the file saved objects
types.

This PR does not contain the logic for deleting all files when a case is
deleted. That'll be completed in a separate PR.

Example request
```
POST /internal/cases/a58847c0-cccc-11ed-b071-4f11aa24310c/attachments/files/_bulk_delete
{
  "ids": ["clfr5sdky0001n811gjot7tv5", "clfr5sgru0002n8112t54bave"]
}
```

Example response
```
204
```

Notable changes
- Refactored the delete all comments to leverage the bulk delete API
from the saved object client
- Updated the names of the `api_integration` users and roles to avoid
clashing with the ones in `cases_api_integration`

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-03 12:39:31 -04:00
Nick Peihl
affc44329b
Fix failing test: X-Pack Saved Object Tagging Functional Tests.x-pack/test/saved_object_tagging/functional/tests/dashboard_integration·ts (#154191)
## Summary

Fix #154168

I having trouble recreating the error, but I suspect there could be an
issue with toggling the margins switch. The quick save button was still
disabled in the failing tests. Maybe the switch was already off by some
other test? Changing the description might be a better trigger for
unsaved changes.

[Flaky test runner x
200](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2066)
2023-04-03 11:42:14 -04:00
Tiago Costa
a18627d27a
skip flaky suite (#154227) 2023-04-03 15:10:17 +01:00
Tiago Costa
597f4bb879
skip flaky suite (#154220,#154221,#154222,#154223,#154224,#154225,#154226) 2023-04-03 15:06:24 +01:00
Mark Hopkin
ff738dc971
[Fleet] Fix functional test failures after new custom logs package released (#154240)
These tests rely on the custom logs package being an integration
package, 2.0.0 was released today which is an input package so the index
templates are not created on install.
2023-04-03 06:43:32 -07:00
Patrick Mueller
cd727fa190
[ResponseOps] move alert UUID generation from rule registry to the alerting framework (#143489)
resolves https://github.com/elastic/kibana/issues/142874

The alerting framework now generates an alert UUID for every alert it
creates. The UUID will be reused for alerts which continue to be active
on subsequent runs, until the alert recovers. When the same alert (alert
instance id) becomes active again, a new UUID will be generated. These
UUIDs then identify a "span" of events for a single alert.

The rule registry plugin was already adding these UUIDs to it's own
alerts-as-data indices, and that code has now been changed to make use
of the new UUID the alerting framework generates.

- adds property in the rule task state
`alertInstances[alertInstanceId].meta.uuid`; this is where the alert
UUID is persisted across runs
- adds a new `Alert` method getUuid(): string` that can be used by rule
executors to obtain the UUID of the alert they just retrieved from the
factory; the rule registry uses this to get the UUID generated by the
alerting framework
- for the event log, adds the property `kibana.alert.uuid` to
`*-instance` event log events; this is the same field the rule registry
writes into the alerts-as-data indices
- various changes to tests to accommodate new UUID data / methods
- migrates the UUID previous stored with lifecycle alerts in the alert
state, via the rule registry *INTO* the new `meta.uuid` field in the
existing alert state.
2023-04-03 09:19:48 -04:00
Marco Antonio Ghiani
77ce676518
[Infrastructure UI] Fix time range filter in alerts query (#153863)
## 📓 Summary

Closes #153741 

This PR fixes the time range filter by using the
`kibana.alert.time_range` field instead of `@timestamp`.

## 🧪 Testing

- Navigate to Hosts View
- Create an Inventory Alert that will trigger immediately
- Refresh the search until some alerts are triggered
- Play with relative time range (eg. 15 min ago -> 2 min ago) to verify
alerts appears correctly

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
2023-04-03 02:20:51 -07:00
Christos Nasikas
3a6f7211b4
[Cases] Remove case info from alerts when deleting an alert attachment (#154024)
## Summary

Users can remove alerts from a case by deleting the whole alert
attachment. This PR removes the case id from the alerts when deleting an
attachment of type alert. It does not remove the case info from all
alerts attached to a case when deleting a case. It also fixes a bug
where the success toaster will not show when deleting an attachment.

Related: https://github.com/elastic/kibana/issues/146864,
https://github.com/elastic/kibana/issues/140800

## Testing

1. Create a case and attach some alerts to the case.
2. Verify that the alerts table (in security or in o11y) shows the case
the alert is attached to. You can enable the cases column by pressing
"Fields", searching for "Cases", and then selecting the field.
3. Go to the case and find the alerts' user activity.
4. Press the `...` and press "Remove alerts(s)"
5. Go back to the alert table and verify that the case is not shown in
the Cases column for each alert.

Please check that when you remove alert(s), attachments (ml, etc), and
comments you get a success toaster with the correct text.

### 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-01 07:51:06 -07:00
Ersin Erdal
dfbf21f289
re-enable flaky conditional actions test (#154167)
Fixes: 
#154133
#154131
#154130
#154129
#154128
#154127

The issue was fixed before it was skipped, with the below PR. Therefore
i just re-enable it.

https://github.com/elastic/kibana/pull/154138
2023-04-01 01:10:22 +02:00
Kibana Machine
68a85504e1 skip failing test suite (#154168) 2023-03-31 11:39:40 -04:00
Marius Dragomir
35654305bd
[Stack Management Integration] Add extra checks in Uptime test (#154115)
## Summary
Add a check for the tour popup being present in the Uptime app. It does
not show up on all the current configs.
2023-03-31 08:25:54 -07:00
Nicolas Chaulet
95253d7cc0
[Fleet] Fix CPU metrics display when percentage < 0.1 (#154160) 2023-03-31 10:59:14 -04:00
Xavier Mouligneau
7776dfa696
[RAM] Revert "RAM Slack connector improvements" (#154093)
Reverts elastic/kibana#149127

from pmuellr:

After looking into https://github.com/elastic/kibana/issues/153939 -
Preconfigured slack Web API connector does not work - we realized we
really should have added the support for the Slack Web API in a
different connector.

Lesson learned: don't design connectors where the set of parameters
differs depending on a config (or secret) value.  We have code - at
least with the "test" functionality - that assumes you can create a form
of parameters based solely on the connector type, without having access
to the connector data (we could/should probably add an enhancement to do
that).  So it would never be able to render the appropriate parameters.

There is also the semantic issue that if you changed the Slack type
(from webhook to web-api), via the HTTP API (prevented in the UX), you
would break all actions using that connector, since they wouldn't have
the right parameters set.

Complete guess, but there may be other lurking bits like this in the
codebase that we just haven't hit yet.

Given all that, we reluctantly decided to split the connector into two,
and revert the PR that added the new code.

RIP Slack connector improvements, hope to see your new version in a few
days! :-)
2023-03-31 10:14:28 -04:00
Nick Peihl
b692e347f4
[Dashboard Usability] Unified dashboard settings (#153862)
## Summary

Adds flyout for changing individual dashboard settings such as title,
description, tags, and save time with dashboard. This also moves the
existing dashboard options (show panel titles, sync colors, use margins,
sync cursor, and sync tooltips) into the flyout.

Fixes #144532

[Flaky test
runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2055)

### 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 was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### 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-03-31 09:52:51 -04:00
Tiago Costa
7ebfc6e6cd
skip flaky suite (#154127,154128,154129,154130,154131) 2023-03-31 14:51:02 +01:00
Gergő Ábrahám
7ea4722fb2
[Security Solution] Add e2e tests for Endpoint policy updates on Endpoints (#153938)
**>> Reopened to avoid unnecessary notifications for unrelated teams
<<**
Original PR with original comments:
https://github.com/elastic/kibana/pull/152097

## Summary

Added test cases:
- `endpoints.cy.ts`:
- Edit a Policy assigned to a real Endpoint and confirm that the
Endpoint returns a successful Policy response
- `artifacts.cy.ts`:
- Add a trusted application and confirm that the Endpoint returns a
successful Policy response
- Add an Event filter and confirm that the Endpoint returns a successful
Policy response
- Add a Blocklist entry and confirm that the Endpoint returns a
successful Policy response
- Add a Host Isolation exception and confirm that the Endpoint returns a
successful Policy response

To open Cypress for the new e2e test suite, first run this command:
`node scripts/build_kibana_platform_plugins`
Then use this command:
`yarn --cwd x-pack/plugins/security_solution
cypress:dw:endpoint:open-as-ci`

> **Warning**
> The `Endpoint reassignment` test group in `endpoints.cy.ts` will most
probably fail, due to this bug:
https://github.com/elastic/endpoint-dev/issues/12499 (as mentioned in
the PR for that test: https://github.com/elastic/kibana/pull/151887)
>
> So it's the best to skip that one, otherwise the endpoint will freeze
in *Out-of-date* state and you need to spin up the test suite again.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-03-31 15:03:58 +02:00
Ersin Erdal
7d24915193
Fix flaky conditional actions test (#154138)
Fixes: #154132

Char '0' was missing in hours padStart function
2023-03-31 12:56:52 +02:00
Nathan Reese
3cfa8a92d4
[maps] unskip Failing test: Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/dashboard/group2/dashboard_maps_by_value·ts (#153973)
Fixes https://github.com/elastic/kibana/issues/153959

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

test failing because of EMS access issues. Refactored test to remove EMS
dependency as EMS connectivity is not the intention of the test.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-03-30 12:14:22 -06:00
Kibana Machine
a9af9e77bd skip failing test suite (#154071) 2023-03-30 13:01:58 -04:00
Lisa Cawley
fe683844e8
[DOCS] Fix case visualization screenshot failure (#153813) 2023-03-30 09:52:46 -07:00
Kibana Machine
036fe0e8c0 skip failing test suite (#142484) 2023-03-30 11:48:50 -04:00
Kibana Machine
897195a09e skip failing test suite (#154064) 2023-03-30 11:47:56 -04:00
Kibana Machine
a88d54c372 skip failing test suite (#153960) 2023-03-30 11:47:45 -04:00
Kibana Machine
fce28277f9 skip failing test suite (#154065) 2023-03-30 11:47:42 -04:00
Wafaa Nasr
e52eb267b7
[Security Solution] [Action Connectors] Fix exporting predefined connectors (#153687)
## Summary

- Addresses https://github.com/elastic/kibana/issues/153619 

**Reason:**

- As predefined connectors are not Saved objects, the export method was
failing to get their exported objects.

**Solution:**

- Filter out `Predefined Action` ids from the user's action ids because
we don't need to export them as they are already in the user env, and
they won't be removed or changed

**References** 


https://www.elastic.co/guide/en/kibana/8.7/pre-configured-connectors.html

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-03-30 15:53:17 +01:00
Marius Dragomir
102aadf0d2
[Stack Functional Integration] Change screenshot compare resolution (#154018)
## Summary
This changes the compare resolution for the Metricbeat dashboard visual
compare tests in order to remove the vertical scroll bar influencing the
results. Various OSs used in testing have different scroll bar behaviors
and widths.
2023-03-30 18:56:32 +05:30