Commit graph

2671 commits

Author SHA1 Message Date
Alejandro Fernández Haro
119c3a7720
[FTR - Common page] Better subUrl handling (#159191) 2023-06-07 16:55:03 +02:00
Catherine Liu
d1da0ee836
[Dashboard] Fix edit embeddable test (#158847)
Closes #156671.

This unskips the edit embeddable functional tests and makes the tests
wait for the dashboard to load before grabbing the original panel for
comparison after editing embeddables.

Flaky test runner x 100:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2352#_
2023-06-06 09:52:56 -07:00
Hannah Mudge
8277665dbc
[Controls] Allow wildcard searching in options list (#158427)
Closes https://github.com/elastic/kibana/issues/157157
Closes https://github.com/elastic/kibana/issues/152921 

## Summary

The primary goal of this PR is to introduce an option for wildcard
("contains") searching to the options list control:



6847d0c5-014a-4322-8e59-308bc3ca27aa

### New Flyout Design

However, since this required adding a radio group to the custom options
list settings in the create/edit control flyout, I also made some
changes to the flyout design in order to better accommodate this (we
were previously using `EuiSwitch` components for the
control-type-specific settings, which did not work in this case because
I wanted to be able to add a tooltip to describe each search type):

| Before | After |
|--------|-------|
| ![May-29-2023
09-04-02](e7a8dba8-0815-4460-b55a-f622300e40ac)
| ![May-29-2023
09-00-21](50fa6795-f7e1-4329-bac6-045f6f8464b3)
|

Note in the above GIFs that, since I was using an `EuiRadioGroup` for
the search technique setting, I decided it made more sense + was more
consistent for the "Allow multiple selections in dropdown" to also be
converted to a radio group rather than a switch. The "Ignore timeout for
results" setting is the only one that remained a switch in the new
design:

| Before | After |
|--------|-------|
|
![image](53b1168c-b172-4cd0-8fbf-ce80a03964c0)
|
![image](60b174a6-635f-4b09-8f1a-fef1b0e7bb2c)
|


### `EuiSwitch` with Tooltip Bug

As part of this redesign, I also fixed a very quick bug where, because
the old `SwitchWithTooltip` was defined **inside** the larger
`OptionsListEditorOptions` component, any state update on
`OptionsListEditorOptions` would cause `SwitchWithTooltip` to **also**
be re-rendered - this caused the "slide" animation to be interrupted on
click:

| Before | After |
|--------|-------|
|
![image](03bebc7c-b529-463e-a042-7aa680c99eeb)
|
![image](db0fe6e7-d352-476a-8b77-d93d835c9942)
|




### Title Bug Fix
And, since I was making so many changes to the flyout code as part of
refactoring the code (including the design changes above), I also fixed
a bug with control titles where things weren't getting set properly. To
test this, consider taking the following steps:
1. Create a new options list control, keeping the default title
2. Edit that options list control and change it to a range slider
control by selecting a number field
3. Notice that...
     - Before this PR, the title gets completely cleared:

![image](cdd9ecc2-c729-402c-8f69-018de3e60342)<br>
- After this PR, the default title gets updated to the range slider
field name:

![image](d56ec9f9-6961-4799-ba3b-623ae5f46d91)<br>
4. Delete that range slider control and create a new control, keeping
the default title once again (options list or range slider, the type
doesn't matter).
5. Edit the control and change the field to a different field **of the
same type** (i.e. if your control from step 4 was an options list
control, select a field that keeps it as an options list control).
Before saving your changes, notice that the "default title" in the
`Label` input gets updated to the new field title:<br>
<img width="450"
src="0fabe2e3-7f83-4f2a-87e6-33253652972d"/><br>
6. After saving, notice that...
- Before this PR, the title doesn't actually get updated to the new
default title:

![image](b9262c67-9841-47f0-8d25-d5689fe408de)<br>
     - After this PR, the title gets updated as expected:

![image](1a2b3f19-a02c-4525-9d2c-8029c020a117)<br>

### Flaky Test Runner


[test/functional/apps/dashboard_elements/controls/options_list/options_list_suggestions.ts](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2343):
<img
src="f2ed9d65-adcf-47af-bb00-ee11837c406b"/>

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


### 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-06-06 08:32:10 -06:00
Stratoula Kalafateli
addb7c0859
[TSVB] Stabilize flaky test (#159097)
## Summary

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

This is a common flakiness, with the waiting function the flakiness
should be solved.

Flaky runner 50 times
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2353
2023-06-06 16:06:24 +03:00
Yulia Čech
3c8b26b53d
[Console] Add a setting to disable the a11y overlay (#158844)
## Summary
Fixes https://github.com/elastic/kibana/issues/16139

This PR adds a setting in Console that allows to disable the a11y
overlay. The default will be set to `enabled` so that the default
behaviour should not change. A user can disable the overlay in their
browser and the setting is saved in local storage. So that other users
are not affected by that change.

The reason to allow disabling the overlay is that it can be flaky and
sometimes it's displayed when not intended. The code relies on
`querySelector` (see this
[file](1b3f23829c/src/plugins/es_ui_shared/__packages_do_not_import__/ace/use_ui_ace_keyboard_mode.tsx (L25)))
so I think that causes the flakiness and that is very difficult to test
reliably.

### Screenshot 
#### A11y overlay (no changes)
<img width="1483" alt="Screenshot 2023-06-01 at 16 34 23"
src="d776625c-92cd-4bd9-8e5e-2f672df351a4">

#### Settings modal with the new option to disable the a11y overlay
<img width="474" alt="Screenshot 2023-06-01 at 16 29 02"
src="8745c7a0-62f4-41a9-9eff-ff8bebd4f767">


#### How to test 
1. Start Kibana and navigate to the Console
2. Press ESC when textarea is focused and now autocomplete popup is
displayed to see the a11y overlay
3. Open the Settings modal and disable the a11y overlay
4. Press ESC in the textarea again to see that no overlay is now
displayed
5. Check that the value is persisted in the local storage

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

### 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
2023-06-05 15:57:08 +02:00
Stratoula Kalafateli
a584986721
[XY] Fixes the threshold visibility (#158917)
## Summary

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

Fixes the broken reference line in aggbased xy charts.

<img width="1715" alt="image"
src="ae48f0b8-475a-44e2-866a-c56e9da8e8b0">

The problem was the default here, apparently the expressions fail when
the default is an empty string. The expression was failing and as a
result the reference line was never rendered

### 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
2023-06-02 18:21:36 +03:00
Peter Pisljar
4281e6b9ef
Discover SQL mode: Allow sorting (#158708)
## Summary

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

Enables sorting the table in Discover when in SQL (text based) mode. 
- sorting is performed on the client (inmemory)
- inmemory sorting configuration is not preserved in the appstate (to
prevent unnecesarry data fetches)
- all fields can be sorted, even the ones that can't be sorted on the
elasticsearch side.

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

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-06-02 14:20:31 +03:00
Stratoula Kalafateli
2bee02ffd0
[Discover] Enable expanded row view (#158623)
## Summary

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

Enables the expanded row view for text based documents for both the
legacy and datagrid modes (the legacy was broken)

<img width="1899" alt="image"
src="edae78a9-6ef5-43db-ba3d-9019ecc72c57">


Note: I am hiding for now the single document view and surrounding
document view. I think that we should think about it more and if it
makes sense for ESQL. With ESQL if there is no @timestamp I see all my
data in the table. If I want to narrow the results I can use where and
limit. How should the surrounding documents work for a query with where
date field and with llimit? Does it make sense? Possibly not, because
with ESQL I can have the surrounding documents view in my main view bu
just changing the query. So I am hiding them for now, until we find a
good use case for that and decide how we want this to work.

### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-01 14:16:35 +03:00
Devon Thomson
0e6b153ebe
[Dashboard] Refactor Empty Screen (#158496)
Updated Dashboard Empty State
Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
2023-05-31 18:04:56 -04:00
Drew Tate
f630d90697
[Lens] library annotation groups (#152623) 2023-05-31 16:41:21 -04:00
Hannah Mudge
3e3419d6c9
[Controls] Add ability to recover from non-fatal error state (#158087)
Closes https://github.com/elastic/kibana/issues/156430

## Summary

The only reason a control embeddable should enter a fatal error state is
if, for some reason, the embeddable actually cannot be created (for
example, trying to create a control with a type that doesn't exist) -
every other error should be considered **recoverable** as much as
possible. So, this PR ensures that both the options list and the range
slider are able to recover from most errors by switching from calling
`onFatalError` to instead handling most errors internally via component
state.

> **Note**
> The time slider control does not have any errors that would be
considered "recoverable" because it is actually **much more difficult**
to enter an error state for this control; so, I did not need to change
anything for this control type.

### Errors:

- **Recoverable error:**
   - **Before:**
   

7737a3e8-1c97-47ba-92ab-55f5e1a6c30a
   
   - **After:**
   

e4ced721-2b84-497e-8608-965877409bf5

- **Unrecoverable error:**

To test this, I've created a dashboard saved object with a control type
that does not exist:
[controlTypeDoesNotExistDashboard.ndjson.zip](11547128/controlTypeDoesNotExistDashboard.ndjson.zip).
Try importing this dashboard and ensure that you can actually see an
error unlike the "before" state:

   - **Before:**


![image](27c581b1-3fa8-4c07-b102-c952355dfd32)

   - **After:**
   

![image](626ed696-4f8e-44b2-b449-3c2fa1ee1327)


### Flaky Test Runner

- [Options list dashboard interavction
(`test/functional/apps/dashboard_elements/controls/options_list/options_list_dashboard_interaction.ts`)](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2316)

![image](6b71c71c-a47b-4e84-834a-07b8c380a727)

- [Range slider
(`test/functional/apps/dashboard_elements/controls/range_slider.ts`)](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2317)

![image](fe1c9752-68d3-4bca-b31a-361217b91d8e)


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

### 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-05-31 13:39:20 -06:00
Kibana Machine
9bb0b0dd01 skip failing test suite (#158465) 2023-05-31 11:21:12 -04:00
Julia Rechkunova
8d399fe3aa
[UnifiedFieldList] Remove redundant server routes. Create new example plugin for unified field list components and migrate tests. (#158377)
- Closes https://github.com/elastic/kibana/issues/147885
- Closes https://github.com/elastic/kibana/issues/157109

## Summary

**Before:**

Unified Field List plugin has internal routes (wrappers for client code)
which exist only to run api functional tests against them:
 - `/api/unified_field_list/existing_fields/{dataViewId}`
 - `/api/unified_field_list/field_stats`

Client code does not call these routes directly. So there is no reason
in keeping and versioning them.

**After:**
- Internal routes are removed 
- A new "Unified Field List Examples" page was created
http://localhost:5601/app/unifiedFieldListExamples
- API functional tests (which used the routes) were converted to
functional tests against this new example page
- Created a new `unifiedFieldList` page object which is used now in
functional tests (methods are extracted from existing `discover` page
object).

**For testing:**

Steps:
1. Run Kibana with examples: `yarn start --run-examples` 
2. Install sample data
3. And navigate to Developer Examples > Unified Field List Examples
page.

![May-26-2023
13-24-03](5a2149f7-beb8-40a5-b7d5-9eeaabfd42ca)


### 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-05-31 13:25:47 +02:00
Matthias Wilhelm
3ef8b46433
[Discover][Lens] Removes the dataview dependency from the text based mode (#158531)
## Summary

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

This PR:
- make the text based languages to work with adhoc dataviews and not
permanent dataviews. The text based languages will not be related with
dataviews
- enables the timepicker always for text based languages
- the timepicker is disabled if the index pattern doesn't have an
@timestamp field
- the timepicker is enabled if the index pattern has an @timestamp field
- the timepicker is enabled if the index pattern doesn't have an
@timestamp field but there is a dirty state (user is writing the query
and hasn't hit the update button. We do that to give the user the
ability to change the timepicker with the query
- An info text has been added to the editor footer to inform the users
about the @timestamp existence

The timepicker in the disabled state needs to have a disabled status
text (All time) but this is not possible atm. I have created an issue to
eui https://github.com/elastic/eui/issues/6814 to add this property.
This is going to be tackled before the 8.9 FF but we don't want to block
this PR

<img width="1839" alt="image"
src="8fc0a492-1f00-41b6-a4a6-b0527725931f">

### 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: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-05-31 11:55:16 +03:00
Kibana Machine
2ef9994cbf skip failing test suite (#157776) 2023-05-26 14:43:09 -04:00
Tiago Costa
f97be41f67
skip flaky suite (#158529) 2023-05-26 15:41:28 +01:00
Dzmitry Lemechko
0f8b3595f1
update geckodriver to 4.0.0 (#158384)
## Summary

Updating geckodriver dependency to use the latest 0.33.0 driver. Module
was reworked, I removed import from webdriver.ts
2023-05-26 10:24:19 +02:00
Dzmitry Lemechko
5d4eec5131
unskip tests for chrome, fix tags (#158405)
## Summary

With Firefox update to v113 on our CI workers, we noticed that tests are
run slower and more often fail with timeouts.
Unfortunately our auto-skip functionality skip the test suite
completely, meaning it won't run on Chrome as well.

This PR unskips the firefox failed test to run on Chrome, I also fix the
labels for some suites to run only sub set of tests for now.
2023-05-26 09:19:53 +01:00
Devon Thomson
5342563a22
[Dashboard] Fast Navigation Between Dashboards (#157437)
## Summary
Makes all navigation from one Dashboard to another feel snappier.
2023-05-25 14:40:48 -04:00
Stratoula Kalafateli
0975ebabd1
[Text based languages] Creates editor reusable component (#158008)
## Summary

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

This PR:
- Moves the editor from unified-search to a standalone package
- The editor has now a core ui settings dependency but is going to have
an expressions dependency too when merged with the ESQL branch
- Adds a new plugin (text-based-languages) which is used to pass the
dependencies on the package. The user can either use this plugin without
giving any dependencies or use the package with passing the dependecies
on the KibanaContextProvider.
- Adds storybook for the editor (I used the mdx stories as we did on the
random sampling package)

<img width="1668" alt="image"
src="763a3112-1ae5-49bb-81f3-acd02892e402">


### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-05-22 14:27:38 +03:00
Robert Oskamp
87be4cb678
Initial e2e tests for serverless plugins (#157166)
## Summary

This PR adds boilerplate code and a few initial end-to-end tests to
serverless plugins.

Note that the tests defined in this PR are not part of any CI run yet,
this will be done in a follow-up after this PR is merged.

### Details

The serverless test structure corresponds to what we have in
`x-pack/test` with API tests in `api_integration` and UI tests in
`functional`, each with their set of helper methods and sub-directories
for
- `common` functionality shared across serverless projects (core, shared
UX, ...)
- `observability` project specific functionality
- `search` project specific functionality
- `security` project specific functionality

The `shared` directory contains fixtures, services, ... that are shared
across `api_integration` abd `functional` tests.

```
x-pack/test_serverless/
├─ api_integration
│  ├─ services
│  ├─ test_suites
│  │  ├─ common
│  │  ├─ observability
│  │  ├─ search
│  │  ├─ security
├─ functional
│  ├─ page_objects
│  ├─ services
│  ├─ test_suites
│  │  ├─ common
│  │  ├─ observability
│  │  ├─ search
│  │  ├─ security
├─ shared
│  ├─ services
│  ├─ types
```

See also `x-pack/test_serverless/README.md`

### Run tests

Similar to how functional tests are run in `x-pack/test`, you can point
the functional tests server and test runner to config files in this
`x-pack/test_serverless` directory, e.g. from the `x-pack` directory
run:
```
node scripts/functional_tests_server.js --config test_serverless/api_integration/test_suites/common/config.ts
```
and 
```
node scripts/functional_test_runner.js --config test_serverless/api_integration/test_suites/common/config.ts
```

### Additional changes

- The stateful `common_page` page object used the existence of the
global nav to determine `isChromeVisible` and `isChromeHidden`, which is
not working when the global nav is disabled. To solve this, a
`data-test-subj` that indicates the chrome visible state is added to the
Kibana app wrapper and is used for the checks.
- Add a few `data-test-subj` entries to the Observability overview page.
- Add optional `dataTestSubj` to the `Navigation` component and use that
for the serverless search nav.
- Add optional `titleDataTestSubj` to the `SolutionNav` component and
use it for the serverless security nav.
- Add a data-test-subj entry to the Search overview page.
2023-05-22 12:57:38 +02:00
Julia Rechkunova
633444e615
[Discover] Remove custom h1 focus logic. Unskip tests. (#155613)
Closes https://github.com/elastic/kibana/issues/152131
Closes https://github.com/elastic/kibana/issues/152938

https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2163
2023-05-22 02:09:57 -07:00
Stratoula Kalafateli
363f2b5e6a
[Visualizations] Removes the visualize:enableLabs advanced setting (#157699)
## Summary

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

This PR:

- Removes the visualize:enableLabs setting which doesn't do anything
after the presentation team decided to hide the creation of the legacy
input controls from the UI
- Cleanups wherever the components associated with this feature were
used

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-05-22 10:40:26 +03:00
Lukas Olson
9359c634df
Use locators service for Discover shared URLs (#154947)
## Summary

Resolves https://github.com/elastic/kibana/issues/148886.
Resolves https://github.com/elastic/kibana/issues/142525.
Resolves https://github.com/elastic/kibana/issues/156275.

Uses the URL locators service for generating the URL when clicking
"Share" in Discover. This enables ad-hoc data views in shared URLs. As a
result, we no longer show a prompt to save the ad-hoc data view before
sharing, which means we can get rid of some no-longer used hooks.

### 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-05-17 14:26:53 -07:00
Nathan Reese
596c7b3e70
[maps] distance spatial join (#156618)
Fixes https://github.com/elastic/kibana/issues/154605

PR adds new layer wizard for spatial join. Wizard provides an easy
interface to create spatial join as well as advertising the capability
in the main layer creation work flow.
<img width="200" alt="Screen Shot 2023-05-04 at 12 16 45 PM"
src="https://user-images.githubusercontent.com/373691/236293473-8a740171-0910-4574-8e38-0ba1ab38a5fd.png">
<img width="400" alt="Screen Shot 2023-05-04 at 12 17 07 PM"
src="https://user-images.githubusercontent.com/373691/236293475-ad04cb1c-b49f-46aa-8ae6-2df62123b516.png">

PR renames `Terms joins` editor panel to `Joins` and updates panel to
accommodate spatial joins. Displays UI for creating, editing and
deleting spatial joins.
<img width="200" alt="Screen Shot 2023-05-04 at 12 17 20 PM"
src="https://user-images.githubusercontent.com/373691/236293486-49aa8063-0860-4aa7-af85-e47f899a3885.png">
<img width="400" alt="Screen Shot 2023-05-04 at 12 41 39 PM"
src="https://user-images.githubusercontent.com/373691/236298721-e237b801-0539-4960-82e6-d992f5bd8bb4.png">
<img width="300" alt="Screen Shot 2023-05-04 at 12 17 25 PM"
src="https://user-images.githubusercontent.com/373691/236293489-b18c7a0a-b339-42f0-870d-88785175c1f6.png">
<img width="300" alt="Screen Shot 2023-05-04 at 12 17 37 PM"
src="https://user-images.githubusercontent.com/373691/236293492-f4ea3b9b-d28d-46d8-a243-c0e82cb5efda.png">

PR also updates inspector request registration name and description to
provide less technical names that provide better meaning of what request
is fetching and how everything fits together. I think this really helps
understandability of join requests
<img width="500" alt="Screen Shot 2023-05-04 at 12 22 56 PM"
src="https://user-images.githubusercontent.com/373691/236294739-53d32f65-a5e5-4b6d-b41a-7f76fcd731b5.png">


#### Known issues
Issues discovered by this PR that are in main and will be resolved
separately.
* When using spatial join wizard, if there are no matches to left source
then layer gets stuck in loading state
https://github.com/elastic/kibana/issues/156630
* Term join left field change not applied as expected
https://github.com/elastic/kibana/issues/156631

#### Developer level changes

LayerDescriptor
* Changes joins from `JoinDescriptor` to `Partial<JoinDescriptor>`. This
did not change the content, just updated the type to better reflect
contents.

JoinDescriptor
* Changes right from `JoinSourceDescriptor` to
`Partial<JoinSourceDescriptor>`. This did not change the content, just
updated the type to better reflect contents.

IVectorLayer interface changes
* Remove getJoinsDisabledReason
* Remove showJoinEditor

IVectorSource interface changes
* Replaced showJoinEditor with supportsJoins
* Removed getJoinsDisabledReason

Replaced GeoIndexPatternSelect prop `value` with `dataView`.
1) provides better symmetry since on change return DataView
2) First time GeoIndexPatternSelect need to use a pre-loaded data view.
By passing in DataView, loading state can be more easily handled.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nick Peihl <nickpeihl@gmail.com>
2023-05-17 06:20:04 -06:00
Cee Chen
b9ea4ce4f5
Upgrade EUI to v79.0.1 (#156925)
## Summary

`eui@77.2.2`  `eui@79.0.1`

🦴 The primary changes in this upgrade are around the deprecated
`EuiLoadingContent` being removed in favor of `EuiSkeletonText`.
- Most instances have been a [direct swap of
usage](327626a7be),
but [some replacements were a bit more
opinionated](e6ceb36a75)
as I saw them as potential to take advantage of `EuiSkeletonText`'s
syntactical sugar and screen reader announcements for when state
switches to loaded.

---

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

**Bug fixes**

- Fixed broken push `EuiFlyout` behavior
([#6764](https://github.com/elastic/eui/pull/6764))


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

- Updated all `EuiSkeleton` components with new props that allow for
more control over screen reader live announcements:
`announceLoadingStatus`, `announceLoadedStatus`, and `ariaLiveProps`
([#6752](https://github.com/elastic/eui/pull/6752))
- Improved keyboard accessibility in `EuiPageHeader` by ensuring the
right side menu items come into focus from left to right.
([#6753](https://github.com/elastic/eui/pull/6753))

**Breaking changes**

- Removed deprecated `EuiLoadingContent`. Use the `EuiSkeleton`
components instead. ([#6754](https://github.com/elastic/eui/pull/6754))


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

- Improved the contrast ratio of `EuiCheckbox`, `EuiRadio`, and
`EuiSwitch` in their unchecked states to meet WCAG AA guidelines.
([#6729](https://github.com/elastic/eui/pull/6729))
- Added React Testing Library `*ByTestSubject` custom commands to
`within()`. RTL utilities can be imported from
`@elastic/eui/lib/test/rtl`.
([#6737](https://github.com/elastic/eui/pull/6737))
- Updated `EuiAvatar` to support a new letter `casing` prop that allow
customizing text capitalization
([#6739](https://github.com/elastic/eui/pull/6739))
- Updated `EuiFocusTrap` to support the `gapMode` prop configuration
(now defaults to `padding`)
([#6744](https://github.com/elastic/eui/pull/6744))

**Bug fixes**

- Fixed inconsistency in `EuiSearchBar`'s AND/OR semantics between DSL
and query string generation
([#6717](https://github.com/elastic/eui/pull/6717))
- Fixed `EuiFieldNumber`'s native browser validity detection causing
extra unnecessary rerenders
([#6741](https://github.com/elastic/eui/pull/6741))
- Fixed the `scrollLock` property on `EuiFocusTrap` (and other
components using `EuiFocusTrap`, such as `EuiFlyout` and `EuiModal`) to
no longer block scrolling on nested portalled content, such as combobox
dropdowns ([#6744](https://github.com/elastic/eui/pull/6744))

**Breaking changes**

- `EuiAvatar`s with the default `user` type will now default to
capitalizing all initials in uppercase
([#6739](https://github.com/elastic/eui/pull/6739))

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-05-15 16:09:31 -05:00
Dzmitry Lemechko
7f4ceb1d30
Update ftr services to handle occasional WebDriverError (#157283)
## Summary

Starting with Chrome v113 we noticed that `_area_chart.ts` suite became
flaky #156821 failing with
`WebDriverError: unknown error: unhandled inspector error:
{"code":-32000,"message":"No node with given id found"}`
Updating chromedriver to v113 did not solve the issue and more tests
started to fail with the same error.

It happens occasionally when driver returns unhandled error instead of
StaleElementReferenceException. This PR adds the error to the
`RETRY_ON_ERRORS` list, so that FTR can search for the element again and
re-try the action on it:

```
           │ debg getVisibleText: elementId=29C3E81151C86107290DD8F020524333_element_290
           │ debg Chromedriver issue #4440, WebElementWrapper.getVisibleText: WebDriverError: unknown error: unhandled inspector error: {"code":-32000,"message":"No node with given id found"}
           │        (Session info: chrome=113.0.5672.63)
           │ debg current ElementID=29C3E81151C86107290DD8F020524333_element_290
           │ debg new ElementID=29C3E81151C86107290DD8F020524333_element_293
           │ debg Searching again for the element 'By(css selector, [data-test-subj="visEditorInterval"] + .euiFormErrorText)', 2 attempts left
           │ debg getVisibleText: elementId=29C3E81151C86107290DD8F020524333_element_293
           └- ✓ pass  (1.8s)
```

There is no need to use `Retry` service, `WebDriverWrapper.retryCall`
should handle the issue.

Flaky test runner 100x for Vis Editor config:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2236
Flaky test runner 100x for Cases config:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2237

And 2 more 100x:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2239
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2237
2023-05-10 20:00:44 +02:00
Hannah Mudge
ac84798672
[Input Controls] Hide ability to create legacy input controls (#156455)
Closes https://github.com/elastic/kibana/issues/150639

>**Note**
> The attached issue mentions possibly preventing legacy input control
panels from being **cloned** - while I understand the reasoning for this
(if we allow cloning, aren't we essentially still giving users a
roundabout way to create new legacy input controls?), I think that the
primary goal of this should be to make legacy input controls **more
difficult to access**, not necessarily to prevent users from creating
legacy input controls entirely.
>
> After all, if we went to prevent **any** new legacy input controls
from being created, wouldn't we also have to prevent users from cloning
existing **dashboards** that have at least one legacy input control? I
think that simply hiding them from the creation menus is a good enough
beginning step until we can finally remove them for good.

## Summary

This PR takes another step forward in the deprecation process of the
legacy input controls by hiding them from the visualization wizard + the
visualization creation menu by marking the `input_control_vis` type as
`hidden`.

**Visualize Wizard**
| Before | After |
|--------|-------|
|
![image](https://user-images.githubusercontent.com/8698078/236558589-f1947a01-b306-46ea-9c30-5aa4662340de.png)
|
![image](https://user-images.githubusercontent.com/8698078/236558642-a6f6bd0a-529b-4760-9f19-4967fde9548f.png)
|

> **Note**
> As a follow up, the [visualize team will be removing the
`visualize:enableLabs`
setting](https://github.com/elastic/kibana/issues/152833), since it is
used exclusively to hide the controls from this wizard; however, because
this PR hides them from this wizard via the `hidden` property, this
setting is now obsolete.

**Creation Menu in Dashboard**
| Before | After |
|--------|-------|
|
![image](https://user-images.githubusercontent.com/8698078/236559127-17765459-286f-4b50-b69a-7087c4055840.png)
|
![image](https://user-images.githubusercontent.com/8698078/236559199-192614c9-5c5c-484c-ab7f-822c8a54f67f.png)
|


### 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] 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-05-10 08:55:23 -06:00
Tiago Costa
e381a33c2c
skip flaky suite (#135251) 2023-05-09 20:58:22 +01:00
Tiago Costa
ad7cec95db
skip flaky suite (#155029) 2023-05-08 17:12:22 +01:00
Tre
d1feb43722
[QA] Fixup flaky test (#156373)
## Summary

Resolves https://github.com/elastic/kibana/issues/136856

- Add async keyword where it should have been.
- Split archive into kbn and es archives...
instigated by Pierre's comment:
https://github.com/elastic/kibana/issues/136856#issuecomment-1253609280
   - Note: Had to use both archive types as 
one archive is "hidden", and cannot be accessed via the kbn client.
 - Unload via Pierre's "new" clean method.
- Add shell fn to print out server's currently loaded so's, with user
and pass hardcoded for local dev.
2023-05-08 11:32:53 +01:00
Stratoula Kalafateli
b540825f50
Stabilize formatters tests (#156835)
## Summary

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

A small refactoring of the formatters tests to stabilize and unskip them
Build 200 times
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2227#_
2023-05-08 08:34:31 +03:00
Hannah Mudge
9c0b7bc37a
[Dashboard] Fix flaky time picker tests (#156761)
Closes https://github.com/elastic/kibana/issues/155603

## Summary

For the test that failed above, the failure screenshot shows that we
weren't waiting long enough for the pie chart to load before calling
`expectEmptyPieChart`:


![image](https://user-images.githubusercontent.com/8698078/236501367-290f481c-d17b-4d0a-a696-f50020fbd605.png)

Rather than adding a `wait` for just the single failing test, I figured
we should probably **always** wait for the page and visualizations to
load when adding visualizations - so, I added
`dashboard.waitForRenderComplete` to any methods I could find in the
Dashboard page object and the Dashboard visualizations service where
panels were being added.

Note that, if adding a given visualization also requires navigating to
and from the Dashboard app, I also added
`header.waitUntilLoadingHasFinished` before
`dashboard.waitForRenderComplete` so that we can wait for the Dashboard
app to load first before ensuring the visualizations have also loaded.
This should hopefully prevent any **other** tests that rely on adding a
visualization to be less flaky.

### Flaky Test Runner

<a
href="https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2228"><img
src="https://user-images.githubusercontent.com/8698078/236513873-d97f7c61-e8ee-4f5f-b76d-13998e62dadc.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-05-05 13:08:52 -07:00
Tiago Costa
646e7f78d4
skip flaky suite (#156821) 2023-05-05 20:06:31 +01:00
Hannah Mudge
ce7ef40d9a
[Dashboard] Fix "Unlink from library" panel title bug (#156589)
Closes https://github.com/elastic/kibana/issues/156539
Closes https://github.com/elastic/kibana/issues/156544

## Summary


As part of investigating the attached flaky test suite, I realized that
the flakiness was because we weren't waiting long enough for a panel to
be added and/or removed from the library - so, I added a check to ensure
the library notification appears in `saveToLibrary`, and similarly I
added a check to ensure that the library notification **disappears** in
`unlinkFromLibary`.

However, after adding these extra checks, the following test started to
fail:


23a45bde21/x-pack/test/functional/apps/dashboard/group2/panel_titles.ts (L148-L155)

Way, way, way back in `8.1`, one of my [first
PRs](https://github.com/elastic/kibana/pull/120815) was meant to fix
some problems with dashboard panel titles - as part of this, I was
**supposed** to make sure that, if a by-reference panel is given a
custom panel title, the title should remain the same after unlinking
(i.e. it should remain as the custom title rather than resetting to the
by-reference title). So, I added the above test to verify this
behaviour.

Turns out, though, that this test had a flaw - because we weren't
waiting long enough for the panel to actually be disconnected from the
library, this test was only passing because it was grabbing and
comparing titles **before** the unlink was complete - so, even though
the title actually **was** being reset back to the original library
title, this test did not catch this bug. This has been the case since
`8.1` when this test was introduced - not sure how it was missed, but we
never actually fixed the bug where dashboard panel titles are getting
reset when unlinking from the library.

So, this PR actually accomplishes two things:
1) It fixes the flakiness of the attached tests by adding the extra
library notification checks:
<a
href="https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2217"><img
src="https://user-images.githubusercontent.com/8698078/236044233-8a07aadc-8a55-40f2-9ed2-798a91501f68.png"/></a>
2) It ensures that, if a by-reference panel has a custom title,
unlinking it from the library will not impact that title.

### Before


https://user-images.githubusercontent.com/8698078/236062484-b1cedc47-cb19-4273-aec7-17d24b55953b.mov


### After


https://user-images.githubusercontent.com/8698078/236062862-aace4f09-d007-401a-ba57-b9b74fda0b33.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] 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-05-05 08:54:39 -06:00
Stratoula Kalafateli
589e21b0d2
[TSVB] Remove all usages of resetPage from tests (#156785)
## Summary

Closes https://github.com/elastic/kibana/issues/156705
Closes https://github.com/elastic/kibana/issues/156796

Removes all the visualBuilder.resetPage() usages as they are flaky.
2023-05-05 16:47:50 +03:00
Davis McPhee
daa912d5bc
[Discover] [Dashboard] [Embeddable] Hide full screen button for saved search embeddables (#156774)
## Summary

This PR hides the full screen button for saved search embeddables since
the full screen mode can result in display issues when parent elements
use CSS transforms.

Originally I was trying to figure out how to only hide the full screen
button when used in a dashboard, but it turns out that saved searches
embedded in Canvas have the same issue, so I think it makes sense to
just disable the full screen button entirely for saved search
embeddables until we have a reason to do otherwise:

![canvas_saved_search](https://user-images.githubusercontent.com/25592674/236359826-b1491477-b658-48f8-81d6-0ebc8e63e7be.gif)

Resolves #151499.

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

### 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-05-05 10:12:54 -03:00
Robert Oskamp
dd1fd2647a
[ML] Functional tests - stabilize export job tests (#156586)
This PR stabilizes the export job tests by making sure the export
success toast is closed before moving on to the next test. As part of
that, the toasts service got two new methods
`dismissAllToastsWithChecks` and `assertToastCount`.
2023-05-05 09:17:04 +02:00
Stratoula Kalafateli
501bfcdccb
[Discover] Enable sharing for text based languages (#156652)
## Summary

Part of https://github.com/elastic/kibana/issues/154331
Enables the sharing menu for text based languages

<img width="2497" alt="image"
src="https://user-images.githubusercontent.com/17003240/236152022-62aebfd0-3863-4ba9-8d2b-f6a6fc6a0bf6.png">

There are 2 significant changes from the dataview mode
1. The timefield is not populated on the csv report
2. We dont check if there is a persisted dataview. We don't want this
for text based languages mode as this mode won't work with dataviews.

### 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
2023-05-05 09:07:20 +03:00
Kibana Machine
8b6c6e94a4 skip failing test suite (#156671) 2023-05-04 08:58:10 -04:00
Stratoula Kalafateli
e5f6f96e9c
[TSVB] Remove flakiness on resetPage (#156484)
## Summary

Closes https://github.com/elastic/kibana/issues/156457
Closes https://github.com/elastic/kibana/issues/156452
Closes https://github.com/elastic/kibana/issues/156439
Closes https://github.com/elastic/kibana/issues/156400
Closes https://github.com/elastic/kibana/issues/156599
Closes https://github.com/elastic/kibana/issues/156502
Closes https://github.com/elastic/kibana/issues/156501

the resetPage function is creating this flakiness. I cant figure out why
but is on the navigateToUrl function. Sometimes it reports #create and
sometimes without the hash. The navigateToUrl is not needed as it is
already done on another function. The only thing that is needed is the
setTimePicker function.

Flaky runer (100 times)
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2210
2023-05-04 12:33:29 +03:00
Marco Liberati
91c1ff15d3
[Lens] Fix field formatters functional tests (#156190)
## Summary

Fixes #155884 , #156463, #156463

This PR make sure the field editor panel is closed after save before
proceeding with other steps.
The main problem here was that the tests were not failing if the
execution was too fast and the panel was still open on test end, so the
cleanup process will fail as would expect the panel to be closed, and
cannot find the right elements to click.


Flaky runner 50 ( ):
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2213

### 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-05-03 16:06:49 +02:00
Marco Liberati
3c261237b0
[Lens][TSVB] Add TSDB field checks functional tests (#156165)
## Summary

Fix #155830 

Add basic checks for both Lens and TSVB editors.
In Lens more advanced tests are performed to check for compatible and
uncompatible operations for specific TSDB field types.
In TSVB the check is only performed to verify that the editor and
visualization doesn't crash and when unsupported the right error message
is shown.


### 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-05-02 09:58:07 +02:00
Davis McPhee
9d023f6a42
[Discover] [Unified Histogram] Fix reset search button not fully resetting Unified Histogram state (#155967)
## Summary

This PR fixes an issue where resetting a saved search would not fully
reset the Unified Histogram state. The issue was caused by multiple
state values changing in quick succession which resulted in some state
getting overwritten, so I've updated `use_discover_state` to batch state
updates and improve diffing when state changes.

Fixes #151395.

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

### 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-30 19:50:58 -03:00
Julia Rechkunova
c6b6e28f2f
[Discover] Remove legacy field stats (#155503)
Closes https://github.com/elastic/kibana/issues/154841

## Summary

This PR removes legacy field stats which were shown in field popover
before. They were based on loaded hits and were less precise than the
current default field stats (they are based now on 5000 documents per
shard sample).

Before (opt-in option):
<img width="500" alt="Screenshot 2023-04-21 at 14 26 57"
src="https://user-images.githubusercontent.com/1415710/233635136-ebc4017e-71c3-499d-96ac-544e26ea4b49.png">

After:
<img width="500" alt="Screenshot 2023-04-21 at 14 26 20"
src="https://user-images.githubusercontent.com/1415710/233635194-8c60fd05-5db6-40e0-abcd-672689932a83.png">
2023-04-27 17:57:08 +02:00
Dzmitry Lemechko
c7cf75eff1
[failed test reporter] no github issues for WebDriver invalid session id (#155707)
## Summary

This PR adds `NoSuchSessionError: invalid session id` to the irrelevant
failures, so that we don't open github issues for it.

The issue is often related to test infrastructure (worker) and occurs
when Chrome process is reaching the available memory limits. It doesn't
fail regularly but when it fails multiple github issues are
[reported](https://github.com/elastic/kibana/issues?q=is%3Aissue+NoSuchSessionError+is%3Aopen)
and we usually just close them as CI related.
2023-04-25 17:06:34 +02:00
Kevin Logan
2fad86a6c5
[Security Solution] Remove index false from artifact saved objects mappings (#155204)
Updates the mappings for the artifact saved objects

This effort is part of
https://github.com/elastic/security-team/issues/6268 and
https://github.com/elastic/dev/issues/2189

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Gerard Soldevila <gerard.soldevila@elastic.co>
2023-04-25 09:31:57 -04:00
Stratoula Kalafateli
f1c18d940d
[Lens] Test field formatters for keyword fields (#155491)
## Summary

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

Adds field formatters test for keyword fields

[Flaky runner 50 times
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2155

](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2157)
### Checklist

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
2023-04-25 13:01:03 +01:00
Julia Rechkunova
aae33d0919
[Discover] Improve the copy when reaching the limit of discover:sampleSize (#155533)
Closes https://github.com/elastic/kibana/issues/154186

This PR removes a link to Advanced Settings from the copy.

<img width="998" alt="Screenshot 2023-04-21 at 18 01 14"
src="https://user-images.githubusercontent.com/1415710/233683075-3e87c451-7ff2-49e4-ae5f-89c3eff12153.png">

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-25 10:02:07 +02:00
Gerard Soldevila
21351df953
Split the .kibana saved objects index into multiple indices (#154888)
## Description 

Fix https://github.com/elastic/kibana/issues/104081

This PR move some of the SO types from the `.kibana` index into the
following ones:
- `.kibana_alerting_cases`
- `.kibana_analytics`
- `.kibana_security_solution`
- `.kibana_ingest`

This split/reallocation will occur during the `8.8.0` Kibana upgrade
(*meaning: from any version older than `8.8.0` to any version greater or
equal to `8.8.0`*)

**This PR main changes are:**
- implement the changes required in the SO migration algorithm to
support this reallocation
- update the FTR tools (looking at you esArchiver) to support these new
indices
- update hardcoded references to `.kibana` and usage of the
`core.savedObjects.getKibanaIndex()` to use new APIs to target the
correct index/indices
- update FTR datasets, tests and utility accordingly 

## To reviewers

**Overall estimated risk of regressions: low**

But, still, please take the time to review changes in your code. The
parts of the production code that were the most impacted are the
telemetry collectors, as most of them were performing direct requests
against the `.kibana` index, so we had to adapt them. Most other
contributor-owned changes are in FTR tests and datasets.

If you think a type is misplaced (either we missed some types that
should be moved to a specific index, or some types were moved and
shouldn't have been) please tell us, and we'll fix the reallocation
either in this PR or in a follow-up.

## .Kibana split

The following new indices are introduced by this PR, with the following
SO types being moved to it. (any SO type not listed here will be staying
in its current index)

Note: The complete **_type => index_** breakdown is available in [this
spreadsheet](https://docs.google.com/spreadsheets/d/1b_MG_E_aBksZ4Vkd9cVayij1oBpdhvH4XC8NVlChiio/edit#gid=145920788).

#### `.kibana_alerting_cases`
- action
- action_task_params
- alert
- api_key_pending_invalidation
- cases
- cases-comments
- cases-configure
- cases-connector-mappings
- cases-telemetry
- cases-user-actions
- connector_token
- rules-settings
- maintenance-window

#### `.kibana_security_solution`
- csp-rule-template
- endpoint:user-artifact
- endpoint:user-artifact-manifest
- exception-list
- exception-list-agnostic
- osquery-manager-usage-metric
- osquery-pack
- osquery-pack-asset
- osquery-saved-query
- security-rule
- security-solution-signals-migration
- siem-detection-engine-rule-actions
- siem-ui-timeline
- siem-ui-timeline-note
- siem-ui-timeline-pinned-event

#### `.kibana_analytics`

- canvas-element
- canvas-workpad-template
- canvas-workpad
- dashboard
- graph-workspace
- index-pattern
- kql-telemetry
- lens
- lens-ui-telemetry
- map
- search
- search-session
- search-telemetry
- visualization

#### `.kibana_ingest`

- epm-packages
- epm-packages-assets
- fleet-fleet-server-host
- fleet-message-signing-keys
- fleet-preconfiguration-deletion-record
- fleet-proxy
- ingest_manager_settings
- ingest-agent-policies
- ingest-download-sources
- ingest-outputs
- ingest-package-policies

## Tasks / PRs

### Sub-PRs

**Implementation**
- 🟣 https://github.com/elastic/kibana/pull/154846
- 🟣 https://github.com/elastic/kibana/pull/154892
- 🟣 https://github.com/elastic/kibana/pull/154882
- 🟣 https://github.com/elastic/kibana/pull/154884
- 🟣 https://github.com/elastic/kibana/pull/155155

**Individual index split**
- 🟣 https://github.com/elastic/kibana/pull/154897
- 🟣 https://github.com/elastic/kibana/pull/155129
- 🟣 https://github.com/elastic/kibana/pull/155140
- 🟣 https://github.com/elastic/kibana/pull/155130

### Improvements / follow-ups 

- 👷🏼 Extract logic into
[runV2Migration](https://github.com/elastic/kibana/pull/154151#discussion_r1158470566)
@gsoldevila
- Make `getCurrentIndexTypesMap` resillient to intermittent failures
https://github.com/elastic/kibana/pull/154151#discussion_r1169289717
- 🚧 Build a more structured
[MigratorSynchronizer](https://github.com/elastic/kibana/pull/154151#discussion_r1158469918)
- 🟣 https://github.com/elastic/kibana/pull/155035
- 🟣 https://github.com/elastic/kibana/pull/155116
- 🟣 https://github.com/elastic/kibana/pull/155366
## Reallocation tweaks

Tweaks to the reallocation can be done after the initial merge, as long
as it's done before the public release of 8.8

- `url` should get back to `.kibana` (see
[comment](https://github.com/elastic/kibana/pull/154888#discussion_r1172317133))

## Release Note

For performance purposes, Kibana is now using more system indices to
store its internal data.

The following system indices will be created when upgrading to `8.8.0`:

- `.kibana_alerting_cases`
- `.kibana_analytics`
- `.kibana_security_solution`
- `.kibana_ingest`

---------

Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Georgii Gorbachev <georgii.gorbachev@elastic.co>
2023-04-25 09:43:42 +02:00