Commit graph

47854 commits

Author SHA1 Message Date
Lisa Cawley 05367cbea4
Fixes client URLs in doc link service (#116525) 2021-10-28 12:07:37 -07:00
Frank Hassanabad 2add12fa65
[Security Solutions] Adds bsearch service to FTR e2e tests to reduce flake, boilerplate, and technique choices (#116211) (#116514)
## Summary

Fixes flake tests of:
https://github.com/elastic/kibana/issues/115918
https://github.com/elastic/kibana/issues/103273
https://github.com/elastic/kibana/issues/108640
https://github.com/elastic/kibana/issues/109447
https://github.com/elastic/kibana/issues/100630
https://github.com/elastic/kibana/issues/94535
https://github.com/elastic/kibana/issues/104260

Security solution has been using `bsearch` and has encountered flake in various forms. Different developers have been fixing the flake in a few odd ways (myself included) which aren't 100%. This PR introduces a once-in-for-all REST API retry service called `bsearch` which will query `bsearch` and if `bsearch` is not completed because of async occurring due to slower CI runtimes it will continuously call into the `bsearch` with the correct API to ensure it gets a complete response before returning.


## Usage

Anyone can use this service like so:
```ts
const bsearch = getService('bsearch');
const response = await bsearch.send<MyType>({
 supertest,
 options: {
   defaultIndex: ['large_volume_dns_data'],
}
  strategy: 'securitySolutionSearchStrategy',
});
```

If you're using a custom auth then you can set that beforehand like so:
```ts
const bsearch = getService('bsearch');
const supertestWithoutAuth = getService('supertestWithoutAuth');
const supertest supertestWithoutAuth.auth(username, password);
const response = await bsearch.send<MyType>({
 supertest,
 options: {
   defaultIndex: ['large_volume_dns_data'],
  }
  strategy: 'securitySolutionSearchStrategy',
});
```

## Misconceptions in the tests leading to flake
* Can you just call the bsearch REST API and it will always return data first time? Not always true, as when CI slows down or data increases `bsearch` will give you back an async reference and then your test will blow up.
* Can we wrap the REST API in `retry` to fix the flake? Not always but mostly true, as when CI slows down or data increases `bsearch` could return the async version continuously which could then fail your test. It's also tedious to tell everyone in code reviews to wrap everything in `retry` instead of just fixing it with a service as well as inform new people why we are constantly wrapping these tests in `retry`.
* Can we manually parse the `bsearch` if it has `async` for each test? This is true but is error prone and I did this for one test and it's ugly and I had issues as I have to wrap 2 things in `retry` and test several conditions. Also it's harder for people to read the tests rather than just reading there is a service call. Also people in code reviews missed where I had bugs with it. Also lots of boiler plate.
* Can we just increase the timeout with `wait_for_completion_timeout` and the tests will pass for sure then? Not true today but maybe true later, as this hasn't been added as plumbing yet. See this [open ticket](https://github.com/elastic/kibana/issues/107241). Even if it is and we increase the timeout to a very large number bsearch might return with an `async` or you might want to test the `async` path. Either way, if/when we add the ability we can increase it within 1 spot which is this service for everyone rather than going to each individual test to add it. If/when it's added if people don't use the bsearch service we can remove it later if we find this is deterministic enough and no one wants to test bsearch features with their strategies down the road.

## Manual test of bsearch service
If you want to manually watch the bsearch operate as if the CI system is running slow or to cause an `async` manually you manually modify this setting here:
https://github.com/elastic/kibana/blob/master/src/plugins/data/server/search/strategies/ese_search/request_utils.ts#L61

To be of a lower number such as `1ms` and then you will see it enter the `async` code within `bsearch` consistently

## Reference PRs
We cannot set the wait_for_complete just yet
https://github.com/elastic/kibana/issues/107241 so we decided this was the best way to reduce flake for testing for now. 

### 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>
2021-10-28 12:09:42 -06:00
Kibana Machine 649f467aa3
Unskips tests and fixes a few of them. (#116469) (#116551)
## Summary

* For the test of `create_endpoint_exceptions.ts` code was changed to try to reduce/remove flake. I put the code back to where it was and with the sorting introduced it all should pass
* Added `await waitForSignalsToBePresent(supertest, 1, [id]);` to areas of code that were missing.
* The `.flat` should be an added layer of protection for flakes.


### 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: Frank Hassanabad <frank.hassanabad@elastic.co>
2021-10-28 12:09:30 -06:00
Kibana Machine a4e92ad770
[Security Solutions] Adds console logging and relaxes the 200 checks in a 2 areas of the e2e tests (#116548) (#116629)
## Summary

Adds console logging and relaxes a few 200 checks in the end to end tests in two areas of:
* createExceptionListItem
* importFile

As recently the tests are failing around these parts and possibly we can get information on the next failures if it is from these two areas or if it's from somewhere else we are not expecting.

Also outputs the body message so if it fails in these areas we can see the message with the conflict that might help us see where the issue is arising.

### 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: Frank Hassanabad <frank.hassanabad@elastic.co>
2021-10-28 12:09:09 -06:00
Jonathan Budzenski 9e2bda7450 skip failing suite. #116522 2021-10-28 12:16:07 -05:00
Jonathan Budzenski 714b007247 skip failing suite. #102283 2021-10-28 12:13:18 -05:00
Jonathan Budzenski 234692fa51 skip failing suite. #116510 2021-10-28 12:08:41 -05:00
Kibana Machine b27ef965b4
[SECURITY] Remove flaky test on edit user page (#116467) (#116672)
* no more flaky test

* fix eslint

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
2021-10-28 12:32:50 -04:00
Gloria Hornero 3e388b42c9
skips exceptions tests (#116568) (#116614) 2021-10-28 14:53:44 +02:00
spalger 68be5c2e6d skip flaky suite (#89369)
(cherry picked from commit acf0426194)
2021-10-28 09:19:47 +00:00
Jonathan Budzenski c4dd10165f
[8.0] Remove .github folder (#116550)
This is only used on main
2021-10-27 21:15:08 -07:00
Jonathan Budzenski b30e126e76
[8.0] Remove renovate.json5 (#116549) 2021-10-27 21:37:50 -05:00
Tiago Costa 5cec00ed91
skip flaky suite (#116059) 2021-10-28 03:14:38 +01:00
Tyler Smalley 8f11ce8c7c Remove CODEOWNERS
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-10-27 15:58:20 -07:00
Kibana Machine e25d8a403e
[8.0] [ci] bump timeout for cigroups until we figure out the slowdown (#116506) (#116507)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Spencer <email@spalger.com>
2021-10-27 17:08:20 -05:00
spalger 94ac24692f skip failing suite (#72874)
(cherry picked from commit 83288af8bd)
2021-10-27 21:36:46 +00:00
Kibana Machine ea5d0de514
chore(NA): adds backport config for 8.1.0 bump (#116431) (#116498)
Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
2021-10-27 21:35:52 +01:00
Tiago Costa 8ef85def71
chore(NA): change branch from master to 8.0 2021-10-27 21:23:54 +01:00
Byron Hulcher c3f207a071
Revert "[App Search] Load curation settings at root /curations/ path (#115690)" (#116462) 2021-10-27 21:18:19 +01:00
Gloria Hornero 136d322bdd
adds lists plugin to security solution cypress tests execution (#116442) 2021-10-27 20:55:55 +01:00
Kaarina Tungseth bd2a7cefa5
[DOCS] Fixes monitoring setting (#116309) 2021-10-27 13:42:11 -05:00
Tyler Smalley 017fcac4b9
Removes functional tests using freeze API (#116373)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-10-27 10:53:07 -07:00
Nick Partridge 6b4d9dd1a9
[Charts] Multi-layer time axis (#115853)
This commit introduces the multi-layer time axis in Discover, Lens, Visualize, TSVB.
It adds visualization:useLegacyTimeAxis advanced settings under charts plugin to toggle legacy time axis.

The new multi-layer time axis is introduced in @elastic/charts https://elastic.github.io/elastic-charts/?path=/story/area-chart--timeslip and was demoed as part of the Kibana Demo Days.

It is the outcome of the research done in elastic/elastic-charts#1310 related to improving the time axis solving the following problems:
- sparse time labels that can be far apart
- unclear where time point is on the label (the middle)
- difficult / tedious to read due to redundant information and small fonts
- resolution is not explicit (is it hours of days or days themselves)
2021-10-27 19:22:35 +02:00
Rudolf Meijering e0fe09607f
Unskip migrations actions integration tests (#116285) 2021-10-27 19:11:08 +02:00
spalger d6f9adf73a skip flaky suite (#116463) 2021-10-27 16:29:41 +00:00
Luke Elmers 4be1d8f438
[docs] Re-add experimental label to dashboard import/export API docs. (#116348) 2021-10-27 08:46:53 -06:00
Gloria Hornero 9330ea7d97
[Security Solution] Skips EQL test (#116456) 2021-10-27 09:44:03 -05:00
Gloria Hornero 6fbda831b5
unskips exceptions tests (#116149) 2021-10-27 10:04:28 -04:00
Tiago Costa bed54a9d45
skip flaky suite (#109943) 2021-10-27 14:43:03 +01:00
Tiago Costa 76e65967fc
skip flaky suite (#116414) 2021-10-27 14:27:59 +01:00
Felix Stürmer 34b22578d6
[Logs UI] [Metrics UI] Remove deprecated alias config entries (#115974)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-27 15:20:19 +02:00
Paul Tavares c566e048e8
make EndpointPrivileges object immutable (#116299) 2021-10-27 09:07:19 -04:00
Paul Tavares 8998655fcb
Fix driver to the policy details loading state (#116208) 2021-10-27 09:05:40 -04:00
Byron Hulcher 0381326ede
Retrieve search results on Relevance Tuning page whenever precision or query is changed (#116316) 2021-10-27 08:52:14 -04:00
Nathan Reese 3b3c4b2f4a
[maps] Use desaturated map tiles instead of bright map tiles by default (#116179)
* [maps] default to desaturated tiles in light mode

* fix jest and functional tests

* eslint

* update migrations version expect

* review feedback

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-27 06:34:07 -06:00
Dima Arnautov 37632f1798
[ML] Nodes overview for the Model Management page (#116361)
* [ML] Nodes overview for the Model Management page  (#115772)

* [ML] trained models tab

* [ML] wip nodes list

* [ML] add types

* [ML] add types

* [ML] node expanded row

* [ML] wip show memory usage

* [ML] refactor, use model_memory_limit for dfa jobs

* [ML] fix refresh button

* [ML] add process memory overhead

* [ML] trained models memory overview

* [ML] add jvm size, remove node props from the response

* [ML] fix tab name

* [ML] custom colors for the bar chart

* [ML] sub jvm size

* [ML] updates for the model list

* [ML] apply native process overhead

* [ML]add adjusted_total_in_bytes

* [ML] start and stop deployment

* [ML] fix default sorting

* [ML] fix types issues

* [ML] fix const

* [ML] remove unused i18n strings

* [ML] fix lint

* [ML] extra custom URLs test

* [ML] update tests for model provider

* [ML] add node routing state info

* [ML] fix functional tests

* [ML] update for es response

* [ML] GetTrainedModelDeploymentStats

* [ML] add deployment stats

* [ML] add spacer

* [ML] disable stop allocation for models with pipelines

* [ML] fix type

* [ML] add beta label

* [ML] move beta label

* [ML] rename model_size prop

* [ML] update tooltip header

* [ML] update text

* [ML] remove ts ignore

* [ML] update types

* remove commented code

* replace toast notification service

* remove ts-ignore

* remove empty panel

* add comments, update test subjects

* fix ts error

* update comment

* fix applying memory overhead

* Revert "fix applying memory overhead"

This reverts commit 0cf38fbead.

* fix type, remove ts-ignore

* add todo comment

(cherry picked from commit 605e9e2d3d)

* updates for the latest elasticsearch client

* hide allocated models when missing

* [ML] Update jest test mock

Co-authored-by: Quynh Nguyen <quynh.nguyen@elastic.co>
2021-10-27 11:29:57 +02:00
Shahzad 98231f45ac
[Uptime] Uptime index config using kibana.yml (#115775)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-27 10:15:21 +02:00
Devon Thomson 0b2dcdf408
[Controls] Dashboard Integration (#115991)
Create filters when controls change. Integrated controls on dashboard behind lab
2021-10-27 03:55:55 -04:00
Tyler Smalley 910a5cae5f skip flaky suite (#104260) 2021-10-26 22:30:55 -07:00
Chenhui Wang 306a7cb0f4
Include Files in GitHub UI (#115956) 2021-10-27 12:16:05 +08:00
Tyler Smalley 4b25b00fde skip flaky suite (#116060) 2021-10-26 18:00:25 -07:00
Catherine Liu bacd7f91dd
[Canvas] By-Value Embeddables (#113827)
* [Canvas] Generic embeddable function (#104499)

* Created generic embeddable function

    Fixed telemetry

    Updates expression on input change

    Fixed ts errors

Store embeddable input to expression

Added lib functions

Added comments

Fixed type errors

Fixed ts errors

Clean up

Removed extraneous import

Added context type to embeddable function def

Fix import

Update encode/decode fns

Moved embeddable data url lib file

Added embeddable test

Updated comment

* Fix reference extract/inject in embeddable fn

* Simplify embeddable toExpression

* Moved labsService to flyout.tsx

* Added comment

* [Canvas] Adds Save and Return Workflow (#111411)

* [Canvas] Adds editor menu to Canvas (#113194)

* Merge existing embeddable input with incoming embeddable input (#116026)

* [Canvas] Extract and inject references for by-value embeddables (#115124)

* Extract/inject references for by-value embeddables in embeddable function

Fixed server interpreter setup

Register external functions in canvas_plugin_src plugin def

* Fixed ref name in embeddable.inject

* Fixed ts errors

* Fix missing type error

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-26 17:25:06 -07:00
Tyler Smalley 01292cec67 Skip failing test (#115366)
https://github.com/elastic/kibana/issues/115366

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-10-26 17:23:24 -07:00
Patryk Kopyciński 82caede4fa
[Osquery] Fix live query search doesn't return relevant results for agents (#116332) 2021-10-27 01:04:26 +01:00
Caroline Horn 5666bd79fd
[Integrations] Added link in old Add Data description and fixed alignment in cards (#116213) 2021-10-26 19:46:51 -04:00
Yuliia Naumenko fac628623e
[Actions] Extended ActionTypeRegistry with connector validation to validate config with secrets (#116079)
* [Actions] Extended ActionTypeRegistry with connector validation to validate config with secrets

* fixed typecheck

* added tests

* more tests

* email validation fix

* fixed typecheck

* fixed typecheck

* added tests

* fixed typecheck

* fixed test

* fixed due to comments

* fixed test

* fixed test

* fixed typecheck
2021-10-26 16:06:05 -07:00
Tiago Costa ebcc0070ba skip flaky suite (#109329)
(cherry picked from commit 21973b58a8)
2021-10-26 22:23:06 +00:00
Xavier Mouligneau 852a728229
Grant access to machine learning features when base privileges are used (#115444) 2021-10-26 18:15:44 -04:00
Tyler Smalley 1827cf2479 Skipping failing test (#84957)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-10-26 13:58:13 -07:00
Madison Caldwell 117efdf87f
[RAC][Security Solution] Adds migration to new SecuritySolution rule types (#112113)
* Initial commit

* Properly handle signal history

* Fix #95258 - cardinality sort bug

* Init threshold rule

* Create working threshold rule

* Fix threshold signal generation

* Fix tests

* Update mappings

* ALERT_TYPE_ID => RULE_TYPE_ID

* Add tests

* Fix types

* Adds RAC rule type migration

* Fix threshold tests (remove outputIndex)

* Add threshold rule type to ruleTypeMappings

* Add kbn-securitysolution-rules package for sharing with alerting framework

* Fix type errors

* Fix find_rules tests

* First round of test fixes

* Fix issues from merge conflicts

* Use ruleDataClient getReader() for reading

* Fixes to 'generating_signals' tests

* Remove more refs to legacy schema

* Linting

* Quick type fix

* Bug fixes

* Add saved query rule type

* Linting

* Fix types

* Signal generation tests

* Test updates

* Update some more refs

* build_alert tests

* Cleanup

* Ref updates

* Revert "Ref updates"

This reverts commit 4d1473d6b0.

* Update status field

* Test fixes

* Another test

* Got a little too aggressive with search/replace

* let's see where we're at

* Fix

* Test fixes

* cleanup

* Fix cases API integration test config, flaky DE tests

* Move flattenWithPrefix to package / skip signal migration tests

* Fix unit tests

* Use new schema for bulk rule creation

* event: { kind } => event.kind

* Fix signal migration API tests

* Fix ml integration test

* Fix threat match integration tests

* Fix ML rule type tests and add correct producer to all rule types

* Update threat match API integration test

* Remove dupe properties

* Type fix

* Fix ML producer in functional test

* Fix generating_signals tests

* Remove usage of RuleDataClient-based execution log client

* Don't check output index version if rule registry enabled

* Fix bulk duplicate rule

* Fix duplicate rule test

* Fix readPrivileges and timestamp check logic

* Fixes for eql and exceptions tests... disable open_close_signals

* Type fixes / keyword test fixes

* Additional test fixes

* Unit test fixes + signal -> kibana.alert

* Test fixes for exceptions

* Fix read_resolve_rules test

* Various test fixes with marshallmain

* Sort search results

* Fix create_rules tests

* Disable writer cache for integration tests

* Disable writer cache for cases integration tests

* Fix types in rule_data_plugin_service

* Fix ordering in exceptions tests

* Remove rule_registry.enabled flag

* Fix signals migration tests

* Don't check signals index before creation

* Fix cypress config

* Fix type error

* create_migrations tests

* Skip flaky test

* Helpful comment

* Fixes from merge conflicts

* Pretend that signals index exists

* Fix type errors

* Skip flaky tests

* Fix threat matching test

* Clean up

* Reverting default ruleRegistry experimental flag (breaks unit tests)

* Reenable rule registry experimental feature by default

* Execute DE rule migration in 8.0

Co-authored-by: Marshall Main <marshall.main@elastic.co>
2021-10-26 16:56:40 -04:00