Commit graph

6599 commits

Author SHA1 Message Date
Alex Szabo
f458714998
[ci] skip tests that fail on chrome 128+ (#192830)
## Summary
Currently `google-chrome-stable` is pinned to `v127.x.x` as with
`v128.x.x` we get a few FTR breakages (some of them on visual
inaccuracies, some other).

We'd like to unpin chrome, and move on to 128, and start fixing these
test failures. So we're skipping the failures temporarily, bumping
chrome to 128, then allow for unskipping and fixing these.
2024-09-16 15:18:49 +02:00
Yulia Čech
3de252e688
[Index Management] Added docs count and size for serverless (#191985)
## Summary

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

This PR adds size and documents count to indices and data streams tables
in Index Management on serverless.

### Screenrecording



https://github.com/user-attachments/assets/51a933e2-e4ef-42a0-9c82-39bf6e194ee0



### Screenshots 
<img width="1047" alt="Screenshot 2024-09-06 at 19 20 59"
src="https://github.com/user-attachments/assets/8c6d0378-116f-44e3-aaca-0c95f135b1bf">
<img width="1045" alt="Screenshot 2024-09-06 at 19 21 06"
src="https://github.com/user-attachments/assets/37477f7b-e229-4400-9a28-8382f7d1155e">
<img width="1036" alt="Screenshot 2024-09-06 at 19 27 59"
src="https://github.com/user-attachments/assets/0fd2ef1b-3b0c-4d3e-8b56-984281436898">
<img width="506" alt="Screenshot 2024-09-06 at 19 28 12"
src="https://github.com/user-attachments/assets/1823a964-6f6f-464b-9910-e586ccd2e9bb">



### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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)
2024-09-16 06:44:41 -05:00
Stratoula Kalafateli
708a96cca8
[ES|QL] Set drop null columns param correctly for partial results (#192666)
## Summary

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

We were not setting the `drop_null_columns ` queryString for partial
results and as a result it was returning the empty columns only for the
initial request, resulting in the weirdness that is being described in
the issue.
2024-09-16 10:44:55 +02:00
mohamedhamed-ahmed
7b3fa3ab10
[One Discover] Custom Service Name Cell (#192381)
closes https://github.com/elastic/kibana/issues/190456

## 📝  Summary

This PR adds the agent icon as a prefix to the service name if an agent
name is available.

## 🎥 Demo


https://github.com/user-attachments/assets/4fad743a-6806-4440-91eb-fdfa35785a19

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-15 12:28:04 -05:00
Kibana Machine
e0b5bdcb13 skip failing test suite (#192510) 2024-09-14 05:26:54 +10:00
Kibana Machine
1e04475e59 skip failing test suite (#184600) 2024-09-14 00:06:46 +10:00
Jean-Louis Leysens
b52695edfb
[Cloud] Add configuration for CSP value (#190491)
## Summary

Exposes the CSP from the cloud setup plugin contract.

Related https://github.com/elastic/kibana/issues/190023

## Notes

Intended for cloud deployments, how/where will this config value be set?


### Checklist

Delete any items that are not applicable to this PR.

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2024-09-13 10:55:36 +02:00
Eyo O. Eyo
f2f5096c76
add ftr tests for panel group order in dashboards (#192168)
## Summary

follow up to https://github.com/elastic/kibana/pull/191828, this FTR
test makes it such that any modification to registered add panel actions
group order would require an approval from the presentation team.

<!-- ### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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)
-->
2024-09-13 09:17:11 +02:00
Christiane (Tina) Heiligers
3a68f8b3ae
[http] api_integration tests handle internal route restriction (#192407)
fix https://github.com/elastic/kibana/issues/192052
## Summary

Internal APIs will be
[restricted](https://github.com/elastic/kibana/issues/163654) from
public access as of 9.0.0. In non-serverless environments, this breaking
change will result in a 400 error if an external request is made to an
internal Kibana API (route `access` option as `"internal"` or
`"public"`).
This PR allows API owners of non-xpack plugins to run their `ftr` API
integration tests against the restriction and adds examples of how to
handle it.

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


Note to reviewers: The header needed to allow access to internal apis
shouldn't change your test output, with or without the restriction
enabled.

### How to test the changes work:
#### Non x-pack:
1. Set `server.restrictInternalApis: true` in `test/common/config.js`
2. Ensure your tests pass

#### x-pack:
1. Set `server.restrictInternalApis: true` in
`x-pack/test/api_integration/apis/security/config.ts`
2. Ensure the spaces tests pass

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-09-12 09:23:10 +02:00
Marco Antonio Ghiani
ac66e7cb44
[One Discover] Add row indicators for log documents (#190676)
## 📓 Summary

Closes #190457 

This change extracts the logic around the logs document
controls/indicator from Logs Explorer and registers the same controls in
Discover through the extension point added in #188762.

The controls are registered only for the `logs-data-source-profile`
contextual profile.


https://github.com/user-attachments/assets/40adfb19-357f-46e1-9d69-fc9c0860c832

## 👣 Next steps
- [ ] https://github.com/elastic/kibana/issues/190670
- [ ] https://github.com/elastic/kibana/issues/190460

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-11 15:11:31 +02:00
Julia Rechkunova
3a747006cf
[OneDiscover][UnifiedDocViewer] Add filtering for selected fields (#191930)
- Closes https://github.com/elastic/kibana/issues/191536

## Summary

This PR adds "Selected fields only" toggle to UnifiedDocViewer. The
selected state will be persisted under
`unifiedDocViewer:showOnlySelectedFields` in Local Storage.

<img width="1779" alt="Screenshot 2024-09-11 at 10 08 26"
src="https://github.com/user-attachments/assets/db68a64c-bb0a-4a83-9eba-d1497b35416e">




### 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] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: Davis McPhee <davis.mcphee@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-11 12:46:36 +02:00
Davis McPhee
034625a70b
[Discover] Cell actions extension (#190754)
## Summary

This PR adds a new cell actions extension to Discover using the
[`kbn-cell-actions`](packages/kbn-cell-actions) framework which Unified
Data Table already supports, allowing profiles to register additional
cell actions within the data grid:
<img width="2168" alt="cell_actions"
src="https://github.com/user-attachments/assets/f01a97be-d90f-4284-9cbf-4a2e1a5dd78c">

The extension point supports the following:
- Cell actions can be registered at the root or data source level.
- Supports an `isCompatible` method, allowing cell actions to be shown
for all cells in a column or conditionally based on the column field,
etc.
- Cell actions have access to a `context` object including the current
`field`, `value`, `dataSource`, `dataView`, `query`, `filters`, and
`timeRange`.


**Note that currently cell actions do not have access to the entire
record, only the current cell value. We can support this as a followup
if needed, but it will require an enhancement to `kbn-cell-actions`.**

## Testing
- Add `discover.experimental.enabledProfiles: ['example-root-profile',
'example-data-source-profile', 'example-document-profile']` to
`kibana.dev.yml` and start Kibana.
- Ingest the Discover context awareness example data using the following
command: `node scripts/es_archiver
--kibana-url=http://elastic:changeme@localhost:5601
--es-url=http://elastic:changeme@localhost:9200 load
test/functional/fixtures/es_archiver/discover/context_awareness`.
- Navigate to Discover and create a `my-example-logs` data view or
target the index in an ES|QL query.
- Confirm that the example cell actions appear in expanded cell popover
menus and are functional.

Resolves #186576.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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)
2024-09-10 21:24:32 -03:00
Cee Chen
20566d0262
Upgrade EUI to v95.10.1 (#192026)
`v95.9.0``v95.10.1`

> [!note]
> **EuiDataGrid**'s header cells have received a major UX change in
order to support interactive children within header content. Column
header actions now must be hovered and then clicked directly, or opened
with the Enter key, as opposed to being able to click the entire header
cell to see the actions popover.

_[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_

---

## [`v95.10.0`](https://github.com/elastic/eui/releases/v95.10.0)

- Updated `EuiDataGrid` to support interactive header cell content
([#7898](https://github.com/elastic/eui/pull/7898))
- Updated `EuiSearchBar`'s `field_value_selection` filter type with a
new `autoSortOptions` config, allowing consumers to configure whether or
not selected options are automatically sorted to the top of the filter
list ([#7958](https://github.com/elastic/eui/pull/7958))
- Updated `getDefaultEuiMarkdownPlugins` to support the following new
default plugin configurations:
([#7985](https://github.com/elastic/eui/pull/7985))
- `parsingConfig.linkValidator`, which allows configuring
`allowRelative` and `allowProtocols`
  - `parsingConfig.emoji`, which allows configuring emoticon parsing
- `processingConfig.linkProps`, which allows configuring rendered links
with any props that `EuiLink` accepts
- See our **Markdown plugins** documentation for example
`EuiMarkdownFormat` and `EuiMarkdownEditor` usage
- Updated `EuiDatePicker` to support `append` and `prepend` nodes in its
form control layout ([#7987](https://github.com/elastic/eui/pull/7987))

**Bug fixes**

- Fixed border rendering bug with inline `EuiDatePicker`s with
`shadow={false}` ([#7987](https://github.com/elastic/eui/pull/7987))
- Fixed `EuiSuperSelect`'s placeholder text color to match other form
controls ([#7995](https://github.com/elastic/eui/pull/7995))

**Accessibility**

- Improved the keyboard navigation and screen reader output for
`EuiDataGrid` header cells
([#7898](https://github.com/elastic/eui/pull/7898))

## [`v95.10.1`](https://github.com/elastic/eui/releases/v95.10.1)

**Bug fixes**

- Fixed a visual bug in compact density `EuiDataGrid`s, where the header
cell height would increase when the actions button became visible
([#7999](https://github.com/elastic/eui/pull/7999))

---------

Co-authored-by: Lene Gadewoll <lene.gadewoll@elastic.co>
2024-09-10 16:06:21 -05:00
Kibana Machine
3130c9f016 skip failing test suite (#192509) 2024-09-11 04:47:51 +10:00
Kurt
5ec0cb0ed2
FIPS FTR Overrides and test skips (#192053)
## Summary

Kibana requires security to be enabled and a platinum or better license
to run in FIPS mode.

Since not all FTR configs assume these conditions will be enabled, we
cant run every test. So these failing tests will be skipped when these
overrides are enforced.

This does not mean that the functionality is not supported in FIPS mode.

## What is the point?

Running these tests in FIPS mode is not necessarily to check that the
functionality works as expected, it is to make sure Kibana does not
crash due to unsupported algorithm usage (`md4`, `md5`, etc).

When running in FIPS mode, Node will throw an `unsupported envelope
function` error (with FIPS enabled) if it encounters an unsupported
algorithm, so the more lines of code covered, the more assurance we can
have that features will work in FIPS mode.

## Nature of the changes

To skip a test, a `tag` is added: `this.tags('skipFIPS')`

`this.tags` is only available for `describe('description', function()
{...});`

There should not be any logical changes, just tests wrapped in an extra
block.

I tried to make the wording in the new `describe` block "flow" 😅 if you
prefer different wording in the new `describe` block - please add a
change!

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nikita Indik <nikita.indik@elastic.co>
2024-09-10 13:17:40 -04:00
Nathan Reese
9dfad5b12a
[embeddable rebuild] integrate react control group embeddable into dashboard container - reloaded (#192221)
PR replaces legacy embeddable control group implementation with react
control group implementation in DashboardContainer.

#### background
Work originally done in https://github.com/elastic/kibana/pull/190273.
https://github.com/elastic/kibana/pull/190273 was reverted by
https://github.com/elastic/kibana/pull/191993 because of dashboard
performance degradation. It was determined that degradation was because
new react embeddable controls fixed a regression where dashboard panels
are loading before control filters are created. This regression was
introduced by https://github.com/elastic/kibana/pull/187509.

The work around is that this PR keeps the currently broken behavior in
main and loads panels before control filters are ready. The thinking is
that the migration would replace like for like and not introduce any
performance changes. Then, at a later time, the regression could be
resolved.

#### reviewing
These are the same changes from
https://github.com/elastic/kibana/pull/190273 minus some work to
introduce a current regression in main. A full re-review is not needed.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Hannah Mudge <hannah.wright@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-10 08:50:17 -06:00
Dzmitry Lemechko
4cd23a1df7
[ftr] migrating 'saved_objects_management/bulk' API integration test to deployment-agnostic one (#192070)
## Summary

_The goal is to consolidate 2 existing test files with identical logic
into a single, deployment-agnostic test file:_

Files to be replaced:
- test/api_integration/apis/saved_objects_management/bulk_delete.ts
- test/api_integration/apis/saved_objects_management/bulk_get.ts
-
x-pack/test_serverless/api_integration/test_suites/common/saved_objects_management/bulk_delete.ts
-
x-pack/test_serverless/api_integration/test_suites/common/saved_objects_management/bulk_get.ts

New test file:
-
x-pack/test/api_integration/deployment_agnostic/apis/saved_objects_management/bulk_delete.ts
-
x-pack/test/api_integration/deployment_agnostic/apis/saved_objects_management/bulk_get.ts


The migration leverages the serverless test file as a basis for the new
deployment-agnostic test.
Necessary modifications are minimal and include FTR context provider &
its services to ensure compatibility across different environments.
Lastly new file has to be loaded into both the serverless and stateful
config files under
`x-pack/test/api_integration/deployment_agnostic/configs`

This approach ensures that the test logic remains consistent while
reducing redundancy and maintenance effort.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-10 05:33:32 -05:00
Catherine Liu
3d8fad56f2
[Dashboard] Remove library and drilldown notifications (#190797)
## Summary

Pre-req for #182535.

We're removing the linked to library and drilldown notifications as part
of the panel hover actions redesign which gets rid of the title bar in
edit mode. We want to prevent panels from having a title bar when titles
are hidden and believe these notifications are no longer necessary. The
only notification retained is the panel filter notification.
 
<img width="421" alt="Screenshot 2024-08-20 at 6 34 16 AM"
src="https://github.com/user-attachments/assets/9f954a6f-3a70-43c9-a3c3-28f92f1efba8">
<img width="269" alt="Screenshot 2024-08-20 at 6 37 18 AM"
src="https://github.com/user-attachments/assets/b6c154d5-0b8c-4c8b-ac72-a190d03f8801">


I also did some cleanup and removed unused page objects from the vis,
dashboard, and discover functional tests.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-09 14:11:15 -07:00
Luke Elmers
b6287708f6
Adds AGPL 3.0 license (#192025)
Updates files outside of x-pack to be triple-licensed under Elastic
License 2.0, AGPL 3.0, or SSPL 1.0.
2024-09-06 19:02:41 -06:00
Tre
666ab3dcfb
[FTR] Refactor SuperTest provider to the kbn-ftr-common-functional-services pkg (#191999)
Move supertest from global folder to specific package.

Resolves: https://github.com/elastic/kibana/issues/191970
2024-09-05 20:05:45 +01:00
Marta Bondyra
9e8244f470
[Lens] Chart switch redesign (#187475)
## Summary

1. The main change is chart switch redesign:

<img width="401" alt="Screenshot 2024-08-26 at 15 08 50"
src="https://github.com/user-attachments/assets/a2da17d5-b068-4eeb-9723-0b64cc6cbcf0">

2. Toolbar changes for most of the visualization (refer to design files)

<img width="930" alt="Screenshot 2024-08-26 at 15 09 14"
src="https://github.com/user-attachments/assets/7f76aed3-99d8-438b-b304-91042c99381d">

<img width="942" alt="Screenshot 2024-08-26 at 15 08 56"
src="https://github.com/user-attachments/assets/5bed1916-8723-42b5-8f7d-4b363c5736c9">



#### Subtasks
- reorders the elements in the charts switch
- redesigns chart switch visually
- adds deprecated group (metric)
- changes the add subtype layer menu
- adds description to chart switch
- subselect for bar/gauge visualizations
- adds border to workspace panel
- changes `boxesHorizontal` icon to `boxesVertical`

Resolves https://github.com/elastic/kibana/issues/179260 also fixes
https://github.com/elastic/kibana/issues/182677
switching between chart types
2024-09-05 12:32:45 +02:00
Tre
69665cecd0
[FTR] Refactor test/common/services/* -> packages/kbn-ftr-common-functional-[ui-]services/* (#191805)
## Summary

Moving common services to respective new homes.

This PR is revived from a previously
[merged](09a365850e)
and [reverted PR](https://github.com/elastic/kibana/pull/191765) as
[detailed
here](https://github.com/elastic/kibana/pull/189051#issuecomment-2318999361).
- This was due to "extra" tests being applied to
https://github.com/elastic/kibana/pull/191708
- These "extra" tests were applied as
https://github.com/elastic/kibana/pull/191708 changes files within
`x-pack/plugins/observability_solution/` as configured
[here](https://github.com/elastic/kibana/blob/main/.buildkite/scripts/pipelines/pull_request/pipeline.ts#L129)

### Why these failures were not caught in the original
[PR](https://github.com/elastic/kibana/pull/189051)
The pipeline is generated at runtime, and the original
[PR](https://github.com/elastic/kibana/pull/189051) had zero changes
under `x-pack/plugins/observability_solution/`
 
 ## Changes on top of original PR
 - Add `ci:all-cypress-suites` label to run extra tests
- Add `services` stanza to which contains the missing references by
spreading the services from `@kbn/ftr-common-functional-services` &&
`@kbn/ftr-common-functional-ui-services` into the stanza, for the
following:
   - `x-pack/plugins/observability_solution/synthetics/e2e/config.ts`
   - `x-pack/plugins/observability_solution/apm/ftr_e2e/ftr_config.ts` 
-
`x-pack/plugins/observability_solution/observability_onboarding/e2e/ftr_config.ts`
   - `x-pack/plugins/observability_solution/profiling/e2e/ftr_config.ts`
   - `x-pack/plugins/observability_solution/synthetics/e2e/config.ts`
   - `x-pack/plugins/observability_solution/uptime/e2e/config.ts`
 

 
 
Blocked by: https://github.com/elastic/kibana/issues/191961
Resolves: https://github.com/elastic/kibana/issues/188541

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-09-05 10:00:55 +01:00
Julia Rechkunova
80f920d4c5
[Discover] Unskip context awareness tests (#192074)
- Closes https://github.com/elastic/kibana/issues/191260
- Closes https://github.com/elastic/kibana/issues/190725
- Closes https://github.com/elastic/kibana/issues/190629
- Closes https://github.com/elastic/kibana/issues/191921
- Closes https://github.com/elastic/kibana/issues/189994
- Closes https://github.com/elastic/kibana/issues/192095
2024-09-05 00:31:14 -03:00
Nathan Reese
86a63dabef
Revert "Integrate react control group embeddable into dashboard container (#190273) (#191993)
#190273 introduced a performance regression. Reverting to move metrics to baseline again and create some time to identify root cause.

Co-authored-by: Thomas Neirynck <thomas@elastic.co>
2024-09-04 14:11:04 -04:00
Davis McPhee
2629fa82a8
[Discover] [Unified Data Table] Improve Discover / Unified Data Table performance in ES|QL mode (#191249)
## Summary

This PR includes several performance improvements for ES|QL mode in
Discover:
- Memoize `UnifiedDataTableRenderCellValue` to reduce re-renders.
- Show the loading spinner immediately on state changes that should
trigger a refetch so that changed state isn't applied to the grid before
the fetch completes. This also helps to reduce re-renders on state
changes.
- Replace [`EuiDataGrid` in-memory
sorting](https://eui.elastic.co/#/tabular-content/data-grid-advanced#data-grid-in-memory)
with a custom implementation using the `@kbn/sort-predicates` package
(the same one Lens uses for its data grid). EUI in-memory sorting has a
drastic impact on performance because it renders the entire grid off
screen in order to parse cell values, detect their schema, and then sort
the rows. This can cause rendering delays of several seconds for larger
datasets on each render of the data grid. The new approach will sort in
memory based on actual field values and pass the sorted rows to the data
grid, which is both much more performant as well as improving the
sorting behaviour across field types.
- Use the `overscanRowCount` option from
[react-window](https://github.com/bvaughn/react-window) to render some
additional rows outside of view in the data grid, which minimizes pop-in
of rows while scrolling quickly.

There are also a couple of bug fixes included in the PR as a result of
the new sorting behaviour:
- Numeric columns are now sorted correctly where previously they used
alphabetic sorting.
- The "Copy column" action in data grid columns now correctly copies the
column values in the current sort order instead of copying them unsorted
as it used to.

Before - 66,904 `UnifiedDataTableRenderCellValue` render calls:


https://github.com/user-attachments/assets/04caca0d-35e7-421c-b8e3-5a37a1d65177

After - 424 `UnifiedDataTableRenderCellValue` render calls:


https://github.com/user-attachments/assets/dba1a106-6bd6-4f1b-b60e-4741228c488b

Before profile:
<img width="300" alt="profile_old"
src="https://github.com/user-attachments/assets/44c07f30-55d2-44ab-a9b7-a912fa7beca1">

After profile:
<img width="300" alt="profile_new"
src="https://github.com/user-attachments/assets/d61cfd2a-8ac0-45bb-9afa-d3d97b0d03ce">

Before scrolling:


https://github.com/user-attachments/assets/8d9dbdbd-df3e-48df-af9a-539deda8d5ea

After scrolling:


https://github.com/user-attachments/assets/d6309275-e00d-44ee-a59f-2d1e5d30bb60

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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>
Co-authored-by: Jatin Kathuria <jtn.kathuria@gmail.com>
2024-09-04 00:26:49 -03:00
Rachel Shen
03bb0b2b5d
[Dashboard] Compressed Styles for Controls (#190636)
## Summary

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

This builds off @ryankeairns work in
https://github.com/elastic/kibana/pull/189839 to have the compressed
styles for controls

Applied to new controls in example apps: 

![Screenshot 2024-08-27 at 1 45
45 PM](https://github.com/user-attachments/assets/748204e2-66c3-4638-bce8-3cad34337848)


Applied to existing dashboard controls:

![Screenshot 2024-08-27 at 1 35
25 PM](https://github.com/user-attachments/assets/af1796ef-2fa9-4760-bcc2-18a4d69dcdcb)
2024-09-03 15:47:42 -05:00
Julia Rechkunova
00174635b0
[Discover] Context aware Single Document & Surrounding Documents pages (#190540)
- Closes https://github.com/elastic/kibana/issues/188178

## Summary

This PR makes sure to resolve profiles on:
- [x] Single document page (also added doc viewer extension support)
- [x] Surrounding documents page (also added cell renderes support)

### 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: Davis McPhee <davis.mcphee@elastic.co>
2024-09-02 06:23:54 -05:00
Cee Chen
a88cfc825d
Upgrade EUI to v95.9.0 (#190752)
`v95.7.0`  `v95.9.0`

> [!CAUTION]
> This PR contains the final set of Emotion conversions for all EuiForm
components.
> If your plugin contains any custom CSS/styling to **EuiFormRow,
EuiFormControlLayout, EuiCheckbox, EuiRadio, or EuiSwitch**, ⚠️ make
sure to QA your UI to ensure no visual regressions have occurred! ⚠️

---

## [`v95.9.0`](https://github.com/elastic/eui/releases/v95.9.0)

- Updated `EuiSearchBar`'s optional `box.schema` prop with a new
`recognizedFields` configuration. This allows specifying the phrases
that will be parsed as field clauses
([#7960](https://github.com/elastic/eui/pull/7960))
- Updated `EuiIcon` with a new `tokenSemanticText` glyph
([#7971](https://github.com/elastic/eui/pull/7971))
- Added support for TypeScript 5
([#7980](https://github.com/elastic/eui/pull/7980))

**Bug fixes**

- Fixed `EuiSelectableTemplateSitewide` styles when used within a
dark-themed `EuiHeader`
([#7977](https://github.com/elastic/eui/pull/7977))

## [`v95.8.0`](https://github.com/elastic/eui/releases/v95.8.0)

- Updated `EuiHeaderLinks`'s mobile menu to set a slight popover padding
by default ([#7961](https://github.com/elastic/eui/pull/7961))
- This can be overridden via `popoverProps.panelPaddingSize` if needed.
- Updated `EuiHeaderLink` to default to a size of `s` (down from `m`)
([#7961](https://github.com/elastic/eui/pull/7961))

**Accessibility**

- Updated the `aria-label` attribute for the `EuiFieldSearch` clear
button ([#7970](https://github.com/elastic/eui/pull/7970))

**Bug fixes**

- Fixed a visual bug with `<EuiDualRange showInput="inputWithPopover"
/>` form controls ([#7957](https://github.com/elastic/eui/pull/7957))

**Deprecations**

- Deprecated `EuiFormRow`'s `columnCompressedSwitch` display prop. Use
`columnCompressed` instead, which will automatically account for child
`EuiSwitch`es ([#7968](https://github.com/elastic/eui/pull/7968))
- Deprecated `EuiFormRow`'s `rowCompressed` display prop. Use `row`
instead for vertical forms, or `centerCompressed` for inline forms
([#7968](https://github.com/elastic/eui/pull/7968))
- (Styling) Updated `EuiFormRow`'s `hasEmptySpaceLabel` prop to no
longer attempt to automatically align its content to a vertical center.
Use the `display="center"` prop for that instead
([#7968](https://github.com/elastic/eui/pull/7968))

**CSS-in-JS conversions**

- Converted `EuiFormControlLayout` to Emotion
([#7954](https://github.com/elastic/eui/pull/7954))
- Removed `.euiFormControlLayout--*icons` classNames and
`--eui-form-control-layout-icons-padding` CSS var. Use
`--euiFormControlRightIconsCount` or `--euiFormControlLeftIconsCount`
instead
- Converted `EuiFormLayoutDelimited` to Emotion
([#7957](https://github.com/elastic/eui/pull/7957))
- Fixed `cloneElementWithCss` throwing an error when used multiple times
without a `key` prop ([#7957](https://github.com/elastic/eui/pull/7957))
- Updated `cloneElementWithCss` utility to support a third argument that
allows prepending vs. appending the cloned Emotion css className
([#7957](https://github.com/elastic/eui/pull/7957))
- Removed `@euiFormControlLayoutClearIcon` Sass mixin
([#7959](https://github.com/elastic/eui/pull/7959))
- Converted `EuiDescribedFormGroup` to Emotion
([#7964](https://github.com/elastic/eui/pull/7964))
- Converted `EuiForm`, `EuiFormHelpText`, and `EuiFormErrorText` to
Emotion ([#7966](https://github.com/elastic/eui/pull/7966))
- Converted `EuiFormLabel` and `EuiFormLegend` to Emotion; Removed
`@euiFormLabel` mixin
([#7967](https://github.com/elastic/eui/pull/7967))
- Converted `EuiFormRow` to Emotion
([#7968](https://github.com/elastic/eui/pull/7968))
- Converted `EuiCheckbox` to Emotion
([#7969](https://github.com/elastic/eui/pull/7969))
- Converted `EuiRadio` to Emotion
([#7969](https://github.com/elastic/eui/pull/7969))
- Converted `EuiSwitch` to Emotion
([#7969](https://github.com/elastic/eui/pull/7969))
- Removed the following Sass variables:
([#7969](https://github.com/elastic/eui/pull/7969))
  - `$euiFormCustomControlDisabledIconColor`
  - `$euiFormCustomControlBorderColor`
  - `$euiRadioSize`
  - `$euiCheckBoxSize`
  - `$euiCheckboxBorderRadius`
  - `$euiSwitchHeight` (and compressed/mini variants)
  - `$euiSwitchWidth` (and compressed/mini variants)
  - `$euiSwitchThumbSize` (and compressed/mini variants)
  - `$euiSwitchIconHeight`
  - `$euiSwitchOffColor`
- Removed the following Sass mixins:
([#7969](https://github.com/elastic/eui/pull/7969))
  - `euiIconBackground`
  - `euiCustomControl`
  - `euiCustomControlSelected`
  - `euiCustomControlDisabled`
  - `euiCustomControlFocused`

---------

Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
2024-08-30 17:47:17 -07:00
Dzmitry Lemechko
8436f45fd1
FTR: enable ESLint mocha rules for api integration tests (#191267)
## Summary

Follow-up to #190690

Most of API integration tests does not match the path pattern set in the
original PR (thanks @pheyos for catching it) and where not updated.
This PR updates `.eslintrc.js` with explicit patterns to lint
api_integration tests. Hopefully it is final change, but I rely on code
owners to double check it.

Most of the changes are trivial adjustments:
- duplicated before/after hooks `mocha/no-sibling-hooks`
- duplicated test titles `mocha/no-identical-title`
- async function in describe() `mocha/no-async-describe`

---------

Co-authored-by: Ash <1849116+ashokaditya@users.noreply.github.com>
2024-08-30 18:50:35 +02:00
Nathan Reese
c272d9715e
Integrate react control group embeddable into dashboard container (#190273)
closes https://github.com/elastic/kibana/issues/191137,
https://github.com/elastic/kibana/issues/190988,
https://github.com/elastic/kibana/issues/191155

PR replaces legacy embeddable control group implementation with react
control group implementation in DashboardContainer.

### Test instructions
1. Open dashboard via dashboard application or portable dashboard
2. Mess around with controls. There should be no changes in behavior

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
2024-08-30 09:10:59 -06:00
Zacqary Adam Xeper
ee28e20de8
[Embeddables Rebuild] Migrate Visualize (#183197)
## Summary

Closes #174958

This migrates the Visualize embeddable to the new React Embeddable
framework.

Migrated:
- Edit visualization action
- Convert to lens action
- Extracting/injecting references on serialize and deserialize
- Inspector adapters
- Dashboard settings
- Drilldown support
- Timeslice/time slider support
- Custom time ranges

Also adds deprecation statements to legacy Embeddable factories

**In a second PR, we'll move the `embeddable` folder to
`legacy/embeddable` and rename `react_embeddable` to `embeddable`. I
don't know if git will be able to diff that change in a comprehensible
way in this PR, so I want to save it for the next one.**

### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Devon Thomson <devon.thomson@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
2024-08-30 09:05:17 -06:00
Jon
9f70009d89
Revert "[FTR] Refactor test/common/services/* -> packages/kbn-ftr-com… (#191765)
Build failure


https://buildkite.com/elastic/kibana-pull-request/builds/230868#01919ed7-15d5-425c-9b8e-146ed5fe9daf
2024-08-29 16:05:53 -05:00
Lukas Olson
c71c0df37f
[ES|QL] Only log requests to Inspector on request complete (#191232)
## Summary

Requires https://github.com/elastic/kibana/pull/191520.
Resolves https://github.com/elastic/kibana/issues/188266.

Prior to this PR, when polling on an async ES|QL request, we would log
the response to every polling request. This PR only logs when the
request is complete.

Before:


![image](https://github.com/user-attachments/assets/fe9a763d-ef43-4f46-a096-0e08e1805f47)

After:


![image](https://github.com/user-attachments/assets/5d59f016-8b0e-4a3f-b044-17b5de97739f)


### 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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
([build](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6823))
2024-08-29 08:01:54 -07:00
Tre
09a365850e
[FTR] Refactor test/common/services/* -> packages/kbn-ftr-common-functional-[ui-]services/* (#189051)
## Summary

Moving common services to respective new homes.

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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-08-29 14:46:35 +01:00
Tiago Costa
4db8b3219c
skip flaky suite (#190321) 2024-08-29 04:29:59 +01:00
Alejandro Fernández Haro
454be59c14
Flaky #187671 (#191542) 2024-08-28 17:23:42 -07:00
Patryk Kopyciński
2d1d592a3b
[react@18] Fix useCallback breaking type changes (#182344)
## Summary

Prep work for React@18 bump
https://github.com/elastic/kibana/issues/138222

In React@18 `useCallback` types has changed that introduced breaking
changes:
https://github.com/DefinitelyTyped/DefinitelyTyped/issues/46691

Fixed using:

https://github.com/eps1lon/types-react-codemod?tab=readme-ov-file#usecallback-implicit-any

**Tried to do my best with fixing the types, but if you disagree or have
a better idea how it should be solved feel free to suggest changes or
commit directly to the branch 🙏**

---------

Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>
Co-authored-by: Sébastien Loix <sabee77@gmail.com>
Co-authored-by: Nick Peihl <nick.peihl@elastic.co>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Felix Stürmer <felix.stuermer@elastic.co>
Co-authored-by: nickofthyme <nicholas.partridge@elastic.co>
Co-authored-by: Davis McPhee <davis.mcphee@elastic.co>
Co-authored-by: Vitalii Dmyterko <92328789+vitaliidm@users.noreply.github.com>
Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
2024-08-28 16:33:35 +02:00
Marta Bondyra
b5570ecdc4
[Lens] fix flaky test with deleting filters (#191316)
## Summary

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

(also fixes https://github.com/elastic/kibana/issues/189569
https://github.com/elastic/kibana/issues/178270
https://github.com/elastic/kibana/issues/139040 which are already closed
as one time occurances but could happen again)

https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6809
2024-08-27 12:31:32 +02:00
Tim Sullivan
dc7e3ec999
[EuiProvider / Functional tests] Check for EuiProvider Dev Warning (#189018)
## Summary

Follows https://github.com/elastic/kibana/pull/184608
Closes https://github.com/elastic/kibana-team/issues/805


![image](https://github.com/user-attachments/assets/eaee5b81-c1e9-4e81-9018-db57652236dc)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-08-26 15:08:32 -05:00
Larry Gregory
2ca2f2a4d7
Seal native prototypes on the server (#190716)
## Summary

This PR
[seals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal)
`Object.prototype`, `String.prototype`, `Number.prototype`, and
`Function.prototype` on the Kibana server, which provides some measure
of protection against prototype pollution.

<details>
<summary>The Object.seal() static method seals an object.</summary>
**note** I currently have this marked as `backport:skip` to reduce the
risk of regressions in patch releases.

> The Object.seal() static method seals an object. Sealing an object
[prevents
extensions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions)
and makes existing properties non-configurable. A sealed object has a
fixed set of properties: new properties cannot be added, existing
properties cannot be removed, their enumerability and configurability
cannot be changed, and its prototype cannot be re-assigned. Values of
existing properties can still be changed as long as they are writable.
seal() returns the same object that was passed in.
</details>

-----

## Help, this broke something!

Please let us know by opening an issue. If you need to get your
environment up and running quickly, you can disable these protections by
setting the `KBN_UNSAFE_DISABLE_PROTOTYPE_HARDENING` environment
variable to any truthy value.

This may be interfering with normal functionality if you encounter an
error similar to:
> Cannot add property foo, object is not extensible

Where `foo` is some arbitrary string.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-08-26 08:33:03 -05:00
Sébastien Loix
3db781d1f2
[Stateful sidenav] Functional tests helpers (#189804) 2024-08-26 04:47:30 -05:00
Dzmitry Lemechko
fa69337c94
[FTR] enable recommended mocha + no-floating-promises ESLint rules (#190690)
## Summary

This PR enforces ESLint rules in FTR tests, in particular:
- `no-floating-promises` rule to catch unawaited Promises in
tests/services/page objects

_Why is it important?_
- Keep correct test execution order: cleanup code may run before the
async operation is completed, leading to unexpected behavior in
subsequent tests
- Accurate test results: If a test completes before an async operation
(e.g., API request) has finished, Mocha might report the test as passed
or failed based on incomplete context.
```
198:11  error  Promises must be awaited, end with a call to .catch, end with a call to .then
with a rejection handler or be explicitly marked as ignored with the `void` operator 
@typescript-eslint/no-floating-promises
```
<img width="716" alt="Screenshot 2024-08-20 at 14 04 43"
src="https://github.com/user-attachments/assets/9afffe4c-4b51-4790-964c-c44a76baed1e">

- recommended rules from
[eslint-mocha-plugin](https://www.npmjs.com/package/eslint-plugin-mocha)
including:
-
[no-async-describe](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-async-describe.md)
-
[no-identical-title.md](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-identical-title.md)
-
[no-sibling-hooks.md](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/docs/rules/no-sibling-hooks.md)
and others

Note for reviewers: some tests were skipped due to failures after
missing `await` was added. Most likely is a "false positive" case when
test is finished before async operation is actually completed. Please
work on fixing and re-enabling it

---------

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-08-23 11:54:36 -05:00
Nick Partridge
94b657e6c9
Add 5s minRefreshInterval to timefilter with validation (#188881)
Adds enforcement for the global time filter to limit the min refresh interval.
2024-08-23 11:21:52 -05:00
Panos Koutsovasilis
bd9dde8ba7
fix: remove deprecated squid filebeat module tutorial from integrations (#191115)
## Summary

This PR removes the deprecated `squid` integration based on the Filebeat
module (deprecation issue
[here](https://github.com/elastic/beats/issues/37746)). Instead, as of
now, a user that wants to use the `squad` integration needs to tick the
`Display beta integrations` and install the "new" squid integration


### Risk Matrix

N/A


### 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)
2024-08-23 16:47:49 +03:00
Nathan Reese
79051d46f7
[controls] Refactor control group settings functional tests (#190999)
Refactor control group settings tests
1. move non-functional test cases to unit tests
2. use pre-built dashboard to avoid time of building dashboard in test

### Before
Tests take 4 minutes to run locally
<img width="400" alt="Screenshot 2024-08-21 at 3 12 31 PM"
src="https://github.com/user-attachments/assets/96cf584c-2b32-4281-86ee-9791544bd5fa">


### After
Tests take 1 minute to run locally
<img width="400" alt="Screenshot 2024-08-21 at 2 53 37 PM"
src="https://github.com/user-attachments/assets/853a6f3a-74c5-4ca8-a488-99dd24477b1e">

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-08-22 14:13:51 -06:00
Anton Dosov
64e1116b4b
Dashboard insights flyout with dashboard views (#187993)
## Summary

close https://github.com/elastic/kibana/issues/183687

## Feature

- Implement dashboard view stats UI on top of usage counter that counts
dashboard views for last 90 day and shows weekly histogram.
- (Even if there is not a lot of data, we still show it as a weekly
histogram, so it can be pretty empty intially)

![Screenshot 2024-08-15 at 13 00
11](https://github.com/user-attachments/assets/adeabf78-e3d3-4cfa-adc3-76a32ede595b)


## Implementation

### Server side
Dashboard plugin registers new routes to increase the view count and get
stats. Routes are protected for users with dashboard access only. The
implementation is located in
`@kbn/content-management-content-insights-server` and internally uses
usage counters. The retention is 90 days, so we can only show stats for
last 90 days.

 ### Client side

- Dashboard uses the client from
`@kbn/content-management-content-insights-public` to increase the view
count every time a user opens a dashboard.
- TableListView opens the flyout from
`@kbn/content-management-content-insights-public`to display the stats

## How to test

- For new views just open a dashboard and check that view stat is
increased
- For old views you can populate the usage counters with historic data.
I used the following script:
https://gist.github.com/Dosant/425042fcf75d5e40e5a46374f6234a54
2024-08-21 13:08:49 -05:00
Davis McPhee
349fdac456
[Discover] [Unified Data Table] Improve absolute column width handling (#190288)
## Summary

This PR improves the handling of columns with absolute widths in
Discover, including the following enhancements:
- If there are no auto width columns in the profile default app state,
set the last column to auto width so the default columns always fill the
grid.
- If there are no auto width columns remaining when removing a column
from the grid, set the last column to auto width so the remaining
columns fill the grid.
- Add a "Reset width" button to the column header popovers to allow
resetting absolute width columns back to auto width.


https://github.com/user-attachments/assets/0c588969-5720-40e3-91e2-07a83a93b797

Resolves #189817.
Related #188550.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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>
Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
2024-08-20 17:27:13 -03:00
Yulia Čech
f3a6527437
[Console] Fix the end range of selected requests (#189747)
## Summary

Fixes https://github.com/elastic/kibana/issues/189366
Fixes https://github.com/elastic/kibana/issues/186773

This PR refactors how the request body is being extracted from the
editor to use for "sendRequest" and "copyAsCurl" functions. Previously
the editor actions provider would rely on the parser to get a JSON
object or several for request body. The downside of this implementation
was when the parser would not be able to fully process the json object.
That could lead to potential text loss and the editor would process the
requests in a way that was not always obvious to the user. For example,
the editor would highlight the request with the json object, but when
sending it to ES the request body would be completely ignored.
Instead this PR suggests to use the "raw" text from the editor for
actions and give the user more transparency and control over the
requests. We also don't need to keep the information about requests in
the parser, which might affect browser performance for longer texts.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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)
2024-08-20 14:16:00 +02:00
Lukas Olson
22dc10c7d0
[UnifiedDataTable] Add density configuration (#188495)
## Summary

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

Adds a density configuration for the `UnifiedDataTable`. By default,
this configuration will not be shown unless an
`onUpdateDataGridDensity`handler is passed to the `UnifiedDataTable`. It
defaults to `compact`. It persists to `localStorage` when updated.


https://github.com/user-attachments/assets/8523301c-7cf5-4854-bbbc-b6767d996c32

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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>
Co-authored-by: Bhavya RM <bhavya@elastic.co>
2024-08-19 15:54:13 -07:00
Julia Rechkunova
cf58ef9e51
[OneDiscover][UnifiedDocViewer] Add dedicated column for Pinning/Unpinning rows (#190344)
- Closes https://github.com/elastic/kibana/issues/188413

## Summary

This PR adds a dedicated column for pinning/unpinning fields inside
DocViewer.

![Aug-13-2024
15-06-25](https://github.com/user-attachments/assets/93496cdd-e730-4ee6-8597-c78d7bffe07f)



### 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] 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)
2024-08-19 09:06:54 -05:00