Commit graph

47411 commits

Author SHA1 Message Date
Jonathan Budzenski 491ccc0d55
[yarn.lock] Resolve micromatch to 4.0.4 (#115132) 2021-10-20 17:53:37 -05:00
Frank Hassanabad 9ca48d05f3
Adds one time conflict retry and cleans up the exception lists to use the REST API (#115848)
## Summary

Improves FTR/e2e conflict retries with exception lists and security rules.

Fixes:
https://github.com/elastic/kibana/issues/115734
https://github.com/elastic/kibana/issues/115769
https://github.com/elastic/kibana/issues/115715
https://github.com/elastic/kibana/issues/115702
https://github.com/elastic/kibana/issues/115701

This past week we have been seeing increasing flake across tests involving `exception_lists` involving a `409 conflict` on our tests. Looking at each of the tests above and the flake it looks like we were calling Elasticsearch directly within the `.kibana` index to delete the exception list and list items as a shortcut:

```
export const deleteAllExceptions = async (es: KibanaClient): Promise<void> => {
  return countDownES(async () => {
    return es.deleteByQuery({
      index: '.kibana',
      q: 'type:exception-list or type:exception-list-agnostic',
      wait_for_completion: true,
      refresh: true,
      body: {},
    });
  }, 'deleteAllExceptions');
};
```

Although I think we did everything correctly `wait_for_completion: true` and  `refresh: true` within the tests there might be a slight race condition where the delete by query does not immediately happen for us. Since we should prefer to use direct REST API's where we can instead of calling into `.kibana` I changed this to using the exception list API:

```
export const deleteAllExceptions = async (
  supertest: SuperTest.SuperTest<SuperTest.Test>
): Promise<void> => {
  await countDownTest(
    async () => {
      const { body } = await supertest
        .get(`${EXCEPTION_LIST_URL}/_find?per_page=9999`)
        .set('kbn-xsrf', 'true')
        .send();

      const ids: string[] = body.data.map((exception: ExceptionList) => exception.id);
      for await (const id of ids) {
        await supertest.delete(`${EXCEPTION_LIST_URL}?id=${id}`).set('kbn-xsrf', 'true').send();
      }
      const { body: finalCheck } = await supertest
        .get(`${EXCEPTION_LIST_URL}/_find`)
        .set('kbn-xsrf', 'true')
        .send();
      return finalCheck.data.length === 0;
    },
    'deleteAllExceptions',
    50,
    1000
  );
};
```

The additional final check above should ensure it sees that the data has been deleted before returning. Otherwise it will loop around again and keep trying.

I also improve both the `createRules` and `createExceptionList` by introducing a one-time, "detect if in conflict" and then "remove if in conflict" within those tests. This should help safe guard against flake if the above does not fix it. I also added more logging statements in case we do encounter this again on the CI system we can further trouble shoot it and add additional retry logic/fix logic.

A good side effect is if now you kill your tests half way through and restart them, the additional "detect if conflict" will recover your test for you as a developer. So 👍 that is an added benefit.

Example error message you would get (but not test failure) if you remove one of the cleanup sections in the `afterEach` or if you kill a test half way through and then restart it as an engineer:

```
└-: "is" operator
             └-> "before all" hook for "should find all the text from the data set when no exceptions are set on the rule"
             └-> should find all the text from the data set when no exceptions are set on the rule
               └-> "before each" hook: global before each for "should find all the text from the data set when no exceptions are set on the rule"
               └-> "before each" hook for "should find all the text from the data set when no exceptions are set on the rule"
When creating a rule found an unexpected conflict (409), will attempt a cleanup and one time re-try. This usually indicates a bad cleanup or race condition within the tests: {"message":"rule_id: \"rule-1\" already exists","status_code":409}
               └- ✓ pass  (7.9s)
```

### 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
2021-10-20 16:25:33 -06:00
Brian Seeders 35114175b6
[buildkite] FTSR / limit concurrency and total jobs (#115857) 2021-10-20 18:09:49 -04:00
Tyler Smalley 9a00e98b7c skip flaky suite (#115859) 2021-10-20 14:54:45 -07:00
Xavier Mouligneau 8a0a96e422
fix ueba store (#115842) 2021-10-20 22:48:15 +01:00
Rashmi Kulkarni e37c25991e
un-skip maps/feature_controls/maps_spaces.ts functional test (#113656) 2021-10-20 14:20:23 -07:00
Thom Heymann b879a9a497
Add interactive setup CLI (#114493)
* Add interactive setup CLI

* Added tsconfig

* ignore all CLI dev.js files when building

* add cli_init to the root TS project and setup necessary ref

* Fix type errors

* Added suggestions from code review

* ts fix

* fixed build dependencies

* Added suggestions from code review

* fix type definitions

* fix types

* upgraded commander to fix ts issues

* Revert "upgraded commander to fix ts issues"

This reverts commit 52b8943222.

* upgraded commander

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-20 22:17:45 +01:00
Byron Hulcher abd5e9ffa8
[App Search] Automated Curations UX improvements (#115773) 2021-10-20 21:56:14 +01:00
Tim Sullivan e3f4107d90
[Reporting] Upgrade Puppeteer dependency to 10.2.0 (#115682)
* [Reporting] Upgrade Puppeteer dependency to 10.2.0

* Update x-pack/plugins/reporting/server/browsers/chromium/paths.ts

* self-edit

* Apply suggestions from code review

Co-authored-by: Michael Dokolin <dokmic@gmail.com>

* fix lint

Co-authored-by: Michael Dokolin <dokmic@gmail.com>
2021-10-20 21:22:44 +01:00
Dave Snider e258e143e9
Features integrations + mobile, copy, design tweaks (#115495)
* Features integrations + mobile, copy, design tweaks

* i18n

* ts fix

* center button in no data card

* tracking ids

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-20 16:21:38 -04:00
Miriam 26a8d86b45
[APM] Enhancements errors list page (#115194)
* Add comparison to occurrences errors chart

* fix types

* Add errors rate chart

* Rename component and other PR review changes

* Subtitute noHits for fetch status

* Use status from correct request

* Improve types for comparisonType and comparisonEnable

* Move TimeRangeComparisonEnum to /runtime_types/comparison_type_rt

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-20 22:03:46 +02:00
Tiago Costa f40618c707
skip failing es promototion suites (#115849) 2021-10-20 20:51:49 +01:00
Tyler Smalley 5151aa4729 skip flaky suite (#115473) 2021-10-20 12:30:57 -07:00
Devon Thomson 909734491c
[Controls] Options List Redux & Selection Management (#115122)
* Ported options list to use Redux. added selection management and selection clear buttons to options list. Options list clears selections when field or index pattern change. Design cleanups and updates

Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
2021-10-20 15:24:53 -04:00
Corey Robertson dd378cd9ff
Makes cavas saved objects 'multiple-isolated' (#115810) 2021-10-20 15:13:07 -04:00
Artem Shelkovnikov f74348494d
Enterprise Search - Add note about Cases to Salesforce Content Source (#115764)
* Add attachment to list of synced objects for Kibana

* Add attachments to Salesforce Sandbox as well

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-20 21:00:24 +02:00
Kevin Qualters 031929b418
Update event view actions column width (#115809) 2021-10-20 14:47:28 -04:00
Gloria Hornero 9e4c21d0ea
skips flaky test (#115738) 2021-10-20 14:44:56 -04:00
Kyle Pollich 6d4cfc5e39
[Fleet] Add support for "Edit Package Policy" extensions using latest version of a package (#114914)
* Add support for extensions using latest version of a package and forcing upgrade state for edit policy view

* Fix isUpgrade flag on integrations UI version of edit page

* Treat non-validation errors as general failures in server and UI

* Fix tests + don't call upgrade API when saving

* fix i18n

* Fix default name always appearing when editing package policies via extension UI

* Opt security solution plugin out of new extension option

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-20 14:35:45 -04:00
Jason Stoltzfus 1da11dfdc0
Fixed callouts (#115631) 2021-10-20 13:55:43 -04:00
Domenico Andreoli fe471cea57
[Security] Realign CCS functional tests (#115795)
* Realign CCS functional tests
* Reduce the diff with plain functional tests
2021-10-20 13:43:57 -04:00
Liza Katz ab9f8d1b4b
Keep page load transaction open (#115410)
* keep page load transaction open

* cleanup

* code review

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-20 20:43:49 +03:00
Pablo Machado c0b852ff13
Fix breadcrumbs not showing when opening a timeline from case details (#115728) 2021-10-20 13:34:52 -04:00
Brian Seeders 9c5d4dc20e
[buildkite] Build PRs on buildkite by default (#115796) 2021-10-20 13:34:21 -04:00
Ester Martí Vilaseca 7b7079bae7
[Stack monitoring] Remove getAngularInjector and duplicated angular components (#115593)
* remove getAngularInjector and old angular components

* Remove suffix from CcrShardReact component

* Remove suffix from ElasticsearchOverviewReact component

* Remove suffix from indexReact component

* Remove suffix from NodeReact component

* Remove suffix from ShardActivityReact

* Remove suffix from ShardAllocationReact component and its childs

* Fix import

* fix translations

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-20 18:54:41 +02:00
Tyler Smalley 4749e933b1
[vscode] Exclude api_docs directory from search and watch (#115786)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-10-20 12:53:19 -04:00
Tyler Smalley 9e4e3ef9e4
[backports] 7.16 should not be checked by default (#115819)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-10-20 09:49:06 -07:00
Brandon Morelli 2daadc0d74
docs: update links to APM docs (#115664) 2021-10-20 09:43:30 -07:00
Tiago Costa 7767691d47
chore(NA): runs packer cache for 7.x rename into 7.16 (#115802)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-20 17:34:14 +01:00
Tiago Costa ee9162052c
chore(NA): adds renovate configs for renaming 7.x into 7.16 (#115787)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-20 17:33:26 +01:00
Tiago Costa c0d6a612d6
chore(NA): adds backport configs for renaming 7.x into 7.16 (#115783)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-20 17:31:32 +01:00
Ahmad Bamieh 00cc5fef8e
[Telemetry] Switch to v3 endpoint (#113525) 2021-10-20 12:26:21 -04:00
Chris Cowan 31fa0cb13b
[Metrics UI] Add track_total_hits to Metric Threshold query to support alerts with over 10K documents (#115465)
* [Metrics UI] Add track_total_hits to Metric Threshold query

* Adding tests

* Making the esArchive smaller
2021-10-20 10:19:44 -06:00
Ece Özalp b12e21d9aa
[Security Solution][CTI] Rule Preview backend update (introduces /preview endpoint) (#112441)
Co-authored-by: Davis Plumlee <davis.plumlee@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-20 12:06:50 -04:00
Byron Hulcher c9bca2cd59
[App Search] Load curation settings at root /curations/ path (#115690) 2021-10-20 11:51:00 -04:00
Liza Katz f1fe71650b
[Bug] fix memory info extraction for fullstory (#115756)
* fix memory info extraction

* ts
2021-10-20 18:19:53 +03:00
Luke Elmers a7fff86390
[saved objects] Remove migrations enableV2 config. (#115655) 2021-10-20 09:17:52 -06:00
Anton Dosov a7a1e5436b
Fix save session UI appears in report (#115746) 2021-10-20 17:03:44 +02:00
Mikhail Shustov c6fcde9a8b
[ES client] Rename deprecated params (#115528)
* filterPath --> filter_path

* ignoreUnavailable --> ignore_unavailable

* ignoreUnavailable --> ignore_unavailable

* trackScores --> track_scores

* trackTotalHits --> track_total_hits

* rollback unnecessary changes
2021-10-20 16:46:37 +02:00
Bryan Clement 7e593a05a2
[Osquery] Cypress automation for osquery manager integration (#108759) 2021-10-20 16:09:08 +02:00
Devon Thomson 85719272b9
[Reporting / Dashboard] Use Unsaved State in Report URL (#114331)
* All dashboard state keys taken from unsaved changes for share
2021-10-20 10:02:02 -04:00
Byron Hulcher d9f80133ad
[App Search] Improve visual design of Promoted Documents panel (#115683) 2021-10-20 09:23:07 -04:00
Stratoula Kalafateli 453d4bca36
[XY] Fixes the formatting on multiple axis (#115552)
* [XY] fixes the formatting on multiple axis

* Move mock data to its own file
2021-10-20 15:26:22 +03:00
Dzmitry Lemechko 9b3529a2a1
[ftr] update webdriver dependency to 4.0 (#115649)
* [ftr] update webdriver dependency to 4.0

* [ftr] cast options on assign

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-20 14:19:42 +02:00
Marco Vettorello 73566ad285
[charts] Replace usage of linear xScaleType in barchart [skip-ci] (#114778) 2021-10-20 14:03:45 +02:00
Peter Pisljar 3f12a90766
remove any from filter persistable state (#115128) 2021-10-20 13:56:58 +02:00
Peter Pisljar 73a0fc0948
[expressions] decrease bundle size (#114229) 2021-10-20 13:56:37 +02:00
Jason Stoltzfus 109e966a7a
[App Search] Put History tab behind platinum check (#115636) 2021-10-20 07:35:25 -04:00
Stratoula Kalafateli eb5af49de1
[TSVB] Fixes the long text problem that appears behind the gauge chart (#115516) 2021-10-20 13:57:12 +03:00
Brian Seeders d2c6c4104c
[buildkite] Add uptime playwright tests to PR pipeline (#115590) 2021-10-20 11:43:24 +02:00