Commit graph

68602 commits

Author SHA1 Message Date
Luke Elmers
7a559ff0ca
Remove unnecessary backticks from API docs. (#170376) 2023-11-02 06:17:44 -06:00
Wafaa Nasr
015bbaafb4
[Security Solution][Exceptions][API testing] Refactor commands in package.json (#170025)
## Summary

- Refactor package.json to remove duplicates 
- Move the new term rules
2023-10-28 21:37:57 +02:00
Kibana Machine
846480aaf2
[api-docs] 2023-10-28 Daily api_docs build (#170086)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/504
2023-10-28 01:04:15 -04:00
Joey F. Poon
cfc92da467
[Security Solution] unrevert #169901 - add handling for endpoint package spec v2 (#170069) 2023-10-27 14:17:02 -07:00
Nathan Reese
4b2728806a
Update incomplete data messaging (#169578)
Closes https://github.com/elastic/kibana/issues/167906

PR breaks monolith component `<SearchResponseWarnings/>` into 3 separate
components: `<SearchResponseWarningsBadge/>`,
`<SearchResponseWarningsCallout/>`, and
`<SearchResponseWarningsEmptyPrompt/>`. These components are designed to
display a single messages when provided warnings from multiple requests
and display better messaging around partial results. PR also removes
`message` from `SearchResponseWarning` type.

Collaborated with @gchaps on copy.

### Test setup
1. install sample web logs data set
2. install sample flights data set
3. Create data view.
    1. Set **Index pattern** to `kibana_sample_data*`
    2. Set **Time field** to `timestamp`
4. Open discover
5. Select **kibana_sample_data*** data view
6. set time range to last 24 hours
7. Add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "shard failure message 123",
            "name": "kibana_sample_data_logs",
            "shard_ids": [
              0
            ]
          }
        ]
      }
    }
    ```
8) save search as **kibana_sample_data***

#### Search response warnings callout
1. Open saved search created in test setup
<img width="500" alt="Screenshot 2023-10-24 at 8 49 19 AM"
src="867cff58-c201-4a6b-b049-7136b43d053f">
2. Click "expand" icon on left of first row in documents table
3. Click "Surrounding documents"
4. Re-enable "kibana_sample_data_logs failure" filter
<img width="500" alt="Screenshot 2023-10-24 at 8 51 22 AM"
src="a50cf033-64de-4909-a47d-6ee07bb915ea">

#### Search response warnings empty prompt
1. Open saved search created in test setup
2. Add filter `DistanceKilometers is -1`
<img width="500" alt="Screenshot 2023-10-24 at 8 44 13 AM"
src="e3ae0fac-8bda-4cad-b079-8ace4e01b786">

#### Search response warnings badge
1. create new dashboard
2. add saved search created during test setup
<img width="500" alt="Screenshot 2023-10-26 at 9 15 21 AM"
src="0066e3e2-953b-4631-a7aa-f389f7e6dbfc">


#### Search response warnings toast
1. create new table aggregation visualization
2. Use saved search created during test setup as source
<img width="500" alt="Screenshot 2023-10-24 at 2 59 41 PM"
src="58aab97e-71d9-49d9-bd67-73484ec54751">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-10-27 13:20:00 -06:00
Saarika Bhasi
b601f9af7b
[Serverless Search] Create anchor to ingest data section in Get started (#169871)
## Summary

Creates an anchor `/#ingestData` to Ingest Data section in Get started
page.

### Screen Recording


58e52abb-4c66-4a41-a827-d34810d84c3d

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-10-27 15:19:10 -04:00
Dzmitry Lemechko
6698810958
[esArchiver] restrict from modifying saved objects indexes (#169852)
## Summary

Related to #161882

The goal is to prevent FTR tests from new esArchives that overrides SO
indexes.

This PR adds the existing archives that re-create Saved Objects indexes
into temporary exception list, located in
`packages/kbn-es-archiver/src/fixtures/override_saved_objects_index/exception_list.json`.
Whenever tests/archives are updated to not modify SO indexes, archive is
expected to be removed from the list (progress can be tracked in
#169075, #168973, #168969, #168926 )

Load action has a check if index is SO index and if the archive is in
the exception list. This will throw error for the new archives, but
still work as usual for the existing ones while teams updating the
tests.

Whenever test is loading archive listed in the exception list, the
following warning message is logged:
```
warn x-pack/test/functional/es_archives/data/search_sessions overrides Saved Objects index(es) and placed temporary in the exception list.
Please fix the archive and remove it from /Users/dmle/github/kibana/packages/kbn-es-archiver/src/fixtures/override_saved_objects_index/exception_list.json.
For more details see: https://github.com/elastic/kibana/issues/161882
```

If the test loads a newly added archive that modifies a Saved Object
index (e.g. `.kibana`), esArchiver will throw the error:
```
 Error: esArchiver doesn't support modifying the existing Saved Objects index: '.kibana_1',
 please update its definition in mappings.json
```
2023-10-27 11:27:10 -07:00
Coen Warmer
fb048e6e20
Add missing translations (#170045) 2023-10-27 09:42:52 -07:00
Florian Lehner
ac8d06316f
[Fleet] Add Universal Profiling executables (#169609)
## Summary

Adds to the appropriate mappings to ensure elastic-agent can write logs
for the Universal Profiling service.

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
2023-10-27 09:30:48 -07:00
Dmitrii Shevchenko
3a18916b31
[Security Solution] Migrate Rules schema to OpenAPI (#167999)
**Parent meta ticket:
https://github.com/elastic/security-team/issues/7491**

Resolves: https://github.com/elastic/security-team/issues/7582
Resolves: https://github.com/elastic/security-team/issues/7580
Resolves: https://github.com/elastic/security-team/issues/7581

## Summary

This PR migrates the rules schema to OpenAPI, Zod, and code generation.

The following APIs now have complete OpenAPI specifications and are
enabled for code generation:

| Method | Endpoint | OpenAPI spec | Fully migrated |
| ------ |
---------------------------------------------------------------- |
------------ | -------------- |
| POST | /api/detection_engine/rules |  |  |
| GET | /api/detection_engine/rules |  |  |
| PUT | /api/detection_engine/rules |  |  |
| PATCH | /api/detection_engine/rules |  |  |
| DELETE | /api/detection_engine/rules |  |  |
| POST | /api/detection_engine/rules/\_bulk_create |  |  |
| PUT | /api/detection_engine/rules/\_bulk_update |  |  |
| PATCH | /api/detection_engine/rules/\_bulk_update |  |  |
| DELETE | /api/detection_engine/rules/\_bulk_delete |  |  |
| POST | /api/detection_engine/rules/\_bulk_delete |  |  |

### Rule schemas are now forward-compatible

We now allow extra fields in schemas for forward compatibility, but we
remove them from the payload during parsing. So from now on, extra
fields are simply ignored and won't lead to validation errors.
2023-10-27 18:00:10 +02:00
Vitalii Dmyterko
46ca1f08b7
[Security Solution][Detection Engine] fixes ES|QL rule type case, when alerts get truncated (#170034)
## Summary

Missing `break` statement can cause additional requests in ES|QL rule
queries, in the next statement

```ts
      if (bulkCreateResult.alertsWereTruncated) {
        result.warningMessages.push(getMaxSignalsWarning());
      }
```
where we check if alerts were truncated to display warning.

If alerts were truncated, no need to do another paging request, we can
safely break loop execution, since we reached max number of possible
alerts


### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
2023-10-27 16:47:15 +01:00
Cee Chen
f235f2256e
[apm][uptime][monitoring] Remove color="ghost" buttons (#169312)
## Summary

👋 Hey y'all - EUI will shortly be deprecating the `ghost` color in all
button components (see
https://eui.elastic.co/v89.0.0/#/navigation/button#ghost-vs-dark-mode).

In this PR, components using `color="ghost"` within an `EuiBottomBar`
already automatically inherit dark mode coloring and should be changed
to `color="text"` instead.

For the legacy uptime change that adds a theme wrapper, I'm unsure what
context it's being used in (does not appear to be a bottom bar) and
would appreciate help QAing it.

I'm opening this PR ahead of time for your team so you can test this
migration and ensure no UI regressions have occurred as a result.

### Checklist

- [ ] Tested in light and dark mode

---------

Co-authored-by: shahzad31 <shahzad31comp@gmail.com>
2023-10-27 08:34:37 -07:00
Dima Arnautov
80d382a22f
[ML] AIOps: Fix Change point embeddable reporting (#169962)
## Summary

Fixes #169733

#### Reporting fix

Change point detection embeddable was incorrectly reporting render
completion. It was relying on the `onLoad` callback from the Lens
embeddable responsible for chart rendering, which only indicates that
data fetching is complete, but not the actual rendering. Current
implementation relies on the `renderComplete` event from each child
embeddable. Both PNG and PDF exports tested and work as expected.


![DASHBOARDDDD](fb718f31-5862-43ab-82e3-60ebb795b8eb)

#### Additional fixes

- Fixes the metric and split field controls states when editing existing
Change point embeddable from a dashboard
- Fixes `filter` query if partitions input is initialized as an empty
array.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2023-10-27 17:13:52 +02:00
Juan Pablo Djeredjian
8bf2931a54
[Security Solution ] Fix flake in /prebuilt_rules/fleet_integration.ts API Integration test (#169791)
Fixes: https://github.com/elastic/kibana/issues/167056

## Summary

- Flake cannot be reproduced on 500 runs on flaky test runner.
- Latest fail points to [a `socket timeout` error](https://buildkite.com/elastic/kibana-on-merge/builds/36893#018b3d21-52ea-40a5-92a2-24cd2375b525) and not an issue intrinsic to the test; and a subsequent retry makes the test pass.
- **Unskipping test.**


## Flaky test runs

- https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3728
- https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3729 [CONTROL - NO CHANGES]
2023-10-27 17:07:16 +02:00
Jeramy Soucy
92db12816a
Upgrades crypto-js@4.1.1→4.2.0 (#169976)
## Summary

Upgrades `crypto-js` transitive dependency from v4.1.1 to v4.2.0
2023-10-27 10:52:41 -04:00
Cauê Marcondes
1d54963ff5
[Profiling] Remove Security checks (#168341)
- Use Kibana internal user to fetch Profiling status.
- Check if current user has superadmin role to set up Profiling.
- Viewer users: disable set up button when Profiling is not yet
initialised.
- Remove Profiling role creation and check.

<img width="1187" alt="Screenshot 2023-10-06 at 10 50 44"
src="468dd22e-e9db-4691-86b3-acb2428d4ad8">
<img width="1079" alt="Screenshot 2023-10-06 at 10 51 15"
src="939ac662-5ccb-4210-a582-7ace77b6cf29">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-10-27 15:36:42 +01:00
Yulia Čech
dba5ab7599
[Index Management] Add number formatting to the indices list (#170017)
## Summary

Fixes https://github.com/elastic/kibana/issues/22173
This PR adds a formatting to the index size column of the indices list.
The number formatting is done according to the default locale in the
browser. I decided against aligning the column right because this would
looked misaligned to other columns. And aligning all of the columns
right doesn't look good either (see screenshots).

### Screenshot 
#### Formatted index size
<img width="438" alt="Screenshot 2023-10-27 at 13 32 42"
src="87ff1b31-36b0-4951-b6aa-3cdc0c9b545e">

<details>

#### Aligning the size column right (not implemented)
<img width="413" alt="Screenshot 2023-10-27 at 13 34 18"
src="df76a308-a927-45bd-8987-7da86a94c46f">

#### Aligning all columns right (not implemented)
<img width="1296" alt="Screenshot 2023-10-27 at 13 34 42"
src="2604ac48-015c-49eb-9e8c-003a5c989fb1">


</details>

### Checklist


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


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-10-27 07:22:54 -07:00
Rudolf Meijering
8c50c4b0c7
Try to revert classic migrations integration tests until before flakiness (#170023)
Attempt at understanding #166190

I first thought the flakiness could be a regression in Elasticsearch,
but it turns out because I can only reproduce 90% of the time I got
"lucky" and found a previous ES commit where tests passed 3 times in a
row. On further investigation I was able to reproduce failures on
commits as old as July (before we even saw these failures) so ES is
unlikely to be the root cause 👎

Looking at our flaky test failure logs I found the first occurence
happened on 5 September on the branch for
https://github.com/elastic/kibana/pull/164959 (before it was merged) and
then subsequent failures on other branches and main happened within a
few hours after https://github.com/elastic/kibana/pull/164959 was merged
on 11 September.

However, nothing in https://github.com/elastic/kibana/pull/164959 should
have changed or impacted behaviour. To try to track down the cause this
PR is attempting to restorte `actions.test.ts` until before
https://github.com/elastic/kibana/pull/164959. Serverless tests will
continue to use `actions_test_suite.ts` but for classic we'll run the
old `actions.test.ts`.
2023-10-27 07:20:59 -07:00
Shahzad
8bbb58f19a
[Synthetics] Global params Public APIs (#169669) 2023-10-27 16:16:40 +02:00
Yulia Čech
54385c577d
[Index Management] Add dynamic tabs to the index details page (#169570)
## Summary

Fixes https://github.com/elastic/kibana/issues/168699
This PR adds a new function to the extensions service in Index
Management to register additional tabs into the index details page. I
think we will be adding more content using this service and it might
change the interface of the service later on.

To add a new tab, add Index Management as a dependency to your plugin
and use the `addIndexDetailsTab` function in the extensions service. The
interface for the tab is as follows:
```ts
export interface IndexDetailsTab {
  // a unique key to identify the tab
  id: IndexDetailsTabIds;
  // a text that is displayed on the tab label, usually a Formatted message component
  name: ReactNode;
  // a function that renders the content of the tab
  renderTabContent: (indexName: string, index: Index) => ReactNode;
  // a number to specify the order of the tabs
  order: number;
}
```

### How to test
1. Add a test tab from the ILM plugin using this test commit
74a771db65
2. Start Kibana and ES with `yarn es snapshot` and `yarn start`
3. Navigate to Index Management and click on any index name
4. Verify that the tab is displayed correctly and the tab header is in
the correct order

### 
Screenshot
<img width="1042" alt="Screenshot 2023-10-24 at 15 59 10"
src="7929f5db-8d2a-41d9-9e6d-4d1f74a93a35">


### Screen recording  


6826f68c-c90d-47b1-ae3e-da6e6981d7ba


### Checklist

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


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-10-27 07:05:50 -07:00
Stratoula Kalafateli
88db223247
[ES|QL] Displays a dismissible callout (#169998)
## Summary

Although we are displaying the Technical preview badge in the dataview
picker we want to make it more prominent in the UI due to some concerns
on the scalability. This PR adds a dismissible callout (state stored in
local storage).

<img width="828" alt="image"
src="9287c9d8-0e67-4498-a544-b17eea9569b4">

---------

Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
2023-10-27 07:03:08 -07:00
Alejandro Fernández Haro
9c58bd5ec8
[logging] Encode control chars (#169773) 2023-10-27 06:35:37 -07:00
Jon
fafec28398
[ci/on-merge] Adjust check types queue (#170026)
n2-2-spot preemption are frequent enough that this is causing pipeline
instability. This moves the instance size up to n2-4

This also removes the max-old-space-size definition I previously set.
delanni helped me understand that we're spawning a tsc process with a
memory limit already defined.
2023-10-27 08:08:48 -05:00
Jon
134532384e
[ci] Remove --fix from precommit_hook (#169978)
Currently on CI, the precommit_hook will fix lint warnings against the
most recent commit. When multiple commits are pushed up at once, lint
warnings on earlier commits may go unnoticed until they are squashed and
merged. The on-merge pipeline will fail due to changed files, and pull
requests based on the squashed commit will see unrelated changes
auto-fixed.

This removes the --fix flag from the precommit hook check.

Closes https://github.com/elastic/kibana/issues/169966
2023-10-27 07:39:44 -05:00
Elena Stoeva
7ef118ce79
[Snapshot Restore] Fix a11y issue in policy form (#169635)
Fixes https://github.com/elastic/kibana/issues/153788

## Summary

This PR fixes the a11y issue in the "Create policy" form for the two
"Expiration" fields.

**Before:**
<img width="1674" alt="Screenshot 2023-10-24 at 12 06 03"
src="8ac5d406-8b84-418c-a327-7edf2d8dac3d">



**After:**
<img width="1674" alt="Screenshot 2023-10-24 at 12 06 35"
src="e09689c6-8d0c-43a9-9e97-b63cca2d060d">



The aria-labels can also be tested with a screen reader (e.g. VoiceOver
on Mac).
2023-10-27 04:46:03 -07:00
Dario Gieselaar
6e21d81091
[Obs AI Assistant] Fixes issue w/ duplicated recalls (#169927)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-10-27 13:34:48 +02:00
Anton Dosov
54dd98d8d4
[Serverless] Fix "Discover" breadcrumb preserve context (#169789)
## Summary

This changes how serverless breadcrumbs are implemented in Discover. It
simplifies the current implementation and also fixes an issue with
"Discover" breadcrumb missing context from it's URL (see
https://github.com/elastic/kibana/pull/163607#pullrequestreview-1574271316)

Instead of using `serverless.setBreadcrums` API for deeper context
serverless breadcrumb, this PR adds `deepLinkId` to base discover
breadcrumb. Based on this id the navigational breadcrumbs are merged
with the regular breadcrumbs set in `chrome.setBreadcrumbs`). (This
feature was implemented here:
https://github.com/elastic/kibana/pull/169513)

This PR also improves "Discover" breadcrumb in oblt project when
navigated from logs explorer to discover by adding "discover" to the
navigation tree and hiding it from side nav.

![Screenshot 2023-10-25 at 13 34
05](19bbd1a8-809e-429a-a0cf-0bc0f22f49d5)
2023-10-27 04:05:02 -07:00
Carlos Crespo
789add7dc2
[ObsUX] Auto-refresh endless loading loop fix (#169663)
closes https://github.com/elastic/kibana/issues/169375

## Summary

This PR fixes the problem that can happen while the auto-refresh is
turned on in the Asset Details flyout


59c57e03-7757-4024-86c1-614ae0d98e6f

The solution here was based on how dashboards handle the auto-refresh.
It has to work so that new requests can only be made after ongoing
requests are finished. The refresh rate, therefore, doesn't mean that
every Xs new request will be made, but rather that new requests will be
made after Xs since the requests responded.

To resolve this, a new context named `LoadingStateProvider` has been
introduced. It serves to monitor ongoing loading processes and regulate
when new requests can be initiated. The `useRequestObservable` hook has
been added to allow the `LoadingStateProvider` to observe request
statuses

Both heavily rely on `rxjs` as it was the most logical solution to use
for this. rxjs can be confusing, so I tried to add as many comments as
possible to help comprehension and maintenance.

This change solves the loading problem on the Overview, Metadata,
Processes and Anomalies tabs

### Out of scope
This change does not affect Embeddables, as they do not provide a means
to observe request statuses. Therefore, they may still encounter
potential issues with endless loading loops.

### Additional changes

While working on it I realized we were not properly using Lens. Based on
the
[example](https://github.com/elastic/kibana/blob/main/x-pack/examples/embedded_lens_example/public/app.tsx#L256)
provided by them, we should be passing the `searchSessionId`. The
`searchSessionId` also allows us to force new searches. So I replaced
the `lastReloadTimestamp` with that in both the Asset Details and Hosts
pages.

### How to test

- Setup a local Kibana instance
- Navigate to `Infrastructure`
- Click on a host to open the flyout
- Turn the auto-refresh on. Setting the refresh rate to 1s will already
validate the fix
- Try wider date ranges and shorter refresh rates

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-10-27 12:56:50 +02:00
Robert Oskamp
0b81ca714c
[FTR] Fix / skip flaky tests on serverless MKI (#170011)
## Summary

This PR deals with serverless tests that are flaky when running in MKI:
* Search bar tests have been stabilized by adding a wait for global
loading before interacting with the search feature
* Summary actions API tests have been skipped for MKI runs again as the
fix didn't fully work
2023-10-27 12:40:14 +02:00
Julia Rechkunova
3e56a9ff55
[DataView] View mapping conflicts (#169381)
- Addresses https://github.com/elastic/kibana/issues/168874

## Summary

This PR adds a link to Data View Management page to drill down to fields
with mapping conflict easily.
Also it fixes issues with Back button in a browser as it implements now
2-direction sync between URL and app state.

<img width="600" alt="Screenshot 2023-10-25 at 17 09 04"
src="76bd5b79-6fcc-43db-ab34-5014fc0d0036">



### 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>
2023-10-27 03:35:10 -07:00
Ievgen Sorokopud
537af2fbd2
[Security Solution] User is not able to create/edit an exception after an error has been displayed (#168217) (#169801)
## Summary

These changes fixes the issue where user is not able to create/edit an
exception after an error has been displayed. That happens due to not
re-setting loading state to `false` on exception being thrown.

Addressing https://github.com/elastic/kibana/issues/168217
2023-10-27 12:31:54 +02:00
Carlos Crespo
22660304c6
[ObsUX] Fix hosts_view flaky test (#169823)
fixes: https://github.com/elastic/kibana/issues/166344

## Summary

Functional test fix

https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3739
2023-10-27 12:29:23 +02:00
Elena Stoeva
c210e95d48
[Management] Improve a11y of icontips in nav bar (#169649)
Fixes https://github.com/elastic/kibana/issues/154418

## Summary

This PR improves a11y of the tooltips in the Management nav bar by
replacing `EuiToolTip` with `EuiIconTip`:

- The tooltips are now accessible by keyboard navigation only (pressing
TAB) - see video below.
- The tooltip icons are slightly bigger and more visible.




12f85657-074a-41cf-b6e6-73bbbe0393be


<img width="1922" alt="Screenshot 2023-10-24 at 13 57 20"
src="87fb5273-918f-4961-932d-d954ecda4404">
2023-10-27 11:05:01 +01:00
Marco Antonio Ghiani
002ac40dc1
[Discover] Enhance flyout customization to update content (#169634)
## 📓 Summary

Closes #169394 

This PR extends the `flyout` customization extension point to support
updating/replacing the content shown in the document flyout.
A consumer would need to show/hide/highlight details related to the
expanded document, and it might also want to control whether the default
content (currently only the UnifiedDocViewer) is shown/hidden. Finally,
it could be necessary to perform imperative actions such as
adding/removing columns or filter.

To get this flexibility at the moment of customizing the content, the
existing extension point takes now a `Content` component, where some
props are injected.

```
export interface FlyoutContentProps {
  actions: {
    setFilter?: DocViewFilterFn;
    addColumn: (column: string) => void;
    removeColumn: (column: string) => void;
  };
  doc: DataTableRecord;
  renderDefaultContent: () => React.ReactNode;
}
```
N.B. `renderDefaultContent` is passed as a function instead of a React
element to avoid its creation in the Discover flyout in case the
consumer doesn't want to display it.

Here is a usage example of the new extension point property.

```
customizations.set({
  id: 'flyout',
  Content: ({ actions, doc, renderDefaultContent }) => {
    return (
      <Panel>
        <HighlightComponent timestamp={doc.flattened['@timestamp']} />
        <Columns onAddColumn={actions.addColumns} onAddColumn={actions.removeColumn} />
        <Filters onFilter={actions.setFilter} />
        {renderDefaultContent()}
      </Panel>
    );
  },
});
```

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
2023-10-27 11:38:00 +02:00
Alex Szabo
227d7acae7
[Ops] Create SO migration snapshot comparion script (#168623)
## Summary
Continuation on: #167980 

Now that we have the snapshots created for merges, we can compare the
existing snapshots.
This PR creates a CLI for grabbing and comparing these snapshots.

The CLI looks like this: 
```
  node scripts/snapshot_plugin_types compare --from <rev|filename|url> --to <rev|filename|url> [--outputPath <outputPath>]

  Compares two Saved Object snapshot files based on hashes, filenames or urls.

  Options:
    --from            The source snapshot to compare from. Can be a revision, filename or url.
    --to              The target snapshot to compare to. Can be a revision, filename or url.
    --outputPath      The path to write the comparison report to. If omitted, raw JSON will be output to stdout.
    --verbose, -v      Log verbosely
```
2023-10-27 11:29:24 +02:00
Shahzad
5945ca8ad7
[Synthetics] Fix Pagination error for stderr table (#169979) 2023-10-27 11:18:55 +02:00
Vitalii Dmyterko
7266ab52da
[Security Solution][Detection Engine] updates missing privileges for … (#169916)
## Summary

- addresses https://github.com/elastic/security-docs/issues/4069
- changes text .lists, .items indices to .lists, .items data streams

### Before


![image](00f42f47-2cd2-4667-b07c-70fa21ba429d)



### After

<img width="2560" alt="Screenshot 2023-10-26 at 10 58 18"
src="93fff167-c6a7-437e-9618-7724a4249872">
2023-10-27 09:57:46 +01:00
Pierre Gayvallet
ca660dac38
use sha-256 for localisation files integrity hashes (#169931)
## Summary

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

use `sha-256` instead of `md5` when hashing the translation files. 

As discussed in the issue, those hash aren't checked against anywhere,
and just used in telemetry to know if customers are using custom
translation files.
2023-10-27 10:49:11 +02:00
Julia Rechkunova
f78e0624e5
[Discover] Update mapping conflict popover with types list (#169855)
- Related to https://github.com/elastic/kibana/issues/168874

## Summary

This PR updates the popover to include conflicting types list.

<img width="487" alt="Screenshot 2023-10-25 at 18 46 42"
src="a68e5364-a784-4320-a68c-e7ba0c19d2f3">


### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2023-10-27 10:03:59 +02:00
Anton Dosov
cb2a6e5348
[Serverless] fix breadcrumbs for alerts and slo (#169778)
## Summary

Close https://github.com/elastic/kibana/issues/161447

This fixes deeper context breadcrumbs in serverless observability
project for alerts and slos apps.
This builds on top of https://github.com/elastic/kibana/pull/169513
where we added merging of navigational project breadcrumbs with deeper
context breadcrumbs set by `chrome.setBreadcrumbs`. The merging is based
on deepLinkId, so we're adding it to base breadcrumbs. The deepLinkId is
type checked.

![Screenshot 2023-10-25 at 12 28
07](947f59b3-b338-4bd1-96b9-7414bf396fae)
![Screenshot 2023-10-25 at 12 28
16](5e73e902-3397-4b3e-9202-5c1e2c49358f)
2023-10-27 09:58:17 +02:00
Miriam
ef68ba981b
[ObsUX] Remove annotations unit test, covered already by API test (#169839)
Closes https://github.com/elastic/kibana/issues/169106
2023-10-27 08:54:04 +01:00
Philipp Kahr
6c2071eb0e
Update internal tracing docs (#162372)
## Summary

The documentation for the instrumentation of Kibana listed a lot of
settings to apply. Most of them are not needed since we have good
defaults for the agents. Additional information like
`labels.deploymentId` are automatically appended in case of usage with
ECE.

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


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-10-27 03:15:20 -04:00
Kibana Machine
0d5a1b0bb1
[api-docs] 2023-10-27 Daily api_docs build (#169997)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/503
2023-10-27 00:50:50 -04:00
Jonathan Budzenski
638d070cba Revert "[Security Solution] add handling for endpoint package spec v2 (#169901)"
This reverts commit 82880fed8e.
2023-10-26 19:39:48 -05:00
Garrett Spong
a0d607b4f5
[Security Solution][Elastic AI Assistant] ESQL query generation tweaks (#169984)
## Summary

After testing in the latest BC these three tweaks were identified:

- [X] Set k value to 10 so more documents are returned (since ESQL KB
docs are broken up by function and can be small)
- [X] Adds Quick Prompt to aid in ESQL Query Generation that only shows
if KB is enabled
2023-10-26 17:37:31 -07:00
Jon
14e9c82454
[ci] Remove duplicate scripts/type_check (#169982) 2023-10-26 17:53:36 -05:00
Abdul Wahab Zahid
005f4084da
[Synthetics] Adjust Errors metric and sparklines query for retests (#169959)
Fixes #169933 

## Summary

The PR adjusts the query for Errors count metric and Errors sparklines
metric to account for retests.
2023-10-26 23:51:02 +02:00
Ying Mao
dc3a14036a
[Response Ops][Task Manager] Return HealthStatus.Warning instead of error when task manager stats are not yet available. (#169447) 2023-10-26 17:01:32 -04:00
Lisa Cawley
8924218d6a
[OAS] Simplify server declaration in ML APIs (#169885) 2023-10-26 13:45:47 -07:00
Lisa Cawley
7cd0b74ccb
[OAS] Remove redundant servers from data view APIs (#169887) 2023-10-26 13:17:57 -07:00