Commit graph

41356 commits

Author SHA1 Message Date
Frank Hassanabad
47bb9773a1
[Security Solutions] Sets our default date time to be "today" instead of "Last 24 hours" to enable cachability and fixes one date math bug in the URL (#93548)
## Summary

Enables caching in our application by setting the default date time of our application to be `from: now/d` and `to: now/d`. When users go to the advanced settings they will see this now:
<img width="1243" alt="Screen Shot 2021-03-04 at 11 53 08 AM" src="https://user-images.githubusercontent.com/1151048/110014626-43fb6700-7ce0-11eb-94ee-0c4cc7a8a10f.png">

In their date time bars on page loads they will see today instead of 24 hours:
<img width="556" alt="Screen Shot 2021-03-04 at 11 50 18 AM" src="https://user-images.githubusercontent.com/1151048/110015216-dac82380-7ce0-11eb-935d-2d71078c1170.png">

When before they used to have `from: now-24` and `to: now`. This new date time frame plays well with Elastic caches and no longer "busts" them for users on each page request. Now users will send the same date time frame on each query which will cache the views as the default.

This also fixes a small bug with the URL's where the "to" was not being rounded up when it was a dynamic date time on first load. For example if you went to the URL, `/app/security/hosts/allHosts` with no additional state information but have a default of `from: now/d` and `to: now/d` it would not round up the date time. Now it rounds it up through the date math utilities which only rounds when it sees that it is a dynamic date math.

When requests are being sent, expect to see this where you have `from` rounded down and `to rounded up. This should be a consistent non-sliding date time math for caching to operate:
<img width="608" alt="Screen Shot 2021-03-04 at 11 33 11 AM" src="https://user-images.githubusercontent.com/1151048/110015357-01865a00-7ce1-11eb-8580-efacf791b573.png">

If you change the `to` to be another date math such as `now+1d/d` expect to see it also rounded up. This behavior mirrors that of discover:
<img width="608" alt="Screen Shot 2021-03-04 at 11 33 11 AM" src="https://user-images.githubusercontent.com/1151048/110015440-17941a80-7ce1-11eb-832d-e826962829ed.png">

You can manually verify this behavior by setting the same now dates in discover as well as security solutions and both should work as is even when you remove the URL state from the right side of a `?`


### 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-03-04 14:22:37 -07:00
Candace Park
28750e913b
[Security Solution][Endpoint][Admin][Policy] Register as AV os restrictions tooltip note (#93306) 2021-03-04 16:05:46 -05:00
Peter Pisljar
a58e3bdbbf
fix agg config sub agg dsl generation (#93276) 2021-03-04 21:59:25 +01:00
Kerry Gallagher
e45718d0ff
[Logs UI] Fix log stream data fetching (#93201)
* Use ReplaySubject and amend date comparisons

* Assess date range expressions separately

* Only add dataset filter to view in stream links if one exists
2021-03-04 19:50:14 +00:00
Jason Stoltzfus
6ab3fc0107
[App Search] Added relevance tuning search preview (#93054) 2021-03-04 11:47:10 -08:00
Corey Robertson
d673f5601d
[Canvas] Fix reports embeddables (#93482)
* wip

* WIP

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-04 14:30:30 -05:00
John Dorlus
572f6888c2
[ILM] Added new functional test in ILM for creating a new policy (#92936)
* Added data-test-subj for ILM policies row and added a functional UI test to create a new ILM policy.

* Removed .only from test to allow entire test suite to run again.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-04 13:55:00 -05:00
Mikhail Shustov
3e98b1012f
Remove direct dependency on statehood package (#93592)
* remove stathood deps. not used anymore

* remove direct deps on @hapi/statehood

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-04 13:48:03 -05:00
Thomas Neirynck
db3db0cebc
[Maps] Track tile loading status (#91585) 2021-03-04 13:22:03 -05:00
Matthias Wilhelm
88f41565b0
[Discover][Doc] Improve main documentation (#91854)
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2021-03-04 19:09:43 +01:00
Alison Goryachev
ebe1f1f6d3
[Upgrade Assistant] Disable UA and add prompt (#92834) 2021-03-04 13:03:14 -05:00
Alison Goryachev
67ca801c3f
[Snapshot Restore] Remove cloud validation for slm policy (#93609) 2021-03-04 13:02:08 -05:00
Nathan Reese
05db7c60b1
[Maps] Support GeometryCollections in GeoJson upload (#93507) 2021-03-04 11:01:33 -07:00
Nick Partridge
667cb14f5a
[XY Charts] fix partial histogram endzones annotations (#93091) 2021-03-04 11:06:33 -06:00
Mikhail Shustov
7e3ca16aee
[Core] Simplify context typings (#93579)
* simplify context typings in core

* add tests for context types

* update docs
2021-03-04 17:00:50 +00:00
ymao1
cad26537a9
[Alerting] Improving health status check (#93282)
* wip

* Moving catchError so observable stream does not complete. Adding retry on failure

* Using retryWhen. Updating unit tests

* PR fixes

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-04 11:58:20 -05:00
Matthias Wilhelm
51b416b23f
[Discover] Restore context documentation (#90784)
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2021-03-04 17:24:13 +01:00
Christiane (Tina) Heiligers
70daf8098c
[core-docs] Edits core-intro section for the new docs system (#93540) 2021-03-04 09:18:58 -07:00
Mikhail Shustov
0a33e583cf
add missed codeowners (#89714)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-04 08:13:20 -08:00
Joe Reuter
1882b82531
fetch node labels via script execution (#93225) 2021-03-04 17:08:26 +01:00
Ece Özalp
3d374e2686
[Security Solution] Adds getMockTheme function (#92840)
Closes elastic/security-team#866.
2021-03-04 10:31:39 -05:00
Thomas Watson
00bad90676
Sort dependencies in package.json correctly (#93590) 2021-03-04 09:54:00 -05:00
Liza Katz
f5351e67b6
[Bug] missing timepicker:quickRanges migration (#93409)
* timepicker:quickRanges

* code review

* Change into a 7.12 migration
2021-03-04 16:50:26 +02:00
Wylie Conlon
6512e5ad04
Undo change that added histogram to sample data (#93491)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-04 09:49:52 -05:00
Gidi Meir Morris
79134b3b6d
[Alerting][Docs] Adds Alerting & Task Manager Scalability Guidance & Health Monitoring (#91171)
Documentation for scaling Kibana alerting, what configurations can change, what impacts they have, etc.
Scaling Alerting relies heavily on scaling Task Manager, so these docs also document Task manager Health Monitoring and scaling.
2021-03-04 14:11:53 +00:00
Joe Reuter
462fe0829e
stabilize waiting for visualization (#93469) 2021-03-04 14:56:56 +01:00
Anton Dosov
fe1ae92957
Fix wrong import in data plugin causing 100kB bundle increase (#93448) 2021-03-04 05:42:36 -05:00
Alejandro Fernández Gómez
a050b7af79
[Fleet] Correctly track install status of an integration (#93464) 2021-03-04 11:01:23 +01:00
István Zoltán Szabó
284a77c7c0
Reviews data frame analytics UI text (#93033)
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
2021-03-04 09:09:43 +01:00
Kevin Qualters
89373490d0
Display multiple copyable fields for process.args in resolver node detail panel (#93280) 2021-03-04 00:24:58 -05:00
Davis Plumlee
3316fb43fd
[Security Solution][Detections] ML Popover overflow fix (#93525)
Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
2021-03-03 21:22:05 -05:00
Tiago Costa
2a8e4b260f
chore(NA): do not use execa on bazel workspace status update script (#93532) 2021-03-03 20:16:37 -05:00
Joe Portner
40a3386553
Bump dependencies (#93511) 2021-03-03 19:56:37 -05:00
Spencer
3ba17f284e
[dev/build_ts_refs] support disabling the ts-refs build completely (#93529)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-03-03 19:47:52 -05:00
Angela Chuang
a953e90dd4
[Security Solution] fix data provider cypress test (#93465)
## Summary
This PR is to fix data_provider's cypress test: displays the data provider action menu when Enter is pressed.

When I ran it locally, I couldn’t reproduce it every time. There’s a chance that the timeline was opened but the filter we put wasn’t there, this happen when I simulate slow 3G with Chrome or once out of my 10-time-trial with `loop_cypress_tests.js`

[failure 1](https://kibana-ci.elastic.co/job/elastic+kibana+security-cypress/4313/testReport/junit/(root)/displays%20the%20data%20provider%20action%20menu%20when%20Enter%20is%20pressed/timeline_data_providers_displays_the_data_provider_action_menu_when_Enter_is_pressed/)
[failure 2](https://kibana-ci.elastic.co/job/elastic+kibana+security-cypress/4313/testReport/junit/(root)/displays%20the%20data%20provider%20action%20menu%20when%20Enter%20is%20pressed/timeline_data_providers_displays_the_data_provider_action_menu_when_Enter_is_pressed_2/)

How to run this test several times automatically:
1. Go to the file and mark your case with .only
2. Copy the relative path of the file
3. Go to x-pack/plugins/security_solution/package.json Line 13, change —spec to the path you just copied (e.g: ./cypress/integration/timelines/data_providers.spec.ts)
4. Go to Kibana/ and run node x-pack/plugins/security_solution/scripts/loop_cypress_tests.js 1 (1 means run it once, you can put more to check flakiness)
5. After it finishes, it generates you a report under: kibana/target/loop-cypress-tests.txt
6. Search for `displays the data provider action menu when Enter is pressed.` and see if all passes.
2021-03-03 17:27:29 -07:00
Nathan L Smith
4e21faeeb6
Fix service map for All environment single service (#93517)
Before we removed environment from the UI filters (#89647), the environment query parameter would be undefined if "All" was selected. Now we send ENVIRONMENT_ALL in as the query parameter.

Changes in https://github.com/elastic/kibana/blob/master/x-pack/plugins/apm/server/lib/service_map/get_service_map_from_trace_ids.ts made it so no connections would be returned if ENVIRONMENT_ALL was selected, rather than all connections. Since no connections were being returned, no elements except the selected service would be returned in the API response.

This changes it so if ENVIRONMENT_ALL is selected, the connection will always be returned, just like what used to be the case when environment was undefined.

Add an API test for this case.

Fixes #93385.
2021-03-03 17:30:08 -06:00
Nicolas Chaulet
a61e1dd9fa
[Fleet] Fix package version comparaison in the UI (#93498) 2021-03-03 17:04:52 -05:00
Patrick Mueller
60adc73afa
[alerting] adds doc on JSON-expanded action variables and task manager max_workers (#92720)
resolves https://github.com/elastic/kibana/issues/90006

For task manager, adds a note about the fact that the max_workers will be
limited to 100 starting in 8.0.  Currently we allow any value (because we
always have), but do print a "deprecation" warning that the limit cannot
be exceeded starting in 8.0

For alerting, adds note about the JSON expansion of action variables which are objects.
2021-03-03 16:48:30 -05:00
Spencer
ef0931219f
[dev/build_ts_refs] ignore type checking failures when building ts refs (#93473)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-03-03 13:40:07 -07:00
Christiane (Tina) Heiligers
c2bfa87664
[core-new-docs] Adds a dev-doc for core documentation (#92976) 2021-03-03 13:37:20 -07:00
Thomas Neirynck
a620179151
remove opacity from maps legacy style (#93456) 2021-03-03 15:04:38 -05:00
Marshall Main
4c893985e3
[Security Solution][Lists] Escape quotes in list ids and quote the id in KQL query (#93176)
* Escape quotes in list ids and quote the id in KQL query

* Remove decodeURIComponent because too many KQL queries don't handle quotes

* Add quotes to user supplied IDs for other KQL queries

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-03 15:02:08 -05:00
Tiago Costa
2d17821f08
Revert "Make tests deterministic by providing unique timestamps (#93350)"
This reverts commit 3ce614fe46.
2021-03-03 19:48:54 +00:00
Wylie Conlon
799c05e0b8
[Discover] Fix link from dashboard saved search to Discover (#92937)
* [Discover] Fix link from dashboard saved search to Discover

* Fix tests that weren't fully testing the navigation

* Fix snapshot

* Fix test navigation to context app by reverting to previous

* Unskip functional test and fix issue in data grid

* Respond to review comments
2021-03-03 14:47:53 -05:00
spalger
ef4611d621 update public api docs 2021-03-03 12:29:50 -07:00
Davey Holler
c0aa199759
App Search - Polishing Analytics Views (#92939)
* WIP analytics polish

* Working on tests.

* Finishing up tests.

* Updating the engine overview page.

* eslint fixes

* i18n fixes

* Icons feedback

- Remove unused svg file
- Add TODO comment
- Add test coverage

* linting - unnecessary ternaries

* EnginesOverview feedback

TotalCharts
- adjust chart height
- tests: simplify / convert back to shallow

RecentApiLogs
- switch to DataPanel

* DataPanel feedback

Component
- move CSS table bg override out from being an AnalyticsTable concern to a DataPanel concern
  + bem naming, todo comment
- add responsive={false} for better mobile UX
- add className and data-test-subj prop passing
- change title to pass full heading tags rather than a string
- move subtitle below title for better screen reader order
- add index.ts export

Tests
- capitalization for consistency, ordering/describe
- remove data-test-subjs on source code (simpler to grab & inspect tags directly so we can more easily call .text() on passed content)
- add new tests for props (fliled/className/data-test-subj)

Usage
- update other files using DataPanel to start passing heading tags + use index export
- fix RecentApiLogs tests
- change RecentQueries section to use a DataPanel (per Davey)

* Analytics tags - updates & responsive tweaks

Tags
- Rename to more general tags.tsx file
- Add CSS limiting width of variable length tags
- Break up into two separate components for easier readability & testing
- Split up tags column constants so that the wider tables can use the old tags list component

Tables
- add isSmall flag to AnalyticsTable to use new tag count  component
- reduce actions column width
- revert unnecessary table test changes

Analytics
- add custom CSS that switches tables/panels into full-width earlier

* AnalyticsSection fixes

- fix responsive behavior with icon
- add missing AnalyticsSection branch coverage

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance Chen <constance.chen.3@gmail.com>
2021-03-03 11:26:05 -08:00
Jonathan Budzenski
294db1086a
[build] Add task skips intended for partial builds (#92679)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-03 13:15:17 -06:00
Mikhail Shustov
83023ea992
add a note JSON is in ECS format (#93450) 2021-03-03 20:10:11 +01:00
John Schulz
b5522ed30c
[Fleet] Add lint rule/fix for import order groups (#93300)
## Problem
Blocks of 10-15 `import`s are common in the plugin and there a few places which have ~50 lines of `import`s. It makes it more difficult to understand the where/why of what's being imported.

We've had instances while files import from the same module in different lines. i.e.

```ts
import { a } from './file';
... 5-10 lines later
import { b } from './file';
```

## Proposed solution
Add a lint rule to enforce a convention on the module `import` order. This can help in the same way Prettier & ESLint help to format type signatures or other code. It makes it easier to understand or notice any changes in the code. It's also able to be fixed automatically (`node scripts/eslint.js --fix` or any existing "format on save" in an editor).

## This PR
replaces #92980 (based on https://github.com/elastic/kibana/pull/92980#pullrequestreview-601070556)

### Lint rule
f9be98d Add eslint rule to enforce/autofix import group order. Use the same rule as a few other plugins. Groups `import` statements by type as shown in the [lint rule docs](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md#importorder-enforce-a-convention-in-module-import-order
). The order is:

  1. node "builtin" modules
  2. "external" modules
  3. "internal" modules
  4. modules from a "parent" directory
  5. "sibling" modules from the same or a sibling's directory, "index" of the current directory, everything else

e.g.

```typescript
import fs from 'fs';
import path from 'path';

import _ from 'lodash';
import chalk from 'chalk';

import foo from 'src/foo';

import foo from '../foo';
import qux from '../../foo/qux';

import bar from './bar';
import baz from './bar/baz';
import main from './';
```
The [lint rule](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md#importorder-enforce-a-convention-in-module-import-order) is relatively light handed. It only ensures  the `imports` are groups together in the given order. It doesn't alphabetize or otherwise sort the order of the files.


e.g. imports aren't rewritten to be in alphabetical order. This is fine

```ts
import from './c';
import from './a';
import from './b';
```

The [docs show other options](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md#options) and 2831f02bc7/.eslintrc.js (L1138-L1168) uses many of them

### Newlines option
The newlines settings means a change from something like

```typescript
import fs from 'fs';
import path from 'path';
import _ from 'lodash';
import chalk from 'chalk';
import foo from 'src/foo';
import foo from '../foo';
import qux from '../../foo/qux';
import bar from './bar';
import baz from './bar/baz';
import main from './';
```

to 

```typescript
import fs from 'fs';
import path from 'path';

import _ from 'lodash';
import chalk from 'chalk';

import foo from 'src/foo';

import foo from '../foo';
import qux from '../../foo/qux';

import bar from './bar';
import baz from './bar/baz';
import main from './';
```



Added it as a separate commit 2831f02 in case we want to avoid it, but I believe it's an improvement overall. Especially on the files with 25+ lines of imports. Even the "worst case" of something like this isn't bad (IMO). Especially since it's an automatic reformat like anything else in prettier


```typescript
import fs from 'fs';

import _ from 'lodash';

import foo from '../foo';

import main from './';
```
2021-03-03 13:58:20 -05:00
Jonathan Buttner
9dd395b452
[Security Solution][Case][Bug] Only update alert status in its specific index (#92530)
* Writing failing test for duplicate ids

* Test is correctly failing prior to bug fix

* Working jest tests

* Adding more jest tests

* Fixing jest tests

* Adding await and gzip

* Fixing type errors

* Updating log message

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-03 13:28:59 -05:00