Commit graph

6599 commits

Author SHA1 Message Date
Marta Bondyra
f8e873f87d
[TSVB] Visualization blows up when invalid color is passed (#190658)
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6784

## Summary

Fixes https://github.com/elastic/kibana/issues/190657
Fixes https://github.com/elastic/kibana/issues/182136

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-08-19 14:27:06 +02:00
Marta Bondyra
f27a477719
[Visualize] unskip visualize flaky tests (#190249)
## Summary

Fixes https://github.com/elastic/kibana/issues/181884
Fixes https://github.com/elastic/kibana/issues/181883
Fixes https://github.com/elastic/kibana/issues/181895
Fixes https://github.com/elastic/kibana/issues/181881
2024-08-15 21:19:49 +02:00
Ignacio Rivas
f904104f23
[Console] Allow users to copy requests as specific languages (#189976) 2024-08-15 09:44:47 -05:00
Julia Rechkunova
8cf87c01d6
[Discover] Unskip default app state tests (#190506)
- Closes https://github.com/elastic/kibana/issues/189994
2024-08-15 08:50:47 +02:00
Catherine Liu
6738bdc12e
[Dashboard] Use panel actions service for testing panels (#190102)
## Summary

Pre-req for #182535.

This refactors functional tests that interact with panel actions to use
the `DashboardPanelActions` service instead of directly clicking the
actions via test subjects. This will reduce the maintenance required to
fix failing tests when we change the UX for the panel actions context
menu.

### 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-14 21:47:57 -07:00
Paulo Henrique
a28f2193bc
[Agentless API] Updating Agentless API URL and enablement flag (#190277)
## Summary

It closes https://github.com/elastic/security-team/issues/10104

This PR addresses the necessary changes in Kibana to reflect the updated
agentless API settings in kibana.yml settings:

- **xpack.fleet.agentless.enabled: true**
Changing to use `xpack.fleet.agentless.enabled` as a Feature flag for
enabling agentless in ESS environments. (Serverless changes was out of
scope, so it is still using `xpack.fleet.enableExperimental` for now).
Also, this value will now be exposed to the client side instead of the
API URL (It closes
https://github.com/elastic/security-team/issues/10019).


- **xpack.fleet.agentless.api.url**
This setting will now include only the URL (without the basePath), so I
added a `prependAgentlessApiBasePathToEndpoint` helper function to
append the basePath with type support. Also this value will no longer be
exposed to the client side

### Additional changes

- This PR also modified the Agentless settings schema validation to be
optional (so it will only validate the types), as because of the nature
of how the `kibana.yml` will set the configuration as of
[this](https://github.com/elastic/cloud/pull/130314) PR, it might happen
that we will have partial settings, so changing the schema to optional
will prevent Kibana failing from starting due to incomplete agentless
settings. (It closes
https://github.com/elastic/security-team/issues/10189)

- Updated unit tests and FTR e2e config files to reflect the latest
changes
2024-08-13 19:48:46 -05:00
Nick Partridge
2f9dca4b02
fix: kbn-config-schema tests for conditional config schemas (#190259) 2024-08-13 13:54:56 -05:00
Robert Oskamp
bd5927fab4
Stabilize Discover sidebar tests (#190405)
## Summary

This PR tries to stabilize the Discover sidebar tests which started to
be flaky when running against MKI.

### Details

The serverless Discover sidebar tests (`Common Group
5.x-pack/test_serverless/functional/test_suites/common/discover/group6/_sidebar·ts`)
started to become flaky when running against MKI. 5 out of the last 10
runs failed for the same reason:
```
discover/group6 discover sidebar renders field groups should render even when retrieving documents failed with an error

Error: expected '48 available fields. 6 empty fields. 4 meta fields.' to equal '49 available fields. 5 empty fields. 4 meta fields.'
    at Assertion.assert (expect.js💯11)
    at Assertion.apply (expect.js:227:8)
    at Assertion.be (expect.js:69:22)
    at Context. (_sidebar.ts:644:83)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.apply (wrap_function.js:73:16)
```

So it seems the newly added field is sometimes listed as `empty` instead
of `available`.

Failure screenshot:

![image](https://github.com/user-attachments/assets/e3615604-90ad-445c-9026-fd7c7865991e)

The screenshot shows an active global loading indicator, so that might
be the reason for the flakiness (loading not quite done sometimes, so
field listed as `empty`).

This PR tries to fix this flakiness by adding a wait for the global
loading right before fetching the sidebar details.
2024-08-13 16:16:07 +02:00
Julia Rechkunova
7e140286f6
[Discover][UnifiedDataTable] Copy selected rows as text (#189512)
- Closes https://github.com/elastic/kibana/issues/179731
- Related to https://github.com/elastic/kibana/issues/177952 
- Related to https://github.com/elastic/eui/issues/6804

## Summary

This PR adds "Copy selection as text" action.

<img width="926" alt="Screenshot 2024-07-31 at 18 09 21"
src="https://github.com/user-attachments/assets/a4fc7456-7cd9-4493-a4dd-45151f845566">


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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
2024-08-12 15:21:26 +02:00
Stratoula Kalafateli
eaf4bb0422
Rename variables 2 (#190264)
## Summary

Renames the variables from ?`start` to `?t_start` and `?end` to `?t_end`

Naming is hard so bare with us 😅 (I think this will be the last change)
2024-08-12 07:42:07 +02:00
Julia Rechkunova
a8aa215db5
[OneDiscover][UnifiedDocViewer] Allow filtering by field type (#189981)
- Closes https://github.com/elastic/kibana/issues/188733

## Summary

This PR adds Field type filter to Doc Viewer (same as in
UnifiedFieldList as discussed with @MichaelMarcialis).

The selected field types would be persisted in Local Storage under
`unifiedDocViewer:selectedFieldTypes` key.

<img width="685" alt="Screenshot 2024-08-07 at 16 52 46"
src="https://github.com/user-attachments/assets/7591aa69-c1b4-4485-ad9f-baac809d7fe5">



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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-08-09 17:08:19 +02:00
Stratoula Kalafateli
520c55051f
Revert "[ES|QL] Rename the params in ?t_start ?t_end (#190115)" (#190222)
This reverts commit 04c46db429.
2024-08-09 13:52:22 +02:00
Stratoula Kalafateli
04c46db429
[ES|QL] Rename the params in ?t_start ?t_end (#190115)
## Summary

Renames the variables from `?start` to `?t_start` and `?end` to `?t_end`

Naming is hard so bare with us 😅 (I think this will be the last change)
2024-08-09 11:43:35 +02:00
Alejandro Fernández Haro
de6e45241f
Flaky #175531 - sort keys (#190157) 2024-08-08 15:35:35 -05:00
Julia Rechkunova
6a8b9505b8
[Discover] Unskip time zone test (#190116)
- Closes https://github.com/elastic/kibana/issues/189943
- Closes https://github.com/elastic/kibana/issues/190058
2024-08-08 16:16:49 -03:00
Marta Bondyra
ef8caa8abf
[Annotations listing page] unskip flaky test (#190053)
Fixes https://github.com/elastic/kibana/issues/168281
Fixes https://github.com/elastic/kibana/issues/190030

https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6706
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6718
2024-08-08 15:23:39 +02:00
Drew Tate
edf5c762d8
[ES|QL] Stronger typing for ESQL field interface (#189941)
## Summary

The heart of this PR is [this
change](https://github.com/elastic/kibana/pull/189941/files#diff-88513481c44d7b2de70ca2f7826c2b1fb1d8bda5b308aab0f8917a42ac2c24b7R11-R94)
where I clean up and clarify the various data-type-related types
floating around in the engines + [this
change](https://github.com/elastic/kibana/pull/189941/files#diff-f48b526b82119bd591cf781262173d7a0233d236ab26496a4c06f5ea9a441561R21)
where I add strong typing to the ES|QL field interface.

Pretty much everything else is a result of that. For example, strongly
typing the fields and test helpers highlighted a bunch of tests that
were still using Kibana types instead of Elasticsearch types. So, then
those had to be updated.

There's more work to do to extend the strong field typing to the rest of
the engines, but this got big and I decided to do it piece-meal.

Next plans
- Extend typing to subroutines in autocomplete and validation engines
(e.g. the stuff in `factories.ts`)
- Add typing to the [variable
interface](https://github.com/elastic/kibana/pull/189941/files#diff-f48b526b82119bd591cf781262173d7a0233d236ab26496a4c06f5ea9a441561R13)
- Consider merging `time_literal` and `time_duration` types
- "It looks like timespan literals are the way to write a constant
time_duration. and time_durations can only be constants at the moment.
so they aren't the same, but sure are about the same" - Nik
- Consider merging
`packages/kbn-esql-validation-autocomplete/src/shared/esql_types.ts`
with
`packages/kbn-esql-validation-autocomplete/src/definitions/types.ts` in
some common place


### 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
2024-08-08 08:11:43 -05:00
Eyo O. Eyo
66458ac491
Welcome interstitial not displayed (#190045)
## Summary

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

The tests fails because for some reason the welcome interstitial
animation doesn't complete before the timeout set for the target element
to be visible, it's interesting that despite waiting for the set
duration of the animation for the property, with a timeout that
quadruples the animation duration this tests fails still.

It's worth pointing out that in all referenced instances of failure in
the issue, on the second attempt the test actually passes, hence this PR
only introduces a retry to the assertion that the target element is
displayed. Furthermore this PR was ran through the flaky test runner
[see
here](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6699)
with success.

<!--

### 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: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-08-08 10:09:46 +02:00
Dzmitry Lemechko
7df01e99c1
[FTR] support "deployment agnostic" api-integration tests (#189853)
## Summary

### This PR introduces a new type of API integration tests in FTR:
deployment-agnostic

![8zcgq0
(1)](https://github.com/user-attachments/assets/17c6d4ee-7848-4a4c-a006-7ae54e523243)

#### Test suite is considered deployment-agnostic when it fulfils the
following criteria:

**Functionality**: It tests Kibana APIs that are **logically identical
in both stateful and serverless environments** for the same SAML roles.

**Design**: The test design is **clean and does not require additional
logic** to execute in either stateful or serverless environments.

### How It Works
Most existing stateful tests use basic authentication for API testing.
In contrast, serverless tests use SAML authentication with
project-specific role mapping.

Since stateful deployments also support SAML, deployment-agnostic tests
**configure Elasticsearch and Kibana with SAML authentication in both
cases**. For roles, stateful deployments define 'viewer', 'editor', and
'admin' roles with serverless-alike privileges.

New `samlAuth` service has `AuthProvider` interface with 2 different
implementations: depending on environment context (serverless or
stateful) appropriate implementation is used. But it remains on service
level and hidden in test suite.

test example
```
export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
  const samlAuth = getService('samlAuth');
  const supertestWithoutAuth = getService('supertestWithoutAuth');
  let roleAuthc: RoleCredentials;
  let internalHeaders: InternalRequestHeader;

  describe('GET /api/console/api_server', () => {
    before(async () => {
      roleAuthc = await samlAuth.createM2mApiKeyWithRoleScope('admin');
      internalHeaders = samlAuth.getInternalRequestHeader();
    });
    after(async () => {
      await samlAuth.invalidateM2mApiKeyWithRoleScope(roleAuthc);
    });
    it('returns autocomplete definitions', async () => {
      const { body } = await supertestWithoutAuth
        .get('/api/console/api_server')
        .set(roleAuthc.apiKeyHeader)
        .set(internalHeaders)
        .set('kbn-xsrf', 'true')
        .expect(200);
      expect(body.es).to.be.ok();
      const {
        es: { name, globals, endpoints },
      } = body;
      expect(name).to.be.ok();
      expect(Object.keys(globals).length).to.be.above(0);
      expect(Object.keys(endpoints).length).to.be.above(0);
    });
  });
}
```

Please read
[readme](966822ac87/x-pack/test/api_integration/deployment_agnostic/README.md)
for more details and step-by-step guide. It should help migrating
existing serverless tests to deployment-agnostic, assuming requirements
are met.

### Examples

Deployment-agnostic tests:

```
x-pack/test/api_integration/deployment_agnostic/apis/console/spec_definitions.ts

x-pack/test/api_integration/deployment_agnostic/apis/core/compression.ts

x-pack/test/api_integration/deployment_agnostic/apis/painless_lab/painless_lab.ts
```

Configs to run it:

```
node scripts/functional_tests --config x-pack/test/api_integration/deployment_agnostic/oblt.serverless.config.ts
node scripts/functional_tests --config x-pack/test/api_integration/deployment_agnostic/search.serverless.config.ts
node scripts/functional_tests --config x-pack/test/api_integration/deployment_agnostic/security.serverless.config.ts

node scripts/functional_tests --config x-pack/test/api_integration/deployment_agnostic/stateful.config.ts
```





PR is a compact version of #188737 with reduced changes in existing
serverless tests.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: elena-shostak <165678770+elena-shostak@users.noreply.github.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
2024-08-07 10:34:52 -05:00
Julia Rechkunova
a74e5a0b4e
[Discover][SavedSearch] Fix default rowsPerPage for Dashboard panels (#189717)
- Follow up for https://github.com/elastic/kibana/pull/180536

## Summary

This PR fixes an issue with `rowsPerPage` Advanced Setting: after the
refactoring it was ignored.

To test: 
Change `rowsPerPage` on Advanced Setting page, navigate to Dashboard and
add a saved search panel. It should use the configured value by default.
The default value can be overwritten by custom panel settings or saved
search own settings.


### 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
2024-08-07 16:20:20 +02:00
Julia Rechkunova
1c4b5c7489
[OneDiscover][Extension] DataTable Row Actions (#188762)
- Closes https://github.com/elastic/kibana/issues/186637
- Closes https://github.com/elastic/kibana/issues/186808

## Summary

- [x] Extend UnifiedDataTable with a new `rowAdditionalLeadingControls`
prop to render additional leading controls
- [x] In case of many actions, collapse the rest of them under "More"
button
- [x] New OneDiscover extension
- [x] Convert from `customControlColumnsConfiguration` to the new prop.
Refactor actions format in Log Explorer.
- [x] Swap the default "select" and "expand" control columns ~if custom
row actions are specified~
- [x] Add to example OneDiscover profile
- [x] Add functional and units tests

<img width="858" alt="Screenshot 2024-07-26 at 16 00 17"
src="https://github.com/user-attachments/assets/68832abc-a498-4ec6-8333-79ad5f83855b">
<img width="1139" alt="Screenshot 2024-07-26 at 16 00 47"
src="https://github.com/user-attachments/assets/8ff99ac1-21b0-4687-b548-fbf3c5517808">

### Testing 

For testing the example profile:
- add `discover.experimental.enabledProfiles: ['example-root-profile',
'example-data-source-profile', 'example-document-profile']` to
kibana.dev.yml
- start kibana
- make sure to have an index with `my-example-logs` name or create an
alias to an existing index:
```
POST _aliases
{
  "actions": [
    {
      "add": {
        "index": "kibana_sample_data_logs",
        "alias": "my-example-logs"
      }
    }
  ]
}
```
- create a data view for `my-example-logs` index


### Follow up for Security solution

The following items would require deprecation/refactoring in components
on Security Solution pages to have consistent UX (can result in 500+
lines of code changes):
- Convert from `externalControlColumns` to the new prop
`rowAdditionalLeadingControls`
- Convert from `trailingControlColumns` to a normal column.
`trailingControlColumns` is deprecated.
  - https://github.com/elastic/kibana/issues/189294
- Use `getRowIndicator` prop on UnifiedDataTable instead of
`border-left` style
  - https://github.com/elastic/kibana/issues/189295


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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-08-07 08:51:52 -05:00
Matthew Kime
ff3456602a
[data views] Field editor accepts DataViewLazy (#187717)
## Summary

Data View field editor will now accept a DataView or DataViewLazy to
help in moving kibana apps over to DataViewLazy and loading fields on an
as-needed basis.

Internally, the field editor's namesNotAllowed list has been removed as
loading it can be expensive. The painless field editor still needs the
full field list for autocomplete suggestions but the list is only loaded
for that specific component.

DataViewLazy provides a method to get a sorted field list - as a result,
number of tests have been updated to accommodate a properly ordered
list.

Part of https://github.com/elastic/kibana/issues/178926
2024-08-06 16:52:47 -05:00
Angela Chuang
644e8187f7
[SecuritySolution] Remove duplicated serverless tests (#188855)
## Summary

1. Apply https://github.com/elastic/kibana/pull/185870 for Security
Solution Explore and Investigation tests.
2. Remove duplicated tests.
3. Investigation/timeline/serverless tests are skipped atm.

How to run the api integration tests (Use Investigation Timeline ESS as
an example)
```
cd x-pack

node scripts/functional_tests_server.js --config ./test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/configs/ess.config.ts

// After server is started, open another terminal

cd x-pack

node ../scripts/functional_test_runner --config=test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/configs/ess.config.ts
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-08-06 12:59:50 +01:00
Stratoula Kalafateli
f2d7a28134
[ES|QL] Increase discoverability (#188898)
## Summary

Closes https://github.com/elastic/kibana/issues/184691
Closes https://github.com/elastic/kibana/issues/189029
Closes https://github.com/elastic/kibana/issues/166085

This PR is mostly a redesign of the unified search with the dataview
picker and the ES|QL editor

### Unified search
- We removed the ES|QL switch from the dataview picker
- A lot of cleanup

<img width="2502" alt="image"
src="https://github.com/user-attachments/assets/2afca7ce-c7d5-4300-93c9-2c2b77434fd8">

### ES|QL Editor
- The biggest change is the elimination of the compact mode

<img width="1256" alt="image"
src="https://github.com/user-attachments/assets/a0b96796-e086-4397-b8c9-c270e445a034">

### Discover
- Moved the transition modal to Discover
- Added a new menu item (Try ES|QL, Switch to classic)
- A small redesign of the transition modal

<img width="858" alt="image"
src="https://github.com/user-attachments/assets/7fdba235-e0ed-46c2-9e29-e3ae586c019c">


### Checklist
- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [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))
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-08-05 17:40:06 +02:00
Julia Rechkunova
e1e0eb4a9b
[Discover] Deactivate client-side pagination for ES|QL results (#189715)
- Closes https://github.com/elastic/kibana/issues/189489

## Summary

This PR deactivates client-side pagination for ES|QL results so they
will not be split into pages but shown all at once in the grid. Affected
pages: Discover, Dashboard.

### 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
2024-08-05 03:41:20 -05:00
Julia Rechkunova
faf86d2242
[Discover] Add functional tests for defaultRoute setting (#189801)
- Follow up for https://github.com/elastic/kibana/issues/189184

## Summary

Adding more tests.
2024-08-03 16:27:46 -03:00
Davis McPhee
ea71c10037
[Discover] Add default app state extension and log integration data source profiles (#186347)
## Summary

This PR adds a new `getDefaultAppState` extension that allows profiles
to set default values for select app state properties, currently
`columns` and `rowHeight`. It also adds logs data source sub profiles
for the following integrations that consume the `getDefaultAppState`
extension (only `columns` are used currently):
- System logs  
- Kubernetes container logs 
- Windows logs
- AWS S3 Logs
- Nginx error logs 
- Nginx access logs
- Apache error logs 

The index patterns and default state for the integrations are hardcoded
for the initial implementation, but we should change this later to use
an API and state provided by the integrations if we continue this
approach.

For testing, you can ingest sample data for the integrations using
https://github.com/elastic/kibana-demo-data, but you'll need to reindex
the data into correctly named data streams for each:
```
log-system_error -> logs-system.system-test
log-k8s_container -> logs-kubernetes.container_logs-test
log-aws_s3 -> logs-aws.s3access-test
log-nginx_error -> logs-nginx.error-test
log-nqinx -> logs-nginx.access-test
log-apache_error -> logs-apache.error-test

POST /_reindex
{
  "source": {
    "index": "log-k8s_container"
  },
  "dest": {
    "index": "logs-kubernetes.container_logs-test",
    "op_type": "create"
  }
}
```


![default_state](https://github.com/user-attachments/assets/ed73f527-bb5a-470e-b132-f626f0562e18)

Resolves #186271.

### 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: Julia Rechkunova <julia.rechkunova@elastic.co>
2024-08-02 12:18:43 -03:00
Sébastien Loix
03607ec7e0
[Stateful sidenav] Remove Launch Darkly feature flag (#189513) 2024-08-02 07:48:19 -05:00
Stratoula Kalafateli
84c347233a
[ES|QL][Discover] Hide null values from the document viewer (#189601)
## Summary

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

Added a switch to the docViewer that hides the fields with null values.
It is visible both in ESQL and dataview mode. The selection is stored in
the localStorage


![meow](https://github.com/user-attachments/assets/3a072081-e41c-482c-8c0f-2028f39a34cd)


### 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
2024-08-02 07:52:07 +02:00
Cee Chen
44ebd17353
Upgrade EUI to v95.5.0 (#189436)
`v95.4.0`  `v95.5.0`

_[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.5.0`](https://github.com/elastic/eui/releases/v95.5.0)

- Added `minusInSquare` and `plusInSquare` glyphs to `EuiIcon`.
([#7875](https://github.com/elastic/eui/pull/7875))

**Bug fixes**

- Fixed `EuiSuperDatePicker` not correctly passing `refreshMinInterval`
from the quick select popover
([#7905](https://github.com/elastic/eui/pull/7905))

**CSS-in-JS conversions**

- Converted `EuiSuperDatePicker`'s form control to Emotion;
([#7904](https://github.com/elastic/eui/pull/7904))
  - Removed `$euiSuperDatePickerWidth`
  - Removed `$euiSuperDatePickerButtonWidth`
  - Removed `$euiSuperDatePickerNeedsUpdatingBackgroundColor`
  - Removed `$euiSuperDatePickerNeedsUpdatingTextColor`
  - Removed `@euiSuperDatePickerText` mixin
- Converted `EuiSuperDatePicker`'s date popover content to Emotion
([#7908](https://github.com/elastic/eui/pull/7908))
- Converted `EuiSuperDatePicker`'s quick select to Emotion
([#7909](https://github.com/elastic/eui/pull/7909))

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-08-01 15:28:41 -05:00
Yulia Čech
8481715534
[Console] Fix autocomplete suggestions after a comma (#189656)
## Summary

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

This PR fixes a bug, where endpoint autocomplete suggestions were shown
after a comma in the url. Only index names should be displayed in that
case, since otherwise the url would be invalid.

### Screenshots 
#### Before 
<img width="696" alt="Screenshot 2024-07-31 at 18 14 31"
src="https://github.com/user-attachments/assets/1b01fb4e-2451-4e45-baab-4951370060f8">


#### After

<img width="719" alt="Screenshot 2024-07-31 at 18 14 57"
src="https://github.com/user-attachments/assets/6e919269-6d2e-4670-a3f5-1ff8f0077913">



### 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-01 15:15:52 -05:00
Yulia Čech
5c9853dc57
[Console Monaco migration] Fix flaky documentation tests (#186641)
## Summary

Related to https://github.com/elastic/kibana/pull/188977

This PR fixes a flaky test by closing any additionally opened tabs after
each test.


### 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-01 20:55:18 +02:00
Quynh Nguyen (Quinn)
7dca2aa712
[ES|QL] Improved support for Elasticsearch sub-types in AST for both validation and autocomplete (#189689)
## Summary

Fixed version of https://github.com/elastic/kibana/pull/188600 that
updates the failed tests [caused by clash with the visitor API
tests](https://github.com/elastic/kibana/pull/189516).

### 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>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-08-01 11:04:21 -05:00
Ignacio Rivas
cca1a3c968
[Console] Only allow to send requests that have a valid method (#189515) 2024-08-01 07:48:56 -05:00
Matthew Kime
afa4313289
[data views] Allow selection of timestamp when some index pattern segments are unmet (#189336)
Currently, if you attempt to create a data view with a index pattern
where some of the segments aren't matched, you can't select a timestamp
field. This is a common use case for security and observability. This PR
allows a timestamp selection as expected.

Closes https://github.com/elastic/kibana/issues/189024
2024-08-01 05:04:41 -05:00
Jonathan Budzenski
8a60cd4e68 Revert "[ES|QL] Add improved support for Elasticsearch sub-types in AST for both validation and autocomplete (#188600)"
This reverts commit d9282a6e6e.
2024-07-31 18:37:05 -05:00
Quynh Nguyen (Quinn)
d9282a6e6e
[ES|QL] Add improved support for Elasticsearch sub-types in AST for both validation and autocomplete (#188600)
## Summary

This PR addresses https://github.com/elastic/kibana/issues/174710 and
leverages sub-types in AST for both validation and autocomplete. Changes
include:
- Expanded the automatically generated function signatures to not longer
cast to `string` or `number`. Instead, it expands out to `keyword`,
`text`, `double`, `long`, `float`, etc.
- Expanded math function signatures to reflect the true return types
(e.g double + interger => double)
- Expanded function signatures for `bucket`
- Expanded builtin functions to better support types
-  Literal support: 
- Added a `decimal` literal context → Which will be accepted by function
signatures for 'double', 'long', 'float', etc.
- Added and `integer` literal type → Which will be accepted by function
signatures for 'interger'
- Updated tests

After:
<img width="1181" alt="Screenshot 2024-07-24 at 13 06 23"
src="https://github.com/user-attachments/assets/42f32f3b-2e6e-4dff-8b20-dd60f8c45750">
<img width="1726" alt="Screenshot 2024-07-24 at 13 06 47"
src="https://github.com/user-attachments/assets/3c6f1eac-600e-4b2c-9e57-f71f79ad9ce9">
<img width="1726" alt="Screenshot 2024-07-24 at 13 07 09"
src="https://github.com/user-attachments/assets/e8b5817e-d4de-446b-8b41-c6c7b8612420">

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


### 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>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-31 17:08:11 -05:00
Ahmad Bamieh
8e10d0eff2
[EBT] Use analytics module (#189052)
The EBT pacakge has been moved to a separate NPM package
([@elastic/ebt](https://www.npmjs.com/package/@elastic/ebt))

The npm package is on version `0.0.x` until we finish the reviews then
i'll publish the `1.0.0` version before merging this PR.

The PR is mostly code deletes after moving the code to the public ebt
github repo https://github.com/elastic/ebt

The significant changes are:
1. removed the `packages/analytics/ebt` package from kibana
2. remove @kbn/ebt references in favor of the npm package.
3. Added a util package to provide the package with the telemetry
endpoint and headers
This was previously backed into the package but now i've rewired it be
provided from Kibana, this way we have more control over the URL and
headers we use to send EBT telemetry for our elastic endpoint, which
will probably be different between users of this package and this way
we'll also avoid republishing the package if we ever want to change
these details.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
2024-07-31 08:31:20 -05:00
Dzmitry Lemechko
94dca8d650
[CODEOWNERS] fix appex-qa ownership (#189602)
## Summary

I noticed `elastic/appex-qa` is pinged for quite many PRs.

with #188606 some test folders became packages with `"owner":
"@elastic/appex-qa",`, that autmatically updated CODEOWNERS file with
appex-qa listed for basically every test path.


https://github.com/elastic/kibana/pull/188606/files#diff-3d36a1bf06148bc6ba1ce2ed3d19de32ea708d955fed212c0d27c536f0bd4da7R878-R881

This PR removes `owner` for the following test "packages"
- x-pack/test_serverless 
- test 
- x-pack/test 

and CODEOWNERS file keeps these paths without specific owner.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-31 14:20:47 +02:00
Julia Rechkunova
22de72d022
[Discover] Allow to select/deselect all rows in the grid at once (#184241)
- Closes https://github.com/elastic/kibana/issues/175943

## Summary

This PR adds a checkbox which allows now to select all rows at once (or
deselect all) on the current page.

- [x] A new checkbox was added to the grid header
- [x] "Compare documents" button was moved under "Selected" menu
- [x] "Compare documents" button gets disabled if user selects more than
100 rows
- [x] "Selected" menu button got a new look
- [x] A new "Select all X" button was added next too "Selected" menu
button

<img width="1554" alt="Screenshot 2024-07-18 at 14 45 00"
src="https://github.com/user-attachments/assets/631cd350-be7d-43be-bc07-c0f6a943bacb">
<img width="563" alt="Screenshot 2024-07-18 at 14 45 10"
src="https://github.com/user-attachments/assets/d49d18f2-d255-401f-b157-3892e6f78d7c">
<img width="443" alt="Screenshot 2024-07-18 at 14 47 02"
src="https://github.com/user-attachments/assets/154c8292-c9b3-409d-b9f6-f78ac83527e9">


### 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: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-31 13:25:03 +02:00
Alejandro Fernández Haro
89f703f1c5
Flaky test #118488 (#189542) 2024-07-30 16:33:33 -05:00
Ignacio Rivas
9e23a0ad06
[Console] Fix register shortcuts monaco (#188948) 2024-07-30 16:37:45 +02:00
Alejandro Fernández Haro
11b750b10a
Minimize shared-common everywhere (#188606)
## Summary


![8xfggo](https://github.com/user-attachments/assets/f3d9312f-2ad3-4fa2-9daf-01e2b1ad6cac)

At the moment, our package generator creates all packages with the type
`shared-common`. This means that we cannot enforce boundaries between
server-side-only code and the browser, and vice-versa.

- [x] I started fixing `packages/core/*`
- [x] It took me to fixing `src/core/` type to be identified by the
`plugin` pattern (`public` and `server` directories) vs. a package
(either common, or single-scoped)
- [x] Unsurprisingly, this extended to packages importing core packages
hitting the boundaries eslint rules. And other packages importing the
latter.
- [x] Also a bunch of `common` logic that shouldn't be so _common_ 🙃 

### For maintainers

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-29 12:47:46 -06:00
Hannah Mudge
28b6179aec
[Controls] Fix error thrown on numeric options list (#188789)
## Summary

This PR makes the suggestions returned from the options list route more
type safe by ensuring that strings are **always** returned - previously,
it sometimes returned numbers, which was inconsistent with our defined
types. Unfortunately, this messed with the field formatter for date
fields specifically - so, to get around this, I've had to convert date
fields back to a number specifically for the formatter **only**.

This resolves the error that was getting thrown for numeric options list
controls, which was happening because we were returning **numbers** from
the suggestions route rather than strings and some recent changes to the
`EuiSelectable` component require strings:

**Before:**


https://github.com/user-attachments/assets/0e723e2f-e8f0-4466-b857-8164088cd1e7

**After**


https://github.com/user-attachments/assets/d9b138b9-de27-4e14-8c85-0ce4bfde16ce


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


### 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-07-29 11:01:53 -05:00
Luke G
7db28682dd
[Security Solution] Support experimental features in timelines (#189028)
## Summary

Adding generic support for experimental features in timelines

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-26 10:46:40 -05:00
Joe Reuter
03958651d9
Observability Onboarding: Show otel tile on integrations page (#189163)
Similar to how APM is shown as an integration as well, show the new
OTel-based flow on the integrations page so people find it from there as
well:

<img width="991" alt="Screenshot 2024-07-25 at 11 32 46"
src="https://github.com/user-attachments/assets/4d806ed1-4b01-4ac8-985c-0e59708fa4c6">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-26 17:42:03 +02:00
Eyo O. Eyo
6ddffb57fb
Compute dashboard panel selection list lazily (#187797)
## Summary

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

This PR changes how the dashboard panel selection items get computed, it
had previously been computed eagerly, in this implementation panel
selection items would only be computed when the user actually clicks the
`add panel` button, with it's results cached so that subsequent
interactions with the `add panel` button leverages the already computed
data.

**Notable Mention:**
The options presented as the dashboard panel list now only comprise of
uiActions specifically registered with the uiAction trigger
`ADD_PANEL_TRIGGER` and specific dashboard visualisation types. See
https://github.com/elastic/kibana/pull/187797#discussion_r1681320456 to
follow the reasoning behind this.

That been said adding new panels to the dashboard, would be something
along the following lines;


```ts
import { ADD_PANEL_TRIGGER } from '@kbn/ui-actions-plugin/public';

 uiActions.attachAction(ADD_PANEL_TRIGGER, <registredActionId>);

// alternatively
// uiActions.addTriggerAction(ADD_PANEL_TRIGGER, ...someActionDefintion);
````

### Visuals

7c029a64-2cd8-4e3e-af5a-44b6788faa45

### How to test 
- Navigate to a dashboard of choice
- Slow down your network speed using your browser dev tools, refresh
your dashboard, and click on the “Add panel” button as soon as it is
available (before the panels have a chance to load).
- You should be presented with a loading indicator, that eventually is
swapped out for the list of panels available for selection.


### 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 -->
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
<!--
- [ ] [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 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-07-26 13:54:22 +02:00
Nick Peihl
47c7137a95
[Links] Don't close the flyout if the user cancels save to library (#188995)
Fixes #188931 

## Summary

Fixes Links panel flyout closing if the user cancels the Save modal
2024-07-24 13:09:24 -04:00
Nick Partridge
49a985625b
Upgrade prettier dependencies (#188032)
## Summary

- Upgrade `prettier` to `v2.8.x`.
- Upgrade related decencies.
- Adds `prettier` group to renovate config.
- Fixes bootstrapping type error.

## Main Changes

### Add parentheses for `TypeofTypeAnnotation` to improve readability

[link](https://github.com/prettier/prettier/blob/main/CHANGELOG.md#add-parentheses-for-typeoftypeannotation-to-improve-readability-14458-by-fisker)

```ts
// Input
type A = (typeof node.children)[];

// Prettier 2.8.4
type A = typeof node.children[];

// Prettier 2.8.5
type A = (typeof node.children)[];
```

### Add parentheses to head of `ExpressionStatement` instead of the
whole statement


[link](https://github.com/prettier/prettier/blob/main/CHANGELOG.md#add-parentheses-to-head-of-expressionstatement-instead-of-the-whole-statement-14077-by-fisker)

```ts
// Input
({}).toString.call(foo) === "[object Array]"
  ? foo.forEach(iterateArray)
  : iterateObject(foo);

// Prettier 2.8.1
({}.toString.call(foo) === "[object Array]"
  ? foo.forEach(iterateArray)
  : iterateObject(foo));

// Prettier 2.8.2
({}).toString.call(foo.forEach) === "[object Array]"
  ? foo.forEach(iterateArray)
  : iterateObject(foo);
```

## Details

This started because I noticed we were on `typescript@^5` but still on
an old prettier that complained about use of new TS features such as
[`satisfies`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html#the-satisfies-operator).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-24 17:29:05 +01:00
Pierre Gayvallet
85a90a71e4
Add FTR tests for stream/buffer error responses (#188937)
## Summary

Fix https://github.com/elastic/kibana/issues/56305
2024-07-24 15:00:13 +02:00