Commit graph

3236 commits

Author SHA1 Message Date
Christiane (Tina) Heiligers
b9f31afc23
Flags core mocks packages as devOnly (#149466)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Fix https://github.com/elastic/kibana/issues/145064
2023-01-26 08:46:06 -07:00
Kevin Delemme
dd56e9b06d
chore(slo): refactor sli client (#149259) 2023-01-26 08:49:22 -05:00
Thomas Watson
6a0f7b9562
Downgrade Node.js to version 16 (#149531)
Closes #149438

We'll upgrade again once a suitable solution to the issue has been
found.
2023-01-26 11:53:52 +00:00
Pierre Gayvallet
cd9a53f284
Create the ftrSoApis FTR plugin (#149188)
## Summary

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

More and more SO types will not be accessible from the HTTP APIs (either
`hidden:true` or `hiddenFromHTTPApis: true`).

However, the FTR SO client (`KbnClientSavedObjects`) still needs to be
able to access and manipulate all SO types.

This PR introduces a `ftrSoApis` plugin that is loaded for all FTR
suites. This plugin exposes SO APIs that are used by the FTR client
instead of the public SO HTTP APIs. These APIs are configured to know
about all types, even hidden ones.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-26 01:47:29 -07:00
Luke Gmys
2862d4bdb7
Replace ecs package with ecs-typescript generated code (#148804) 2023-01-26 07:10:32 +01:00
Rudolf Meijering
201fabc63f
Fix core app routes (#149462)
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.


### Checklist

Delete any items that are not applicable to this PR.

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


### Risk Matrix

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

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

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

| Risk | Probability | Severity | Mitigation/Notes |

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


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-01-25 12:13:34 -07:00
Spencer
4e7560f19d
[ci-stats] move shipper to a package, validate limits in on-merge job (#149474)
We just had an issue where two PRs were merged and it caused the limit
of the `triggerActionsUi` bundle to be exceeded, breaking PR builds. The
issue is that we didn't see any indication of this in the on-merge jobs
because we don't produce the PR report for on-merge jobs or ask ci-stats
if we should fail the job. Instead, we just ship the metrics for
baseline purposes. This fixes that problem by adding a `--validate` flag
to `node scripts/ship_ci_stats`, which takes care of sending at least
some ci-stats and will verify that the bundle limits are not exceeded.

Since we didn't catch this issue in the on-merge job the limits were
incorrect for over an hour and merged into many PRs, wasting engineering
and CI time.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-25 08:20:40 -07:00
Katerina Patticha
026d347305
[APM] Display comparison for mobile stats (#149097)
## Summary 

related to https://github.com/elastic/kibana/issues/146854
1. Show the comparison for the mobile stats
2. Display a badge "comparison not supported" (when the comparison is
enabled )for the components that don't support comparison
3. display "coming soon" text for the metrics that are not available yet


Addressing feedback
- Replace the badge with a tooltip with an icon
- Always display the previous state for metrics when loading and add the
spinner
- Update Crash rate to Crash rate (Crash per minute)
- Remove fallback to transaction events badge



## Before
<img width="1420" alt="image"
src="https://user-images.githubusercontent.com/3369346/213138845-3eab0bf5-a24e-4ec0-87fb-d8eacc029a2f.png">

## After 


![Jan-25-2023
09-52-53](https://user-images.githubusercontent.com/3369346/214520021-6ff04d13-250a-47bd-b983-66c6f35cfb46.gif)

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-25 05:56:53 -07:00
Jean-Louis Leysens
631675ba39
[Saved Objects] Import SO types from server rather than common to avoid deprecation (#149289)
## Summary

After merging https://github.com/elastic/kibana/pull/148979 there are a
number of imports that can be fixed immediately to address our new
deprecation notice.

## To Core reviewers

The package `core-saved-objects-server` is using types from
`core-saved-objects-api-server` which creates a circular dependency when
using `SavedObject` type from it's new home in
`core-saved-object-server`:

`core-saved-objects-server` -> `core-saved-objects-api-server` ->
`core-saved-objects-server`

One solution is that we can create a new package
`packages/core/saved-objects/core-saved-objects-server-shared` that will
only hold the `SavedObject` type and a select few others. I'm not sure
what the best approach here is. I have left
`core-saved-objects-api-server` unchanged for now (i.e., it is still
importing `SavedObject` from `common` which is deprecated).

Any input would be greatly appreciated!

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-25 05:38:05 -07:00
Stratoula Kalafateli
5ec4bde603
[Visualizations] Enables multiple values filtering on tooltip actions (#148372)
## Summary

Enables tooltip actions on:
- Lens embeddables (as soon as the unified search bar exists)
- Lens
- Agg based (as they share the same renderer with Lens)

I am not enabling this in TSVB.


![lens](https://user-images.githubusercontent.com/17003240/210559313-3c36dab0-771d-415a-b9cd-fa2a8d48579e.gif)

Also the action is not enabled for Lens if:
- there are only series with metrics

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

Co-authored-by: Marco Vettorello <marco.vettorello@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-25 12:55:30 +02:00
spalger
3d0756fc35
fix triggerActionsUi overage 2023-01-24 19:25:56 -06:00
Pablo Machado
d313c950d1
[145663] Refactor explore pages to migrate HoverActions to CellActions (#148056)
Epic: https://github.com/elastic/kibana/issues/144943


## Summary
Update explore pages to use the new `CellActions` component instead of
`HoverActions `.

### What is included?
* Update the user, host, and network page tables.

<img width="1512" alt="Screenshot 2023-01-17 at 13 12 16"
src="https://user-images.githubusercontent.com/1490444/212896520-f41e9026-cef0-4a37-8bd1-35784a87ca09.png">
<img width="1482" alt="Screenshot 2023-01-17 at 13 19 34"
src="https://user-images.githubusercontent.com/1490444/212897411-cd3c3ef8-bca0-461b-a1ff-c7dd67159d1b.png">

* Fields rendered when clicking on "+{N} more" 
<img width="248" alt="Screenshot 2023-01-17 at 12 51 38"
src="https://user-images.githubusercontent.com/1490444/212892255-2ecd7050-75f6-4883-b331-1fed527de53f.png">


### What is NOT included?
* Visualizations
* Fields on details pages. They are also used by the Timeline and need
to be draggable.
* Timeline
* Datagrid tables - Events and Alerts
* Plugins



### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [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>
2023-01-24 11:44:43 -07:00
ofiriro3
cb599840e3
[Cloud Posture] - Deprecate csp rule remove migration object (#148530) 2023-01-24 05:50:54 -07:00
Rudolf Meijering
cfee703139
Bump elasticsearch-js to 8.6.0-canary.3 (#148521)
## Summary

Bump elasticsearch-js to 8.6.0-canary.3 to unblock
https://github.com/elastic/kibana/issues/145653

The updated version of elasticsearch-js comes with some type changes
that causes typescript type checking to fail. I've fixed the type errors
that were obvious/easy but left todo's for some types which were harder
for me to figure out. If any of these todo's are in your team's code,
please contribute directly to the branch to fix them.


### Checklist

Delete any items that are not applicable to this PR.

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


### Risk Matrix

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

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

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

| Risk | Probability | Severity | Mitigation/Notes |

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


### For maintainers

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

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Thom Heymann <thom.heymann@elastic.co>
Co-authored-by: weltenwort <stuermer@weltenwort.de>
2023-01-24 05:49:30 -07:00
LEE SEUNGHYO
95c2493e77
[Dashboard] Fix Phrase_filter query for scripted fields (#148942) (#148943)
- ISSUE [Dashboard] Visualize Library doesn't work filter on scripted
fields of Array Type. #148942

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Lukas Olson <lukas@elastic.co>
2023-01-24 03:29:11 -05:00
Ying Mao
b7a0204e49
[Response Ops][Alerting] Install resources needed for framework alerts-as-data (#145581)
Resolves https://github.com/elastic/kibana/issues/145100

## Summary

* Adds alerting config for `enableFrameworkAlerts`
* When `xpack.alerting.enableFrameworkAlerts=true`, `AlertsService` is
initialized during the alerting plugin setup phase
* Adds optional `alerts` definition to the `RuleType` definition which
allows a rule type to specify a context and a field mapping for that
context
* `AlertsService.initialize()` 
* installs an ILM policy that will be used by all alerts-as-data indices
- `alerts-default-ilm-policy`
* installs a component template that will be used by all alerts-as-data
indices - `alerts-common-component-template`, including all the mappings
for fields needed by the framework
* Rule type registration - when a rule type with an `alerts` definition
is registered, the context and field map are registered with the
`AlertService`. When `AlertsService` initialization is completed
successfully, context specific resources are installed.
* Context specific resources:
* installs context specific component template that reflects the
registered field map - `alerts-${context}-component-template`
* installs context specific index template for the default namespace -
`.alerts-${context}-default-template`
* creates context specific concrete write index for the default
namespace - `.alerts-${context}-default-000001`
* Resource installation retries for transient ES errors and
short-circuits when a timeout value is reached

## Notes
* We explore the possibility of creating a single index template per
context and re-using it for space-aware concrete indices but a rollover
alias (which must be space-aware) must be attached to an index template
so it is not feasible to only have a single index template
* There will be a followup issue for create space-specific index
templates/indices as needed to support detection rules desire to
separate alerts by space.

## To Verify

* set `xpack.alerting.enableFrameworkAlerts: true` in your kibana.yml
* modify
`x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.ts` to
define a custom field mapping for the `stack` context

```
--- a/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.ts
+++ b/x-pack/plugins/stack_alerts/server/rule_types/es_query/rule_type.ts
@@ -187,5 +187,14 @@ export function getRuleType(
     },
     producer: STACK_ALERTS_FEATURE_ID,
     doesSetRecoveryContext: true,
+    alerts: {
+      context: 'stack',
+      fieldMap: {
+        'kibana.alert.threshold': {
+          required: false,
+          type: 'long',
+        },
+      },
+    },
   };
 }

```
* start up ES and Kibana and verify that the correct resources are
installed. The following should be created:
  * ILM policy - `alerts-default-ilm-policy`
  * Common component template - `alerts-common-component-template`
  * Stack component template - `alerts-stack-component-template`
* Stack index template for default space -
`.alerts-stack-default-template`
  * Stack write index for default space - `.alerts-stack-default-000001`
* verify that the index template uses both component templates and that
the expected mappings are applied to the index
* try making non-destructive, additive only changes to the common
component template or the stack context field mapping and verify that
the concrete index mappings are updated.

### Checklist

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

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-01-23 21:07:09 -05:00
Alejandro Fernández Haro
4c626f16c0
Unskip Execution Context FTRs (#149070)
Resolves https://github.com/elastic/kibana/issues/112102
2023-01-23 18:33:53 -07:00
Christiane (Tina) Heiligers
f7b25f5e46
[Saved Objects] Provide ability to remove SO type from global SO HTTP API without hiding from the client (#149166)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
resolves https://github.com/elastic/kibana/issues/147150
2023-01-23 15:04:24 -07:00
Steph Milovic
6c0f67afc2
[Security Solution] Security Common Schema Package (#148664) 2023-01-23 10:07:08 -07:00
Spencer
2dd9c3a337
[dev-cli] restart Kibana when config is changed (#149334)
Restores the behavior of the dev cli prior to
https://github.com/elastic/kibana/pull/148924, allowing changes in
`config/**/*.yml` files to trigger server restarts.
2023-01-23 09:21:24 -07:00
Christiane (Tina) Heiligers
188009f937
[deprecations] Remove/update core-api deprecations targeted for removal by 8.8 (#147723)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-01-22 13:41:55 -07:00
Yulia Čech
e7746b24d5
[Guided onboarding] Register test guide in the example plugin (#147703)
This PR moves the test guide used for testing and dev work to the guided
onboarding package. It is now being registered when the guided
onboarding example plugin is being setup. For that a server side is
added to the example plugin.
Registering the test guide from the example plugin demonstrates how the
"register guide" function can be used for production guides. The test
config needs to be in the `kbn-guided-onboarding` package because
example plugins have some problems importing files from other plugins.
That way the test config is available to the example plugin and to the
guided onboarding plugin for unit and functional tests.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-20 03:29:25 -07:00
Rory Hunter
f90a89a839
Allow APM env to be set via the config file (#149266)
Part of #140818.

Kibana can read APM configuration from its own config or environment
variables. For the `environment` value, it can also use the `NODE_ENV`
value. However, `NODE_ENV` is often set, and due to the way the
configuration is merged, the env vars always override the config file.
In the case of the `environment`, this makes it easy to accidentally
clobber any `environment` that you set in the config file.

Tweak the config loading so that `NODE_ENV` is only used if the
`environment` isn't set in the config.
2023-01-20 10:02:11 +00:00
Lukas Olson
81d576454e
[KQL] Add case-insensitive config for term/wildcard queries (#148916)
## Summary

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

Adds a `caseInsensitive` option to the KQL parsing options
(`KueryQueryOptions`). When enabled, keyword queries (both
wildcard<sup>[1]</sup> and term<sup>[2]</sup>) will add the
`case_insensitive` option to enable case-insensitive search.

[1]
https://www.elastic.co/guide/en/elasticsearch/reference/8.6/query-dsl-wildcard-query.html#wildcard-query-field-params
[2]
https://www.elastic.co/guide/en/elasticsearch/reference/8.6/query-dsl-term-query.html#term-field-params


### Checklist

- [ ]
[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

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-01-19 17:27:02 -07:00
Bree Hall
e564eb31e2
Upgrade EUI to 73.0.0 (#149079)
eui@72.2.0  eui@73.0.0

---

**Bug fixes**

- Fixed `EuiDataGrid` a11y errors within toolbar popovers containing
draggable elements with interactive children
([#6517](https://github.com/elastic/eui/pull/6517))
- Fixed several styling bugs within `EuiDataGrid`'s sorting toolbar
popover ([#6517](https://github.com/elastic/eui/pull/6517))

**Breaking changes**

- `EuiToolTip`s now internally enforce only showing **one** tooltip at a
time (the most recently triggered tooltip). This primarily affects
scenarios where users are focused on a tooltip toggle via click, and
then hover onto another tooltip toggle.
([#6520](https://github.com/elastic/eui/pull/6520))
2023-01-19 16:17:30 -05:00
Tiago Costa
e38350f7f9
chore(NA): upgrades uuid to v9.0.0 (#149135)
This PR upgrades uuid into its latest version `9.0.0`.
The previous default used version `v4` was kept where it was previously
used and places using `v1` or `v5` are still using it.

In this latest version they removed the deep import feature and as we
are not using tree shaking it increased our bundles by a significant
size. As such, I've moved this dependency into the `ui-shared-deps-npm`
bundle.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-19 19:48:07 +00:00
Vadim Kibana
ebb61a5089
create @kbn/ui-actions-browser package (#149202)
## Summary

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

Sets up Ui Actions package and starts moving services from the plugin to
the package.

- [x] Setup `@kbn/ui-actions` package.
- [ ] Move code components to the package
  - [x] Types
  - [ ] Triggers
  - [ ] Actions
  - [ ] `UiActionsService`
- [x] Make `ui_actions` plugin use the new package.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-19 18:28:07 +01:00
Jeramy Soucy
c5faa31faf
[Saved Objects] Fixes namespace argument to encryption calls in repository update method (#149074)
Closes #149037.

## Summary

The namespace argument in Saved Object Repository Update method's call
to optionallyEncryptAttributes was being supplied by an unqualified
optional parameter. This means that when the namespace option was not
defined, the current namespace was not being passed to the encrypt
method. This PR updates the argument to the qualified namespace
determined by the optional parameter and the Spaces Extension's
getCurrentNamespace method.

Unit tests have also been updated to catch this case should it occur in
the future. The same consideration will be made for security extension
unit tests in [PR
148165](https://github.com/elastic/kibana/pull/148165).

## Testing
To test, follow the instructions given in [the
issue](https://github.com/elastic/kibana/issues/149037).
2023-01-19 12:10:31 -05:00
Kevin Delemme
e0016416ff
feat(slo): Create historical summary API (#149125) 2023-01-19 08:00:07 -05:00
Jean-Louis Leysens
0b74e6cd75
[Saved Objects] Fix deprecated Browser SO types (#149195)
## Summary

* Re-exporting SO types from `common` inside server code
* Deprecated individual APIs on interfaces, not just interfaces, to make
deprecation visible to consumers
* Deprecates the `savedObjects` prop on the `CoreStart` interface too
2023-01-19 05:23:31 -07:00
Sergi Massaneda
bca73b72ed
[Security Solution] [CellActions] Move to a package (#149057)
Epic: https://github.com/elastic/kibana/issues/144943

## Summary

Moving the existing CellActions implementation to a new home. The
`kbn-cell-actions` package contains components and hooks that are going
to be used by solutions to show data cell actions with a consistent UI
across them.

Security Solution is going to start using it by migrating all
"hover-actions" to the unified implementation, but the usage is not
restricted to it. Any plugin can register and attach its own actions to
a trigger via uiActions, and use this package to render the CellActions
components in a consistent way.

The initial implementation was placed in the uiActions plugin itself due
to a types constraints
(https://github.com/elastic/kibana/tree/main/src/plugins/ui_actions/public/cell_actions),
the constraint has been solved so we are creating the package for it as
planned.

This PR only moves that implementation to the new package, with small
directory changes. The exported components are not being used anywhere
currently, so the implementation may change during the migration phase.

### Checklist

Delete any items that are not applicable to this PR.

- [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]
[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

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-19 11:52:10 +01:00
Lukas Olson
d1ad2b12f9
Update codeowners to move AppServices packages to DataDiscovery (#149065)
## Summary

Updates CODEOWNERS to move AppServices packages to DataDiscovery.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-18 13:34:28 -07:00
spalger
e3dff93c97
[codeowners] rename global experience to @elastic/appex-sharedux 2023-01-18 10:02:49 -07:00
Joseph McElroy
f190904e9d
[Behavioral Analytics] update documentation + update link to events doc (#148881)
Update documentation + links to analytics events page


![image](https://user-images.githubusercontent.com/49480/212310925-bc07c2c1-602a-404a-85bb-1061f977d081.png)
2023-01-18 13:59:30 +01:00
Yngrid Coello
9f35e1ea3f
scenarioOpts example (#149111)
Added an example of how to use `--scenarioOpts`
2023-01-18 07:41:25 -05:00
Jean-Louis Leysens
bbf19cab6e
[Saved Objects] Browser-side client deprecation notice (#148979)
## Summary

In the near future we will remove Saved Object (SO) HTTP APIs. This PR
deprecates all browser-side SO types and interfaces.

General comments on the approach taken here:

* Add a deprecation notice that links to a GitHub issue that can be
referenced by all teams
* Do not break existing imports/exports
* Mocks are also an indication of SO browser-side use, added deprecation
notices
* Some common types must also be deprecated, some may remain. For those
to be removed they are moved to a separate file, with a deprecated
type-alias re-exported

## Notes to reviewers

* Easiest way to get an overview of the changes is to have the file-tree
open in the "Files changed" view
* Are there any other ways browser-side code can get knowledge of Saved
Objects?
* Please go through some client code and test that the DX is working as
expected (the GitHub issue is discoverable)

## Related
* https://github.com/elastic/kibana/issues/147150
* https://github.com/elastic/dev/issues/2194

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-18 04:03:23 -07:00
Stratoula Kalafateli
eb8aab093a
[Unified search] Fix the bug with the default value on numeric field filters (#149028)
## Summary

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

I created this bad ux with https://github.com/elastic/kibana/pull/148802

When you try to add a negative value to a numeric field filter, is not
easily applied.

I changed the behavior, so now the 0 is not automatically added on the
operator selection, the user can still add a filter without a required
value and I fixed the preview.
<img width="970" alt="image"
src="https://user-images.githubusercontent.com/17003240/212900946-d397eba8-debb-45a5-8d11-d9b515a989c6.png">
2023-01-18 09:03:13 +02:00
Jonathan Buttner
92418a6362
[Cases] API to return a case's connectors information (#147295)
This PR implements a new internal API to return the information relating
to all the connectors used throughout a case's lifespan.

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

```
GET http://localhost:5601/internal/cases/<case id>/_connectors

Response

{
    "my-jira": {
        "name": "preconfigured-jira",
        "type": ".jira",
        "fields": {
            "issueType": "10001",
            "parent": null,
            "priority": null
        },
        "id": "my-jira",
        "needsToBePushed": true,
        "hasBeenPushed": false
    }
}
```

<details><summary>cURL example</summary>

```
curl --location --request GET 'http://localhost:5601/internal/cases/ae038370-91d9-11ed-97ce-c35961718f7b/_connectors' \
--header 'kbn-xsrf: hello' \
--header 'Authorization: Basic <token>' \
--data-raw ''
```

Response
```
{
    "my-jira": {
        "name": "preconfigured-jira",
        "type": ".jira",
        "fields": {
            "issueType": "10001",
            "parent": null,
            "priority": null
        },
        "id": "my-jira",
        "needsToBePushed": true,
        "hasBeenPushed": false
    }
}
```

</details>


Notable changes:
- Refactored the user actions service to move the functions that create
user actions (builders etc) to its own class `UserActionPersister`
- Refactored the `CaseUserActionService` class to pull the saved object
client, logger, and other fields passed to each function via parameters
to be wrapped in a `context` member field within the class
- Plumbed in `savedObjectsService.createSerializer` to transform a raw
elasticsearch document into the saved object representation
- Added new internal `_connectors` route and `getConnectors` client
function
- Refactored the integration tests by extracting the connector related
utility functions into their own file

## Needs to be pushed algorithm

To determine whether a case needs to be pushed for a certain connector
we follow this algorithm:
- Get all unique connectors
  - For each connector
- Find the most recent user action contain the connector's fields, this
will be in the most recent `connector` user action or if the connector
was configured only once when the case was initially created it'll be on
the `create_case` user action
    - Grab the most recent push user action if it exists
- For each push search for the connector fields that were used in that
push
- Get the most recent user action that would cause a push to occur
(title, description, tags, or comment change)
- For each connector
  - If a push does not exist, we need to push
- If a push exists but the fields do not match the field of the most
recent connector fields, we need to push because the fields changed
- If the timestamp of the most recent user action is more recent than
that of the last push (aka the user changed something since we last
pushed) we need to push

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-17 15:21:36 -05:00
Thomas Watson
b345f75634
Upgrade Node.js from v16.18.1 to v18.13.0 (#144012)
Closes #134930

Breaking changes in Node.js majors:

- `17.0.0`:
https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V17.md#17.0.0
- `18.0.0`:
https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#18.0.0
2023-01-17 21:04:23 +01:00
Janki Salvi
ed32d89848
[Cases] add tooltip component to kbn-cases-components package (#148561)
## Summary

This PR adds a tooltip component (High OrderComponent) to
@kbn/cases-components package. #146864

**Details of tooltip**


![image](https://user-images.githubusercontent.com/117571355/211531519-55c68e15-00ce-410d-9cd5-d23d4eb45287.png)

**status: Open, tooltip position : Top**


![image](https://user-images.githubusercontent.com/117571355/211530420-d0c96461-1ce5-4344-8fcf-17907a7efe61.png)

**status: In-progress, tooltip position: bottom, long title and
description**


![image](https://user-images.githubusercontent.com/117571355/211530905-2df9b768-3181-481b-8234-43875301cbb4.png)

### Checklist

Delete any items that are not applicable to this PR.

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


### How to Test:

- run `yarn storybook cases` and test on  http://localhost:9001/

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-17 14:24:50 +01:00
Gerard Soldevila
5d33289b76
Check diffMappings after WAIT_FOR_YELLOW_SOURCE (#148980)
Fixes a bug introduced by https://github.com/elastic/kibana/pull/147371.

The goal of the aforementioned PR was to avoid reindexing if the SO
mappings didn't change.
But in that scenario we are still going to perform some operations on
the index, and thus we must await for the index to be ready (aka
`WAIT_FOR_YELLOW_SOURCE`).

This PR moves the `diffMappings` check (and the corresponding
"shortcircuit") after the `WAIT_FOR_YELLOW_SOURCE` state + operation.


![image](https://user-images.githubusercontent.com/25349407/212710909-2b479d2b-a817-4929-bf21-e760e2d3a0eb.png)
2023-01-17 12:20:56 +01:00
Coen Warmer
705ee9e66a
Add a HeaderMenuButton component which uses forwardRef (#148159)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Closes https://github.com/elastic/kibana/issues/148157
2023-01-17 03:59:46 -07:00
Tiago Costa
ebd6a4ec8e
fix(NA): @kbn/cli-dev-mode nonPackageMatcher patterns (#148971)
This PR fixes the pattern matchers for `nonPackageMatcher` into our new
watcher logic as well as correctly classifies all the files found inside
the `screenshotting plugin`
2023-01-16 16:56:36 +00:00
claracruz
930be7d6ac
[Onboarding - ECMA] Add migration link to help menu (#148447)
Fixes #147462 
Fixes #147474

- Update link to instructions for migrating to Elastic Cloud on homepage
to go directly to documentation if Stack Management page is not
available to user
- Telemetry / Platform Analytics - We need to to be able to track how
many people click the "Help me move" button from the static page.

### Telemetry
Telemetry click events added as follows:
- `migrate_data_to_cloud__migrate_data_docs_link`:  "Homepage" link
- `migrate_data_to_cloud__help_menu_link`: Help menu link
2023-01-16 13:19:15 +00:00
Lukas Olson
46a37101e2
[Filters] Add support for combined filter query DSL editing (#148590)
## Summary

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

Enables "Edit as Query DSL" for combined filters (those created with
complex AND/OR relationships).

### Checklist

- [ ]
[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
2023-01-16 02:21:24 -07:00
Stratoula Kalafateli
f129f7fe19
[Unified search] Fixes the wrong operator updates (#148802)
## Summary

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

- Fixes the bug reported on the issue (not released) and another bug
which happens when you do the opposite (from is between to is -
screenshot2)
- Not allows to add a boolean filter is value is not selected
- Default to zero when a user tries to add a phrase filter on a number
field with no value (this is how it worked on 8.6)


![bug](https://user-images.githubusercontent.com/17003240/212303868-db237f61-8ce3-423d-99b3-268496b81198.gif)

<img width="972" alt="image"
src="https://user-images.githubusercontent.com/17003240/212306049-50edde9b-e3a5-4825-a93d-65cb64ee6300.png">


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2023-01-16 10:10:42 +02:00
Tiago Costa
548da835a2
chore(NA): adds @kbn/whereis-pkg-cli to quickly find a pkg location (#148696)
This PR ads a new cli package to allow us to search for package
locations by providing their IDs. I see this as useful as we start
adding more and more packages across different locations.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-13 17:45:24 -07:00
Spencer
99013bdab8
switch out chokidar for @parcel/watcher in dev cli (#148924)
After the recent changes to limit the dev-cli watcher to relevant
packages, the watcher started logging tons of unnecessary changes, and
in some cases breaking based on the state of the repo. I have seen this
happen with Chokidar before, and I'm not convinced we'll be able to fix
it, so instead I decided to swap it out with `@parcel/watcher`, which is
a conceptually simpler implementation that automatically batches changes
and watches an entire directory, rather than tons of unique
directories/files.

This new implementation is conceptually simpler, and because of the
design of the `@parcel/watcher` module I was pushed to reuse the
`RepoSourceClassifier` to determine if we should restart the server
based on a specific change. This means we now have a single source of
truth for test files and the like (the classifier will tell us if a file
is a test file, regardless of where it exists in the repo).

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-13 16:42:13 -07:00
Dzmitry Lemechko
a94a1b620e
[performance] Disable telemetry for journey by default (#148915)
## Summary

I noticed some noise in [Performance
dashboard](dd0473ac-826f-5621-9a10-25319700326e?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-24h%2Fh,to:now)))
and think it is better to disable Telemetry for journeys by default.

We use it to report performance events and this PR enables it in the
performance pipeline via env variable `PERFORMANCE_ENABLE_TELEMETRY`.
For other pipelines (PRs,
[performance-data-set-extraction](https://buildkite.com/elastic/kibana-performance-data-set-extraction))
running on regular workers or local troubleshooting there is no much
value to collect inconsistent values.
2023-01-13 23:50:14 +01:00
Thomas Neirynck
7073b0001e
[Performance] Properly await deletion in journey (#148768)
## Summary

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

### 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
- ~~[ ] 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

- [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)
2023-01-13 16:05:09 -05:00