Commit graph

64014 commits

Author SHA1 Message Date
Saarika Bhasi
e03d901b56
[Enterprise Search][Search application]Fix Create Api key url (#159519)
## Summary

Fixes regression issue, probably created when `engines` were renamed to
`Search applications` in backend. The Create api key `POST` request was
requesting to incorrect url. Replaced with correct url in this PR.
2023-06-12 17:21:08 -04:00
Kevin Logan
662f11ee21
[Security Solution] Increase timeout for indexing hosts (#159518)
## Summary

Increase the timeout for the `indexEndpointHosts` task that was timing
out on many Defend Workflows cypress tests.


### 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-06-12 17:02:48 -04:00
Abrar Al Hasan
1349d0af86
dashboard Reset button disable (#159430)
Disables reset button on title and description when they are the same as default.
2023-06-12 16:19:51 -04:00
Kevin Logan
f4e79d69b4
[Security Solution] Unskip Endpoint API tests after package fix (#159484)
## Summary

Unskip Endpoint API tests after package fix:
https://github.com/elastic/endpoint-package/pull/373

Flaky runner to check that tests are passing:
https://ci-stats.kibana.dev/trigger_flaky_test_runner/3

resolves:
https://github.com/elastic/kibana/issues/72874
https://github.com/elastic/kibana/issues/159450
https://github.com/elastic/kibana/issues/147640

### 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-06-12 16:12:40 -04:00
Dominique Clarke
d549500d34
[Synthetics] adjust alert timing (#159511)
### Release note

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

Fixes an issue where alerting on Synthetics monitors could sometimes
become delayed.
 
## Summary
Adjust alerting timing to account for alerting framework delays.

Alert executors do not fire perfectly on the specified interval (in our
case, every 1 minute). They are typically delayed a few seconds, be can
especially delayed if the customer does not have their alerting settings
configured to scale and there is no CPU available to take on the
scheduled task.

This PR accounts for small delays in the alerting framework, by
subtracting an additional 1 minute from the `from` value for our current
status query.
2023-06-12 15:08:53 -04:00
Alexi Doak
679dc805e8
[ResponseOps][rule registry] Remove usages of refresh: true (#159252)
Resolves https://github.com/elastic/kibana/issues/158139

## Summary

Removes refresh: true from the rule registry


### 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-06-12 14:46:31 -04:00
Tiago Costa
3164006599
Revert "Remove unused package (#158597)"
This reverts commit ab29f0873c.
2023-06-12 19:06:31 +01:00
Ying Mao
6a50aaed66
[Serverless] Adding config to disable authentication on task manager background worker utilization API (#159505)
## Summary

Until [this issue](https://github.com/elastic/kibana/issues/153720) is
resolved, this config flag allows us to access the task manager
background worker utilization API in serverless to support autoscaling
of background task deployments

## To Verify

Run es: `yarn es snapshot`
Run serverless on this branch: `yarn serverless-es`

Verify you see the following warning in the logs:
```
[2023-06-12T12:47:19.641-04:00][WARN ][plugins.taskManager] Disabling authentication for background task utilization API
```

and you can access `/api/task_manager/_background_task_utilization`
without logging in
2023-06-12 13:58:25 -04:00
Robert Austin
ab29f0873c
Remove unused package (#158597)
## Summary

The [marge](https://github.com/Maciek416/marge/tree/master) package is
included in `package.json`, but it doesn't appear to be used.

note: there is a `marge` binary, but that is provided by
https://npm.io/package/@danielkalen/mochawesome-report-generator and is
unrelated.
2023-06-12 18:46:51 +01:00
Gergő Ábrahám
b9d9c8e3b5
[Fleet] Use GET /uninstall_tokens in UninstallCommandFlyout (#159350)
## Summary

> **Note**
> To test this, the feature flag `agentTamperProtectionEnabled` should
be enabled.

The Uninstall Command Flyout now uses the real `GET /uninstall_tokens`
endpoint to fetch the uninstall token for the selected policy, and
generates the uninstall commands using the token.

Also, it adds policy ID to the Uninstall Command Flyout.


![image](888ad456-5a64-4289-9626-0890436cd1ba)

Linux/Mac:

![image](3cb73629-d9e5-44cd-a337-f9842fcf1a56)

Windows:

![image](aa296f23-dd71-4b52-8428-1ef767c9ff85)

Loading state:

![image](fde52d37-98e7-44b4-bed2-7bc66656d365)

Error state:

![image](fadbbc9f-5eac-456a-9517-14dc63758c7d)

<details>
<summary>Original screenshots without showing policy ID</summary>


![image](7fd31ee0-e875-43f0-9045-7c6fcbca5257)

Linux/Mac:

![image](cf85144f-c42d-42eb-95f1-563c814cd2b1)

Windows:

![image](389eefcf-646b-4ec8-a74f-18ff6710ea6d)


Loading state:

![image](62646d7e-ec33-4ecc-a66e-44ed05102f0d)

Error state:

![image](40ffbcf4-9666-41aa-9136-55fbca309f1e)
</details>

### 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] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-12 09:54:38 -07:00
Saarika Bhasi
f18dcbb797
[Enterprise Search][Search application] Connect page use restriction and workflow to generate new API key (#159421)
## Summary

Use Workflow restriction in create new api key to support safe search endpoint
key.

~~**Pending:** Updating/ adding test case. Will add if this
implementation looks good.~~ **Done**


~~**TODO**: Create a tech debt to use client type when ready~~ Created a
Tech debt ticket
https://github.com/elastic/enterprise-search-team/issues/4779

### Screen Recording


8e6ff486-21c8-499e-a65a-02d4da192f0e
2023-06-12 12:38:14 -04:00
Philippe Oberti
ab0285f585
[Security Solution] remove history tab from expandable flyout (#159273) 2023-06-12 11:27:32 -05:00
Elena Stoeva
988b2f4bf9
[Ingest Pipelines] Add reroute processor (#159224)
Closes https://github.com/elastic/kibana/issues/157481

## Summary

This PR adds the Reroute processor in Ingest Pipelines.

<img width="718" alt="Screenshot 2023-06-07 at 16 12 02"
src="f866863c-b7d5-4eb8-a56b-fd634df5665c">

**How to test**
1. Start elasticsearch with `yarn es snapshot` and kibana with `yarn
start`.
2. Navigate to Stack Management -> Ingest Pipelines and start creating a
new pipeline.
3. Start adding a new processor of type Reroute.
4. Verify that setting the Dataset or the Namespace fields disables the
Destination field. Also, clearing up the Dataset and the Namespace
fields should reenable the Destination Field.
5. Save the processor with the following parameters:
dataset: `nginx`
namespace: `default`
6. Click "Show request" and verify that the request is correct.
7. Click "Test pipeline" and add the following document:
```
[
  {
    "_index": "type-dataset-namespace",
    "_id": "id",
    "_source": {
      "foo": "bar"
    }
  }
]
```
8. Verify the output:
```
{
  "docs": [
    {
      "doc": {
        "_index": "type-nginx-default",
        "_id": "id",
        "_version": "-3",
        "_source": {
          "data_stream": {
            "namespace": "default",
            "type": "type",
            "dataset": "nginx"
          },
          "foo": "bar"
        },
        "_ingest": {
          "timestamp": "2023-06-07T15:18:33.59474Z"
        }
      }
    }
  ]
}
```
9. Edit the processor and, this time, clear up the Dataset and Namespace
fields and set the Destination field to `test-destination`.
10. Verify the request.
11. Test the pipeline:
```
[
  {
    "_index": "type-dataset-namespace",
    "_id": "id",
    "_source": {
      "foo": "bar"
    }
  }
]
```
Should produce:
```
{
  "docs": [
    {
      "doc": {
        "_index": "test-destination",
        "_id": "id",
        "_version": "-3",
        "_source": {
          "foo": "bar"
        },
        "_ingest": {
          "timestamp": "2023-06-07T15:24:34.233092Z"
        }
      }
    }
  ]
}
```


### 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] [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/))
- [x] 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))
- [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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-12 17:25:02 +01:00
Gloria Hornero
0565bc9788
[Security Solution] [Serverless] Initial setup for security serverless Cypress (#158707) 2023-06-12 09:21:23 -07:00
Efe Gürkan YALAMAN
ebcfebed05
[Enterprise Search] [Document Level Security] Access Control sync history (#159461)
## Summary

- Adds Access Control sync to the index overview page.
- Adds table switcher and changes table columns.

Content related syncs
![Screenshot 2023-06-12 at 14 49
10](2d4d5c44-2648-4d1d-ba86-aff38aae17fb)

Access control syncs
![Screenshot 2023-06-12 at 14 49
14](0ab11462-cecb-4099-955d-4f2f6d02197a)

When access control not enabled
![Screenshot 2023-06-12 at 14 54
11](e93430a4-d02a-46dc-b212-1ec1158fb7b8)


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

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-12 08:45:02 -07:00
Nathan Reese
e8e5cec83d
legacy agg vis tag cloud convert to lens (#159348)
Part of https://github.com/elastic/kibana/issues/154307

Add convert to lens logic for tag cloud visualization

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-06-12 09:32:41 -06:00
Yngrid Coello
5fd356a3d7
[Logs onboarding] Added give feedback button (#159455)
Relates to https://github.com/elastic/kibana/issues/158843.

This PR adds `Give feedback` button on top of observability onboarding
pages.

<img width="1771" alt="image"
src="88e39ae7-c9dc-4226-bb61-a011c2b2c831">
2023-06-12 17:25:27 +02:00
Patryk Kopyciński
daf81aae39
Refactor react-tiny-virtual-list (#159023)
## Summary

`react-tiny-virtual-list ` wasn't updated for over 5 years 🤯
2023-06-12 17:20:16 +02:00
Jordan
015ae200e2
[Cloud Security] CNVM dashboard statistics (#158652) 2023-06-12 08:10:15 -07:00
Giorgos Bamparopoulos
e0b8304c8a
[APM] New feedback experience in APM Labs (#159409)
- Removes the feedback links from the advanced settings
- Adds feedback button to the labs flyout
- Updates the description of
`observability:enableInfrastructureHostsView` as it's not in Beta.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Yngrid Coello <yngrid.coello@elastic.co>
2023-06-12 16:09:09 +01:00
Antonio
80afba1d4e
[Cases] Add category field to mapping (#159205)
Fixes #159116

## Summary

- Add the new `category` field to cases.
- Update the types to take `category` into account.
- Update `transforms` to return a default value for `category`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-12 16:52:43 +02:00
Rodney Norris
babaec8c8b
[Enterprise Search] refactor: rename engines to search applications (#159400)
## Summary

Updated the enterprise search plugin server code to replace usage of
"engine" to search application.
2023-06-12 09:50:42 -05:00
Thomas Watson
70472fd42a
[docs] improve external plugin documentation (#159431)
Co-authored-by: James Rodewig <james.rodewig@elastic.co>
2023-06-12 09:09:02 -04:00
Jonathan Budzenski
1e8145c925 skip failing test suite (#159450) 2023-06-12 08:07:54 -05:00
Carlos Crespo
bcc4f11e0b
[Infrastructure UI] Filter control re-rendering problem fix (#159320)
fixes https://github.com/elastic/kibana/issues/159317 

## Summary

This PR fixes a problem in the utilization of the `ControlGroupRenderer`
component in the Hosts View. The problem originated from the need to
manually compare changes in the `filterPanel` object, to prevent the
page from making duplicate requests


b38f5691-0519-4ae2-aab2-daaf0f72cd0d

After many changes that the code has been through, the comparison
mentioned above has become unnecessary.



### How to test

- Start a local Kibana instance
- Navigate to `Infrastructure > Hosts`
- Play with the filter controls (depending on how fast the user is, it
might hang for a little while, but this won't slow the whole page down)
2023-06-12 14:30:23 +02:00
Kibana Machine
0a1ed74ba4 skip failing test suite (#147640) 2023-06-12 08:22:40 -04:00
Jonathan Budzenski
05f556b162 skip failing suite (#72874) 2023-06-12 07:17:39 -05:00
Dario Gieselaar
e5db0db9b7
[APM] Add dev docs for Tilt (#159287) 2023-06-12 12:52:56 +02:00
Achyut Jhunjhunwala
b9a8655e98
Update testing document to expose times field (#159447)
## Summary

Update testing documentation to expose `times` field required to run
tests to check for flakiness
2023-06-12 11:23:13 +01:00
Julian Gernun
55bc8cf567
[RO] Incorrect Deletion of Webhook Actions in Kibana Rules (#159204)
## Summary

Fixes #158167

The issue occurred because we were using a number called "index" as the
React key prop. When we removed the first element, the second one took
its place, but React still showed the removed element.

To fix this problem, we found a solution by using the uuid field that
each action item has. We now generate it for each new action we create
in the action form and use that as key

I was told to add @pmuellr as you might know if we are missing something
🙇

### Test: why xpath selector?

I had to use the xpath selector to fix a problem we had. The problem was
between two actions we set up. They look the same, but the body content
is the only different (I've attached a screenshot for more details).

We use a third party component for these actions. This component doesn't
have any "value" attribute and doesn't add anything besides the HTML
text. I tried to find other useful details but couldn't find any.

The problem comes up when we try to delete one of the actions. To fix
it, we needed to check if that component was missing. We already have
tools that can look for missing components, but they don't work with the
xpath selector. So, I added a new function that can do this. Now, we can
use the xpath selector to look for missing components and fix the
problem
 
<details>
<summary>See Screenshot</summary>
<img
src="5447795d-0281-4847-aa85-76d0e5fdec3d"/>
</details>

```[tasklist]
- [x] Make sure that it's ok to generate the uuid
- [x] Test
- [x] Do we need to backport? Versions?
```
2023-06-12 10:19:20 +02:00
Pierre Gayvallet
b08c322524
Allow exporting all SO types (#159289)
## Summary

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

Add support for the `*` wildcard for by-type export, allowing to more
easily export all the exportable SO types

```
POST /api/saved_objects/_export
{
   types: '*',
}
```

## Release Note

The savedObjects export API now supports exporting all types using the
`*` wildcard. Please refer to the documentation
for more details and examples.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-12 00:03:54 -07:00
Robert Austin
da1a7a38d4
[Security] Fix Cypress e2e in flaky test runner (#159297)
# Prevent Security Solution Cypress tests from parallelizing when run by
the flaky test runner

In pull request and other pipelines, the Cypress security solution
runner is expected to support parallel jobs runs. Several jobs are
spawned with the same command, but with different environment variables.
Each jobs runs a subset of the tests based on the environment variables.
These variables are BUILDKITE_PARALLEL_JOB_COUNT and
BUILDKITE_PARALLEL_JOB.

The Flaky Test Runner is an app that runs many instances of the same
config concurrently in order to determine if any of the tests in the
config are flaky. When the Flaky Test Runner runs our cypress tests,
each job should run all tests instead of a subset.

The flaky test runner sets the following environment variables to
prevent jobs from running a subset of tests:

```
 // by setting chunks vars to value 1, which means all test will run in one job
 CLI_NUMBER: 1,
 CLI_COUNT: 1,
```

These environment variables aren't respected by the Security Solution
Cypress tests. This is also true for other Cypress tests that use the
same code:
* cypress/security_solution_investigations
* cypress/osquery_cypress

This PR introduces a new environment variable: RUN_ALL_TESTS, which
explicitly tells the runner to run all tests instead of a subset. This
causes the runner to ignore BUILDKITE_PARALLEL_JOB_COUNT and
BUILDKITE_PARALLEL_JOB

### Note about other cypress tests
This environment variable will be passed to other Cypress runners that
aren't used or maintained by Security. Specifically:

* cypress/fleet_cypress
* cypress/apm_cypress

Fleet does not appear to support parallelism, while APM does. In the APM
script, a IS_FLAKY_TEST_RUNNER environment variable is created by
reading CLI_COUNT:


09902b1055/.buildkite/scripts/steps/functional/apm_cypress.sh (L13)

```
IS_FLAKY_TEST_RUNNER=${CLI_COUNT:-0}
```

The CLI_COUNT variable isnt affected by this PR, so this should still
work, but it would be possible to use the same variable for both
scripts.

### Other Ways we could do this

We could also modify the our cypress runner to respect CLI_COUNT and
CLI_NUMBER instead of the buildkite parameters. We cannot override the
buildkite parameters via the step definition as that is not supported.


### Validation

When running our Cypress tests via the test runner, it may not be
immediately apparent that there is an issue.

This PR is equivalent to main except a change to a README:
https://github.com/elastic/kibana/pull/159301

Here is a flaky test runner build using that PR. It runs 25 jobs of the
Investigation cypress e2e tests:

https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2368

Each job should run the same tests (so we can check if they are flaky.)
However job 1 runs these:
* alert_table_action_column.cy.ts
* alerts_cell_actions.cy.ts  

<img width="747" alt="image"
src="2090cf9b-0a88-4b28-b7fa-13ce77aa26a3">

And job 2 runs these:

* building_block_alerts.cy.ts   

<img width="733" alt="image"
src="bc2f672f-ac48-4f8f-8b8b-0997c2aff874">

#### With the fix
Here is a flaky test runner build, also 25 jobs of the Investigation
cypress e2e tests, but using this PR:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2369

We have some failing tests, as our suite is currently flaky, however you
can see that each job runs all of the tests.

### 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>
2023-06-12 08:36:42 +02:00
Stratoula Kalafateli
7634fddf29
[Unified search] Fixes the wrap problem on the filter selection modal (#159376)
## Summary

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

Fixes the wrap problem in filter selection modal when the text
field/value is very long

<img width="956" alt="image"
src="beda8e16-6302-4d7e-aa84-0b6884891ccc">
2023-06-12 09:00:15 +03:00
Kibana Machine
f27f25bb9c
[api-docs] 2023-06-12 Daily api_docs build (#159440)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/366
2023-06-12 00:50:33 -04:00
Kibana Machine
8f3c19ca7e
[api-docs] 2023-06-11 Daily api_docs build (#159435)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/365
2023-06-11 00:59:49 -04:00
Kibana Machine
df189fb925
[api-docs] 2023-06-10 Daily api_docs build (#159429)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/364
2023-06-10 01:01:50 -04:00
Philippe Oberti
d5c429e836
[Security Solution] enabling all expanded flyout Cypress tests (#158979) 2023-06-09 20:32:05 -05:00
Tiago Costa
126fbbd7b7
skip flaky suite (#159283) 2023-06-09 23:07:23 +01:00
Melissa Alvarez
f2da36215c
[Maps][ML] Add hyperlink to anomaly explorer for job from anomaly layer in maps (#159268)
## Summary

Related issue: https://github.com/elastic/kibana/issues/148665

This PR adds a link to the anomaly explorer for the job corresponding to
the anomalies layer in maps. The link is found under 'Source details'
once the anomalies layer is created.

<img width="1291" alt="image"
src="f109ce21-1aec-40c4-8cf1-fc3dedaef199">

## NOTE

This is dependent on the changes in maps
https://github.com/elastic/kibana/pull/159255

### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-09 14:31:28 -06:00
Hannah Mudge
11c761f4d9
[Dashboard] [Controls] Fix dashboard reset when initial state has no controls (#159404)
## Summary

Consider taking the following steps:

1. Create a new dashboard and save it
2. Add a control and, without saving,
3. Reset the changes to the dashboard

### Before 
Before this PR, we were not updating the control group input if the
`lastSavedControlGroupInput` was `undefined` (which only happens when a
dashboard has **never** been saved with any controls and/or edits to the
control group settings) - this caused a problem when trying to reset a
dashboard from having controls back to the state where
`lastSavedControlGroupInput` was `undefined` because the **dashboard's**
input would get updated as expected (i.e. the dashboard would think it
no longer has any controls), but the control group's input wouldn't get
updated (i.e. the control group would think it **still has** controls).

Because of this discrepancy, the control would stick around until you
refreshed the dashboard:


c9da58dc-3373-493d-9bba-5d2540c19560

### After
Now, after this PR, I fixed this by resetting back to the default
control group input if `lastSavedControlGroupInput` is `undefined` on
reset:


e41838e6-6dbe-47a1-bea7-28f20eddcf80


### Checklist

- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-06-09 13:19:37 -07:00
Devon Thomson
b6f9825253
[Dashboard] Content Management onboard (#158761)
Onboard Dashboard onto Content Management.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-09 16:03:23 -04:00
Yara Tercero
f895c5c205
[Detection Engine][Exceptions] - Fix exception item update route (#159223)
## Summary

Addresses issue 159230
2023-06-09 12:31:03 -07:00
Jon
e82005e0d6
[ci/on-merge-unsupported-ftrs] Reuse the on-merge build (#159162)
Passing `KIBANA_BUILD_ID` to a triggered pipeline will let us reuse the
Kibana distribution from the parent pipeline, instead of requiring a
distribution rebuild. This will also be useful for triggering the
serverless tests in a separate pipeine.

Before:
https://buildkite.com/elastic/kibana-on-merge-unsupported-ftrs/builds/2899
After:
https://buildkite.com/elastic/kibana-on-merge-unsupported-ftrs/builds/2900

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-09 13:52:31 -05:00
Paul Tavares
28566aa8ee
[Fleet] Adds index name patterns for files being delivered to Host/Agents (#158773)
## Summary

- Adds `const`'s for index patterns for files that are delivered to
hosts/agents
- modifies `createFilesClient.toHost()` (exposed in `Plugin.start()`) to
use these new index names
- Adds code to the package install flow to ensure new file delivery
indexes are created
- The files client factory now validates if the integration name is
allowed to use fleet files functionality.


FYI: PR that will add index mappings to ES:
https://github.com/elastic/elasticsearch/pull/96504
2023-06-09 14:21:17 -04:00
Yngrid Coello
4bc5e6cacc
[Logs Onboarding] API key generation states (#159207)
closes #158567.

## Summary
This PR introduces APIKey generation states.

### Changes
- Route `POST
/internal/observability_onboarding/custom_logs/install_shipper_setup`
was split into `GET
/internal/observability_onboarding/custom_logs/install_shipper_setup`
which is now in charge of determining current setup (kibana urls, es
url) and `POST /internal/observability_onboarding/custom_logs/save` is
now in charge of generating the apiKey and save the flow state.
- Dedicated component `ApiKeyBanner` to handle the different states of
the apiKey generation.

### Screenshots

- when ApiKey is being generated, notice the placeholder `$API_KEY` in
script and yaml config
<img width="1120" alt="Screenshot 2023-06-07 at 15 16 03"
src="dbfd4b34-6e2a-4424-91a9-01417451b006">

- when ApiKey has been successfully generated, notice the returned
apiKey in script and yaml config
<img width="1120" alt="Screenshot 2023-06-07 at 15 15 01"
src="def414d1-6938-44f6-b38c-748fb2084f41">

- when an error occurred while generating the ApiKey, notice the
placeholder `$API_KEY` in script and yaml config
<img width="1120" alt="Screenshot 2023-06-07 at 15 13 21"
src="a43e9379-2140-4679-8c37-d91cc7a7155f">

- when user doesn't have required permissions to generate the ApiKey,
notice the placeholder `$API_KEY` in script and yaml config
<img width="1120" alt="Screenshot 2023-06-07 at 15 11 12"
src="75b367c1-295a-41d6-afe1-4e94bd28aafc">
2023-06-09 18:57:12 +02:00
Christos Nasikas
d2f00a1381
[Cases] Mark lens migrations as deferred (#159291)
## Summary

In Cases, users can add lens visualizations in a case. The lens's
attributes persist inside the `cases-comments` saved object. If the lens
team adds a migration a migration will run for the `cases-comments` SOs
to migrate any lens visualization inside the case comment. In this PR we
defer the lens migrations to be done on read when it is fetched by
users. This way, the cases comments will not be migrated at Kibana
startup.

Blocker for https://github.com/elastic/kibana/pull/158468

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

### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-09 09:51:18 -07:00
Quynh Nguyen (Quinn)
f7bd72ffd9
[ML] Switch from new Code Editor in File upload (#159243)
## Summary

This PR updates the EuiCodeEditor to the new Monaco-based CodeEditor
component.

The Monaco-based editor more features, including JSON schemas support,
and is widely used in other parts of Kibana and the ML advanced job
wizard.


0c957db4-a4da-4097-9140-b060d41df719

Resizing:


4605b450-8cea-4519-bfc8-d4b00d27857e

Dark theme
<img width="1792" alt="Screen Shot 2023-06-07 at 12 13 41"
src="6141eb7b-d19c-47d5-bb7a-f8df661862a5">




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

Fixes #155843

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-09 09:27:39 -07:00
Faisal Kanout
2d4f19e2ac
[AO] Create a new rule under Observability plugin based on the metrics threshold rule (#158665)
## Summary
### NOTE: This is a draft PR to MVP the new rule combination
(Threshold). More PRs to follow up
It fixes https://github.com/elastic/kibana/issues/158260 by providing
the _new_ **Threshold rule**
It fixes https://github.com/elastic/kibana/issues/159326

<img width="586" alt="Screenshot 2023-05-30 at 17 55 32"
src="0e485266-d93f-442e-81f4-77aa673ed497">


##  Done 

- [x] Clone the Metric threshold and update the imports 
- [x] The rule is listed in the rule creation flyout with its params and
preview charts
- [x] Working Rule registry
- [x] Working Rule executor 
- [x] Working feature id in the rule registry 
- [x] Working alerts table and alert summary
- [x] Use DataView instead of the Metrics indices under settings
- [x] Update the i18n keys 
- [x] Fix/Update failing checks/tests. Green CI  
- [x] Hide it behind a feature flag
`xpack.observability.unsafe.thresholdRule.enabled`




## 🏗️ To be done (could be irrelevant, or create a separate issue for
it):
- [ ] <del> Remove the `metrics` word </del>
- [ ] <del> Update file and variable names to match the new rule
context.</del>
- [ ] <del> Rearrange files, constants, and exports </del>

## 🎯 DoD 
Having the rule working like the Metric threshold one and seeing its
related alerts.

---------
2023-06-09 17:59:55 +02:00
Marco Liberati
e325d4102b
[Lens] Add feature to ignore global filters at layer level (#159248)
## Summary

Fixes #143493

* Add the switch control in Layer Settings
  * [x] Make sure it does not duplicate on Annotation Layer Settings 
  * [x] Data Layers
  * [x] Reference line layers
  * [x] Extended dataView picker to support multiple icons
    * [x] Added unit tests 
  * [x] Functional tests

<img width="351" alt="Screenshot 2023-06-07 at 15 28 19"
src="00dc5523-0bec-4e9c-b1d0-4d36804b29f9">
<img width="340" alt="Screenshot 2023-06-07 at 15 31 31"
src="d36ca147-5d8c-4123-9be3-2932844cbd15">
<img width="331" alt="Screenshot 2023-06-07 at 15 28 25"
src="c7d4f166-b8ab-4439-a83c-debf82b913ad">
<img width="324" alt="Screenshot 2023-06-07 at 15 27 59"
src="3738a7e0-6e49-4e22-b857-965a953b4b84">
<img width="323" alt="Screenshot 2023-06-07 at 15 27 53"
src="5965bf1c-0e25-4c0e-b54f-fa315157fd44">


*  Create `IgnoreGlobalFilter` shared component folder
   * [x] Layer setting control component
   * [x] Info badge component
   
 * Extends `esaggs_fn` to support the flag
   * [x] Avoid to pass the filter to the handler if set
   * [x] Add unit tests

* Notification badges
* [x] Extends the badge component in Embeddable to support grouped
messages
    * [x] Added unit tests
  
<img width="750" alt="Screenshot 2023-06-07 at 15 31 39"
src="01bf8203-9133-4429-9b79-17ec67613c7e">
<img width="828" alt="Screenshot 2023-06-07 at 15 30 57"
src="9acb78f2-d061-4225-a4af-b3a66e7454fc">
<img width="756" alt="Screenshot 2023-06-07 at 15 27 43"
src="b9f79aed-7c02-4060-9c0f-61f438dc031d">


* Add support for Open in Lens
  * [x] Add unit tests for each converter
  * [x] Functional tests


### 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] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-06-09 17:55:47 +02:00
Lisa Cawley
b6a2611361
[DOCS] Conditional actions in rule open API specifications (#157951) 2023-06-09 08:33:43 -07:00