Commit graph

22292 commits

Author SHA1 Message Date
Jean-Louis Leysens
de6d8ca33f
[http] Make http headers required for internal and when in dev mode (#158667)
## Summary

Updates the versioned router behaviour to require the setting of version
on requests when either requesting against:

(1) internal endpoints
or
(2) all endpoints when Kibana is in dev mode

The idea is that when calling our versioned endpoints we should always
be requesting a specific version to avoid possible inconsistent
behaviour if our defaults resolution changes onprem (oldest version) vs
serverless (newest version).

Partially addresses https://github.com/elastic/kibana/issues/158722

### Follow up
* We should update our dev docs to point out this behaviour


### 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
2023-06-02 07:16:35 -07: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
Pierre Gayvallet
1ba8be4b8a
V2 migration algorithm: add tests for model versions (#158697)
## Summary

Add integration tests of scenarios using the v2 migration algorithm with
SO types that are using the model version API
2023-06-02 03:35:48 -07:00
Peter Pisljar
e3c3ba8aeb
bwca for unified search suggestions route (#158796)
## Summary

Makes unified search field suggestion route bwca

resolves https://github.com/elastic/kibana/issues/157085

- [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-06-02 12:42:41 +03:00
Clint Andrew Hall
117d8c8c4e Address feedback 2023-06-01 17:34:58 -04:00
Clint Andrew Hall
bd1ff1c677 Commit review suggestions
Co-authored-by: Michael Dokolin <mikhail.dokolin@elastic.co>
2023-06-01 17:34:58 -04:00
Clint Andrew Hall
815226a926 Provide React Context composition; new Kibana Context, consolidate/deprecate. 2023-06-01 17:34:58 -04:00
Alejandro Fernández Haro
312ba3a758
[Telemetry] Update notice message (#158669)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
2023-06-01 17:53:02 +02:00
Gerard Soldevila
06c337f903
Refactor KibanaMigrator, improve readability, maintainability and UT (#155693)
Addresses the following feedback:
https://github.com/elastic/kibana/pull/154151#discussion_r1158470566

Similar to what has been done for ZDT, the goal of this PR is to extract
the logic of the `runV2Migration()` from the `KibanaMigrator` into a
separate file.

The PR also fixes some incomplete / incorrect UTs and adds a few missing
ones.
2023-06-01 14:47:40 +02: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
Marco Liberati
eed0d01531
[Lens] Make reference lines use the correct formatter when configured (#158266)
## Summary

Fixes #156771 

This PR add the correct logic to extract the table column formatter,
when set, and use it within a reference line context. If no formatter is
set then the group/axis formatter is used.

Included required changes directly in this PR to make it reviewable.

<img width="1227" alt="Screenshot 2023-05-31 at 14 53 40"
src="3615ca3a-f9d3-4b0a-b8f1-4c47dcf953dd">



### 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: Peter Pisljar <peter.pisljar@elastic.co>
2023-06-01 10:09:26 +02: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
Nick Peihl
0fb3099620
[Controls] Move controls routes to internal (#158762)
Fixes #157084

## Summary

Moves Controls plugin routes to internal.

[More info on versioning HTTP
APIs](https://docs.elastic.dev/kibana-dev-docs/versioning-http-apis)
2023-05-31 17:16:09 -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
Trevor Pierce
aa1d266939
Upgrade EUI to v81.0.0 (#158330)
## Summary

`@elastic/eui@80.0.0`  `@elastic/eui@81.0.0`

---

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

- Added ability to set `options.checked` to "mixed" in `EuiSelectable`
([#6774](https://github.com/elastic/eui/pull/6774))

**Bug fixes**

- Portalled components (e.g. `EuiPopover`, `EuiModal`, `EuiFlyout`) will
correctly inherit text color from its nearest `EuiThemeProvider` parent.
`<EuiText color="default">` is no longer needed.
([#6775](https://github.com/elastic/eui/pull/6775))

**Breaking changes**

- `EuiSelectable` no longer renders a `data-test-selected` attribute on
its list items. Use the `aria-checked` property instead
([#6774](https://github.com/elastic/eui/pull/6774))
- Nested `EuiThemeProvider`s now render a wrapping `<span>` element in
order to correctly set the inherited text `color` of all descendants.
`<EuiText color="default">` is no longer needed.
([#6775](https://github.com/elastic/eui/pull/6775))

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance Chen <constance.chen@elastic.co>
2023-05-31 11:51:10 -07:00
Matthew Kime
b3561b9328
[data view field editor] Refactor business logic from hooks to controller (#156203)
## Summary

This PR moves a lot of business logic from `field_preview_context.tsx`
to the controller. No functionality is changed. This is a step to simply
the code and eventually reduce bugs.

My approach to this change was -
1. Move `useState` calls to controller state, adding necessary setters
2. Move `useCallback` calls to controller methods.
3. Move `useEffect` calls - this one is the most complex - they get
called when state values are set. Sometimes the code is inlined or a new
private method might be created.

The bits that remain are mostly related to form values referred to as
`params`. I'm saving this for a subsequent PR as this PR is large enough
as it is.

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-05-31 12:28:52 -05:00
Ido Cohen
172e84bdc9
[Cloud Security] find csp rule template api 2023-05-31 19:09:31 +03:00
Gerard Soldevila
1c5b09dd06
Prevent rollback for failed upgrades from write_blocking SO indices (#158725)
Tackles https://github.com/elastic/kibana/issues/155136

When an upgrade fails, a cluster might be on a partially migrated state
(with some indices already updated to the newer version). When rolling
back to the previous version, in ESS, this can cause these indices to be
`write_blocked`.

This PR aims at detecting this situation and failing early, effectively
preventing to `write_block` any indices.
2023-05-31 17:09:47 +02: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
Pierre Gayvallet
c20566d418
[ZDT] use range clause for outdated doc query (#158651)
## Summary

Related to https://github.com/elastic/kibana/issues/150296

Use a `range` clause for version filtering for the ZDT outdated doc
query, similar to what is already done for the `v2` algo, to avoid
eventually trying to migrate documents from higher versions (which would
result in a migration failure)
2023-05-31 07:55:07 +02:00
Davis McPhee
097666f1a0
[Discover] Update single doc view locator to URL encode rowId (#158635)
## Summary

Fixes #158525.

### 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-30 18:57:45 -03:00
Nathan Reese
21151dd39f
[visualizations] read only config flag for vis_types (#158507)
Part of https://github.com/elastic/kibana/issues/154307

### Overview
PR adds `readOnly` configuration to all vis_type plugins.

### Test
* Start kibana with `yarn start --serverless=es`
* set the following yaml configuration values
    ```
    vis_type_gauge.readOnly: true
    vis_type_heatmap.readOnly: true
    vis_type_metric.readOnly: true
    vis_type_pie.readOnly: true
    vis_type_table.readOnly: true
    vis_type_tagcloud.readOnly: true
    vis_type_timelion.readOnly: true
    vis_type_timeseries.readOnly: true
    vis_type_vislib.readOnly: true
    vis_type_xy.readOnly: true
    ```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-05-30 12:45:31 -06:00
Alex Szabo
5ee40a9094
[cli] Adjust CLI to treat extra options consistently (#158257)
## Summary

Addresses: #105371 
One can use `--elasticsearch.password ---my-password---`,
`--elasticsearch.password=---mypassword---` or `--elasticsearch.password
\"---mypassword\"` both in these cases. Commander is splitting
single-dash inputs, it can't be prevented, so for those cases, use
quotes or compound options.

The original problem can be reproduced like this:
```shell
yarn start --elasticsearch.password "-some-password"
```

We were using some extra argument parsing prototype extension in
(command.js)[./src/cli/command.js] - this allows for collecting extra
options, but the proprietary logic had a few incorrect assumptions.
(e.g.: extra opts will be already split by `=` by the time we get them,
shorthands will be split to individual flags).

(1) This change makes it explicit in the code, that the single-letter
flags (`-fcz`) are not supported in the extra options.

The core of the problem is now how we treat an ambiguous expression like
this:
```
kibana --password "--kebabs--are--my--favourite--" --somethingElse 283
```
Is the `"--kebabs--are--my--favourite--"` another flag, or is it a value
for the previous option?

Unfortunately, both interpretations will have shortcomings. 
- if we treat it as a boolean flag, then values starting with "--" will
be incorrectly treated as flags, and an error will be displayed (in the
case of a very unfortunate random generated string)
- if we treat it as a value always, then incorrectly ordered
options/flags will be consumed in place of values

Maybe the latter one will happen less often. For that, people would have
to incorrectly assume that `--booleanOn` type flags exist, especially
among the non-listed options. Or they'd have to incorrectly parameterize
the command, for that they can review their own usage locally, and see
their error in the ordering.

(2) This change makes it explicit, that extra options will come in
pairs.

Also, added tests for the base use case, and the _dash_ edge case.

### 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] Checked and works on 7.17/7.13 (it was originally reported on
7.13).

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-05-30 18:09:16 +02:00
Rudolf Meijering
094b62a6d6
Migrations: dynamically adjust batchSize when reading (#157494)
## Summary

Migrations read 1000 documents by default which works well for most
deployments. But if any batch happens to be > ~512MB we hit NodeJS' max
string length limit and cannot process that batch. This forces users to
reduce the batch size to a smaller number which could severely slow down
migrations.

This PR reduces the impact of large batches by catching
elasticsearch-js' `RequestAbortedError` and reducing the batch size in
half. When subsequent batches are successful the batchSize increases by
20%. This means we'll have a sequence like:

1. Read 1000 docs  (small batch)
2. Read 1000 docs 🔴 (too large batch)
3. Read 500 docs  
4. Read 600 docs  
5. Read 720 docs 
6. Read 864 docs 
7. Read 1000 docs  (small batch)

This assumes that most clusters just have a few large batches exceeding
the limit. If all batches exceed the limit we'd have 1 failure for every
4 successful reads so we pay a 20% throughput penalty. In such a case it
would be better to configure a lower `migrations.batchSize`.

Tested this manually:
1. Start ES with more heap than the default, otherwise reading large
batches will cause it to run out of memory
`ES_JAVA_OPTS=' -Xms6g -Xmx6g' yarn es snapshot
--data-archive=/Users/rudolf/dev/kibana/src/core/server/integration_tests/saved_objects/migrations/archives/8.4.0_with_sample_data_logs.zip`
2. Ingest lots of large documents of ~5mb
   ```
curl -XPUT
"elastic:changeme@localhost:9200/_security/role/grant_kibana_system_indices"
-H "kbn-xsrf: reporting" -H "Content-Type: application/json" -d'
      {                           
        "indices": [                                            
          {
            "names": [
              ".kibana*"
            ],
            "privileges": [
              "all"
            ],
            "allow_restricted_indices": true
          }
        ]
      }'

curl -XPOST "elastic:changeme@localhost:9200/_security/user/superuser"
-H "kbn-xsrf: reporting" -H "Content-Type: application/json" -d'
      {
        "password" : "changeme",  
        "roles" : [ "superuser", "grant_kibana_system_indices" ]
      }'

curl -XPUT
"superuser:changeme@localhost:9200/.kibana_8.4.0_001/_mappings" -H
"kbn-xsrf: reporting" -H "Content-Type: application/json" -d'
      {
"dynamic": false,
            "properties": {

            }

      }'

      set -B                  # enable brace expansion
      for i in {1..400}; do
curl -k --data-binary
"@/Users/rudolf/dev/kibana/src/core/server/integration_tests/saved_objects/migrations/group3/body.json"
-X PUT
"http://superuser:changeme@localhost:9200/.kibana_8.4.0_001/_doc/cases-comments:"{$i}"?&pretty=true"
-H "Content-Type: application/json"
      done
   ```
3. Start Kibana with a modest batchSize otherwise we could OOM ES `node
scripts/kibana --dev --migrations.batchSize=120`



<details><summary>Example logs. Note the "Processed x documents" only
logs when the next batch is successfull read, so the order seems wrong.
To improve it we'd need to log progress after a batch is successfully
written instead 🤷 </summary>
```
[.kibana] Processed 120 documents out of 542.
[.kibana] REINDEX_SOURCE_TO_TEMP_READ -> REINDEX_SOURCE_TO_TEMP_TRANSFORM. took: 3667ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_TRANSFORM -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1740ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1376ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1402ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1311ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1388ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_READ. took: 900ms.
[.kibana] Read a batch that exceeded the NodeJS maximum string length, retrying by reducing the batch size in half to 60.
[.kibana] REINDEX_SOURCE_TO_TEMP_READ -> REINDEX_SOURCE_TO_TEMP_READ. took: 1538ms.
[.kibana] Processed 240 documents out of 542.
[.kibana] REINDEX_SOURCE_TO_TEMP_READ -> REINDEX_SOURCE_TO_TEMP_TRANSFORM. took: 2054ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_TRANSFORM -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1042ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1310ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1388ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_READ. took: 1130ms.
[.kibana] Processed 300 documents out of 542.
[.kibana] REINDEX_SOURCE_TO_TEMP_READ -> REINDEX_SOURCE_TO_TEMP_TRANSFORM. took: 2610ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_TRANSFORM -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1262ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1299ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1363ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1341ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_READ. took: 572ms.
[.kibana] Processed 372 documents out of 542.
[.kibana] REINDEX_SOURCE_TO_TEMP_READ -> REINDEX_SOURCE_TO_TEMP_TRANSFORM. took: 3330ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_TRANSFORM -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1488ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1349ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1312ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1380ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1310ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_READ. took: 139ms.
[.kibana] Processed 458 documents out of 542.
[.kibana] REINDEX_SOURCE_TO_TEMP_READ -> REINDEX_SOURCE_TO_TEMP_TRANSFORM. took: 3278ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_TRANSFORM -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1460ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1370ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1303ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_INDEX_BULK. took: 1384ms.
[.kibana] REINDEX_SOURCE_TO_TEMP_INDEX_BULK -> REINDEX_SOURCE_TO_TEMP_READ. took: 1298ms.
[.kibana] Processed 542 documents out of 542.
[.kibana] REINDEX_SOURCE_TO_TEMP_READ -> REINDEX_SOURCE_TO_TEMP_CLOSE_PIT. took: 4ms.
```
</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)


### Risks


### For maintainers

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

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Gerard Soldevila <gerard.soldevila@elastic.co>
2023-05-30 06:25:07 -07:00
Pierre Gayvallet
e12b716ae2
ZDT migration algorithm: allow to switch from a v2-managed state (#158434)
## Summary

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

Change the logic of the `zdt` algorithm to be able to re-use an existing
"v2 managed" cluster state (a kibana cluster previously running the v2
migration algorithm) if compatible.

Technically the v2 index state is compatible with zdt after 8.8 (when we
introduced `indexTypeMap` and restricted to compatible mapping changes
only).

See https://github.com/elastic/kibana/issues/158372 for more detailed
explanations.
2023-05-30 01:25:14 -07:00
Pierre Gayvallet
50950e9c3b
[ZDT] SOR: handle higher-version documents retrieved from persistence. (#158251)
## Summary

Follow-up of https://github.com/elastic/kibana/pull/157895
Part of https://github.com/elastic/kibana/issues/150312

Adapt the SOR to accept retrieving documents on higher versions from the
persistence, and convert them back to the latest knows version (using
the version schema feature added in
https://github.com/elastic/kibana/pull/157895).
2023-05-30 00:11:56 -07:00
Julia Rechkunova
e928b519f3
[Discover] Fix grid theme (#158231)
Addresses https://github.com/elastic/kibana/issues/158201

## Summary

This PR fixes grid row selection in dark mode.

Before:
<img width="300" alt="Screenshot 2023-05-23 at 09 53 11"
src="e447ebb5-ca75-4778-84a7-ec654aca3709">

After:
<img width="300" alt="Screenshot 2023-05-23 at 09 52 44"
src="86f7ccd0-a306-426b-9fcb-91d9131a7da6">

For testing:
Enable dark mode on User Profile page.
2023-05-30 07:31:25 +02:00
Peter Pisljar
fb4946d0a5
moving visualizations team owned paths to /internal (#157984) 2023-05-29 16:58:41 +02:00
Alexi Doak
30ba9a985d
[ResponseOps] [OnWeek] Adding new fields to the form lib library (#157040)
## Summary

Adding the following new fields to form lib:

- ButtonGroupField
- MultiButtonGroupField
- DatePickerField
- PasswordField
- HiddenField

I updated the maintenance windows form and the following connector forms
to use the new fields:

- cases_webhook
- email
- servicenow
- swimlane
- torq
- webhook
- xmatters
2023-05-26 14:38:27 -07:00
Brad White
7655cb9e9e
[Windows] Fix string comparison in bat scripts for default dir. (#158517)
## Summary
 
Fixes #137477

The `node.options` file was not being found if `KBN_PATH_CONF` was not
set because the default directory fallback condition was failing.

`kibana.bat` before fix, can see the flag I added in
`config/node.options` is missing and default options are used:


![broken](178f75a5-f3ec-4785-bd7c-aa609e43b786)


The flag is correctly added after fix:


![fixed](f607a7b3-cc04-40ea-9608-db6466b0333f)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-05-26 09:26:56 -07:00
Julia Rechkunova
ad85cc0727
[UnifiedSearch] Add query DSL docs link to filters UI (#156543)
## Summary

This PR adds a link to "Query DSL" syntax docs.

<img width="1047" alt="Screenshot 2023-05-03 at 15 40 22"
src="https://user-images.githubusercontent.com/1415710/235933352-0c88d3d6-d5a3-4f10-ab5c-a438ecf44032.png">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: shahzad31 <shahzad31comp@gmail.com>
2023-05-26 14:26:23 +02: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
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
Brad White
0c3ca366a1
Add build_date to kbn:api/status (#157905)
## Summary

Adds build date to `GET kbn:api/status` similar to ES. Example output
running locally:

```json
{
  "name": "ES-DMVD5M3",
  "uuid": "545ba70c-063e-449b-af21-6c8e7b30f77e",
  "version": {
    "number": "8.9.0",
    "build_hash": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "build_number": 9007199254740991,
    "build_snapshot": false,
    "build_date": "2023-05-15T23:12:09.000Z"
  },
  ...rest
}
```


### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios


## Release Note

The status endpoint now returns the build date alongside other build
information.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-05-25 10:21:47 -07:00
Kevin Delemme
0d2a1083c0
feat(composite_slo): create schemas and route boilerplates (#158381) 2023-05-25 10:38:14 -04:00
James Gowdy
7d93816d98
[ML] Versioning transforms APIs (#158273)
Adds versioning to all of the transform APIs.
Versions are added to the server side routes and to the client side
functions which call the routes.
Updates API tests to add the API version to the request headers.

All of the APIs are internal and have been given the version '1'.

**Internal APIs**

`/internal/transform/privileges`
`/internal/transform/field_histograms/{dataViewTitle}`
`/internal/transform/privileges`
`/internal/transform/transforms/{transformId}/messages`
`/internal/transform/transforms/_nodes`
`/internal/transform/transforms`
`/internal/transform/transforms/{transformId}`
`/internal/transform/transforms/_stats`
`/internal/transform/transforms/{transformId}/_stats`
`/internal/transform/transforms/{transformId}`
`/internal/transform/transforms/{transformId}/_update`
`/internal/transform/reauthorize_transforms`
`/internal/transform/delete_transforms`
`/internal/transform/reset_transforms`
`/internal/transform/transforms/_preview`
`/internal/transform/start_transforms`
`/internal/transform/stop_transforms`
`/internal/transform/schedule_now_transforms`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-05-25 13:12:10 +01:00
Yngrid Coello
b2f0f4e335
[Logs Onboarding] Adds install shipper step for custom logs (#158386)
Closes #154937

This PR is an extension of
[#157802](https://github.com/elastic/kibana/pull/157802) which was
reverted because public Api endpoint versioning problems.

![Screenshot 2023-05-15 at 5 02 29
PM](62484fb3-e02f-410d-aa7a-86bcc4dc0b03)

---------

Co-authored-by: Oliver Gupte <oliver.gupte@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-05-25 00:29:32 -04:00
Nathan Reese
34e26250f0
[tsvb] read only mode (#157920)
part of https://github.com/elastic/kibana/issues/154307

PR adds ability to put TSVB into read only mode - preventing TSVB
visualizations from being created and edited.

To test:
* start kibana with `yarn start --serverless=es`
* add `vis_type_timeseries.readOnly: true` to kibana.yml

Visualization public plugin changes:
* Removes `hideTypes` from VisualizationSetup contract. Used by Maps
plugin to set "hidden" to true for tile_map and region_map visualization
types. In 8.0, tile_map and region_map visualization type registration
moved into maps plugin so `hideTypes` no longer needed.
* Renamed vis type definition `hidden` to `disableCreate`.
* Added `disableEdit` to vis type definition.
* Hide edit link in dashboard panel options when `disableEdit` is true
* Does not display links and edit action in listing table when
`disableEdit` is true

Visualization server plugin changes:
* Add `readOnlyVisType` registry to set up contract
* Update visualization savedObject.management.getInAppUrl to return
undefined when vis type has been registered as readOnly.
* Prevents "readOnly "visualization types from being displayed in global
search results
* Prevents "readOnly "visualization types from having links in saved
object management listing table.

Timeseries server plugin changes:
* Add `readOnly` yaml configuration
* Expose `readOnly` yaml configuration to public
* When `readOnly` is true, call
VisualizationsServerSetup.registerReadOnlyVisType to mark vis type as
read only

Timeseries public plugin changes:
* Set disableCreate and disableEdit to true when `readOnly` is true

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-05-24 15:28:25 -06:00
Matthew Kime
5fa2226b06
[data views] Content management api implementation (#155803)
## Summary

Data views implements the content management api and associated minor
changes. The bulk of the changes are in
`(common|public|server)/content_management)`

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Lukas Olson <olson.lukas@gmail.com>
2023-05-24 13:29:59 -05:00
Marco Liberati
360790290b
[Lens] Handle properly partition chart empty slices (#158346)
## Summary

Fix #157465

This PR replaces the Symbol empty slice with a string value.
Here's the result of the same scenario of the issue:

<img width="1402" alt="Screenshot 2023-05-24 at 09 20 34"
src="b1b3db27-0e31-43be-8ae1-57dbcd645408">



### 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-24 13:00:44 +02:00
Marco Liberati
504d2216b2
[FieldFormatters] Gracefully handle Symbols without throwing (#158347)
## Summary

This is a tiny improvement on the formatters side to avoid crashing any
app which by mistake if passing a JS `Symbol`.
This happened in https://github.com/elastic/kibana/issues/157465 due to
a Symbol used for an empty pie slice.

This solution prevent from crashing, producing a string of type
`"Symbol(<tokenString>)"`


### 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-24 12:46:33 +02:00
Pierre Gayvallet
acdadf2b46
[ZDT] set switchToModelVersionAt to 8.10.0 for all types (#158267)
## Summary

Sets `switchToModelVersionAt` to `8.10.0` for all registered SO types,
forcing them to switch to the model version API once `main` is on
version `8.10.0` (~end of june)
2023-05-24 00:11:28 -07:00
Jonathan Budzenski
46dc7ff1d7 Revert "[Logs Onboarding] Adds install shipper step for custom logs (#157802)"
This reverts commit 12401b2216.
2023-05-23 15:13:52 -05:00
Oliver Gupte
12401b2216
[Logs Onboarding] Adds install shipper step for custom logs (#157802)
Closes #154937

This PR includes the steps to install standalone elastic agent +
reporting the status from bash script back to kibana.

![Screenshot 2023-05-15 at 5 02 29
PM](62484fb3-e02f-410d-aa7a-86bcc4dc0b03)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Yngrid Coello <yngrid.coello@elastic.co>
Co-authored-by: Yngrid Coello <yngrdyn@gmail.com>
2023-05-23 21:04:54 +02:00
Matthias Wilhelm
84d070d2f7
[Discover] Remove kbnUrlStateStorage of Discover main state container (#158225)
The exposed kbnUrlStateStorage property of `DiscoverStateContainer` is removed. It was just used for testing and is replaced with `await new Promise(process.nextTick);`
2023-05-23 11:22:54 +02:00
Matthias Wilhelm
12da3d0721
[Discover] Remove state persistAdHocDataView (#158227)
Eliminating code that's no longer in use
2023-05-23 10:09:16 +02:00
Stratoula Kalafateli
2c1a2ef93a
[Visualizations] Fix user profile dark mode bugs (#158162)
## Summary

Closes https://github.com/elastic/kibana/issues/158154
Closes https://github.com/elastic/kibana/issues/158048
Closes https://github.com/elastic/kibana/issues/158052

This PR fixes the UI bugs that were created when we added the user
profile dark mode settings.

There are many cases in our visualizations where we are checking if the
uiSetting is in dark mode and apply custom colors. This is not the case
anymore. Now we need to check this flag from the theme$.

There is a bug on the user profile service. When the user profile is set
to Light and the advanced setting is set to dark mode, the dark mode is
applied. I have reported this to the security team.

### 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-23 09:04:43 +03:00
Matthias Wilhelm
ef678f3d92
[Discover] Migrate session session initialization to state container (#156957)
## Summary

Migrate `useSearchSession` to state container's `initializeAndSync` function, to remove another `hook`.
2023-05-22 18:33:42 +02:00