Commit graph

30888 commits

Author SHA1 Message Date
Joe Reuter
948bfa9950
Clean up shims of Graph, Home, Dashboard, Visualize (#57331) 2020-02-14 14:11:18 +01:00
Anton Dosov
098a55a83c
unskip replace flyout test (#57093)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-14 14:07:00 +01:00
Jean-Louis Leysens
7f71c787bd
[Console] Fix performance bottleneck for large JSON payloads (#57668)
* Fix Console performance bug for large request bodies

The legacy_core_editor implemenation was calculating the current editor line
count by .split('\n').length on the entire buffer which was very inefficient
in a tight loop. This caused a performance regression. Now we use the cached
line count provided by the underlying editor implementation.

* Fix performance regression inside of ace token_provider implementation

* Clean up another unnecessary use of getValue().split(..).length.

Probably was not a performance issue, just taking unnecessary steps. Not
sure that this function is even being used.
2020-02-14 13:56:52 +01:00
Walter Rafelsberger
c1cf4896a5
[ML] Fix brush visibility. (#57564)
Fixes brush visibility. The brush will no longer be hidden if it covers the full available timespan. Removes all code that was earlier used to manage brush visibility.
2020-02-14 13:07:54 +01:00
Dario Gieselaar
979c1d24fa
[APM] Add xpack.apm.enabled key to config schema (#57539)
Closes #57418.
2020-02-14 13:06:57 +01:00
igoristic
f8b06e3726
[Monitoring] Fixed logs timezone (#57611)
* Fixed logs timezone

* Passing tz as a param

* Fixed tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-14 06:29:49 -05:00
Pierre Gayvallet
f87053e0b5
Use app id instead of pluginId to generate navlink from legacy apps (#57542)
* properly use app id instead of pluginId to generate navlink

* extract convertToNavLink, add more tests

* use distinct mapping methods

* fix linkToLastSubUrl default value

* nits & doc
2020-02-14 12:23:53 +01:00
Cauê Marcondes
1aadf3e021
[APM] Custom actions: Settings list page for managing custom actions (#56853)
* creating customize ui and empty prompt

* new custome ui page, with create custom action flyout

* removing import

* removing import

* fixing translations

* fixing pr comments

* fixing pr comments

* fixing translations

* fixing labels

* renaming

* fixing translations
2020-02-14 10:35:33 +00:00
Joe Reuter
273fa4371a
TSVB validation: Allow empty strings for number inputs (#57294) 2020-02-14 11:11:27 +01:00
Joe Reuter
104d4abecf
Migrate vega and graph configs to new platform (#57011) 2020-02-14 11:10:41 +01:00
Matthias Wilhelm
009d350351
[Discover] Improve functional test of context (#57575)
By converting adding filters to a sequential mode, the test of clicking on a context link in the discover table should no longer be flaky
2020-02-14 09:28:35 +01:00
Pierre Gayvallet
302c598e56
Preserve the original error name instead of returning raw AbortError (#57550)
* Preserve the original error name instead of returning raw AbortError

* use Error as the default error name
2020-02-14 08:58:20 +01:00
spalger
fe3864282a disable firefox smoke tests so we can fix flakiness out of band 2020-02-14 00:46:55 -07:00
Ryland Herrick
8513498e2d
[SIEM] Final Shimming/Prep for Server NP Migration (#56814)
* Route all our server setup through the plugin

Next we'll be trimming down ServerFacade to the final few dependencies,
and using our plugin dependencies for the rest.

* Clean up server plugin exports

For now, let's try to simplify our typings by exporting our plugin's
dependencies from the plugin itself, since we know it already knows
about them.

* Move DE Routes to to conventional location

I'm throwing the alerting registration in the plugin for now, too.

* Loosen up our RequestFacade

Now that we've audited our use of request objects, we can switch to the
more friendly LegacyRequest that all our utilities are expecting.
LegacyRequest doesn't have plugins, either, so our only remaining errant
usage is retrieving clients from it, which we call out explicitly.

* Remove uses of 'src' alias

This just threw an error on startup, so I'm fixing all of them to be
safe.

* Fix types of our GraphQL requests

These come through as new KibanaRequests and not as the LegacyRequest
that I had incorrectly typed them as.

I'm only caring about the `body` property right now, since that's all we
really deal with, and in testing it was all that was populated in our
actual requests, too.

* Initialize our routes with SetupServices

We're using the legacy version for now, but ServerFacade will be gone by
the end of the migration.

* Swap legacy spaces plugin for NP

This changes the signature of getIndex, which is used in quite a few
places. We'll see how bad that looks in the next commit.

* Remove unneeded typing

We're already ignoring another portion of the platform shim due to it
being incompatibly typed, so we might as well remove this.

* WIP: Converting our DE routes to use consolidated services

This contains our legacy stuff for now. Eventually, it will only be our
NP services. This breaks a few tests due to the way createMockServer
works, but I'll clean that up momentarily.

* Fix DE routing tests following refactor

The createMockServer helper does a few things differently:

* returns mocked LegacyServices that can be passed to our route
factories
* does not return a server object as we don't need it, except for:
* returns an inject function that we can use to execute a request

We're casting our services because we're only mocking a subset of what
LegacySetupServices entails.

Mainly, this allows me to continue moving
things off of ServerFacade without significant refactoring of tests.

* Fix incompatible request types

Unfortunately, LegacyRequest does not allow a request's `query` values
to be anything other than a string or string[]. However, in practice
they can (and are) objects, booleans, etc.

Our request types (e.g. QueryRequest) are correct, but because service
functions are LegacyRequest's implementation of `query`, we need to cast
them lest a type error occur.

For now, the easiest solution is to do this in the request handler:
intersecting with our RequestFacade (LegacyRequest) allows us to both a)
pluck our query params off the request and b) pass the request to NP
services.

* Move our use of encryptedSavedObjects to NP

We're just retrieving a boolean from it right now, which is also guarded
against the plugin being unavailable. If this usage becomes more
widespread, we'll make this available at a higher level, probably in
redux.

* Use NP elasticsearch client

* Simplifies our generic type to accept two arguments: params and the
return value
  * Options is fixed and we were never specifying anything meaningful
  there
* Updates all DE cluster calls to use callWithRequestFactory

* Update DE mocks with NP elasticsearch

* createMockServer now returns the callCluster mock, so that you can easily
mock a client response without needing to know the details of how we
define that function

* Remove savedObjects dependency from our legacy dependencies

This was added during a refactor, but we were never actually using this
code. We always retrieve the client from the request via
getSavedObjectsClient.

I think that the NP client has a slightly different interface, so we're
going to create a helper to retrieve it from the request, same as we do
with the elastic client.

In the future, both of these will be available on the request context,
and we can remove the helpers entirely.

* WIP: Convert services to stateful object

In trying to migrate over the savedObjectsClient, I realized that it is
not available during setup in the same way that the ES client is.

Since our routes need pieces from both setup and start phases, I've
added a Services class to accumulate/transform these services and expose
scoped clients when given a legacy request.

In New Platform, these clients will be available upon the request
context and we should be able to remove getScopedServicesFactory for our
routes. A subset of Services' functionality may still be useful, we'll
see.

* WIP: Converting routes to use Services factory

I decided that config shouldn't live in here, as this is only
client-related stuff. Probably going to rename this ClientsService.

Things are still very much broken.

* WIP: Qualifying our Service to ClientsService

This gets us client-related services (ES, SavedObjects, Alerts), but it
is independent of any configuration, which is gonna be another service.

* Fix types on getIndex function

This is a weird helper, I'm not really sure where it should go.

* Our ClientsService is a clients ... service

Return clients, as this is closer to what we'll get in the request
context.

* Clean up our server types

* Declare legacy types at top-level file
* Don't re-export from the plugin solely for convenience, that's a
slippery slope straight to circular dependencies
* Remove RequestFacade as it was a facade for LegacyRequest
* Rename ServerFacade/LegacySetupServices to just LegacyServices

* Refactor mocks for new architecture

* Separates config, server, and client mocks, as they're now independent
in our system, route-wise.
* gets one test working, the rest will follow.

* Simplify our routing mocks

* Adds mock for our new clients service
* Greatly simplifies both server and mock configs
* Renames factory method of client service

* Loosen graphQL endpoint validations

These work fine in production, but it's graphQL so we don't really need
the additional validation of these endpoints, and we weren't leveraging
these types anywhere in Typescript land.

Additionally, these restrictive validations prevent the initial
introspection calls done by graphiQL to get schema information, and
without schemae graphiql wasn't very helpful. This is a dev-only
problem, but that's the audience of graphiql.

* Remove unused graphql endpoint

This was only registered in dev mode; I thought that it was needed by
graphiql. However, after digging further I realized that graphiQL also
only makes POST calls to our real graphQL endpoint, so this route is
unnecessary.

* Reduce our dependence on PluginInitializerContext

After a little more introspection I realized our FrameworkAdapter
doesn't need the kibana version. It was only used in order to make a dev
request via (graphiql), but even that can be performed with a simpler
xsrf header.

This meant that we really only wanted to know whether we're in
production or not, so instead we pass that simple boolean to the
constructor.

* Fix FrameworkAdapter type

We no longer need this property.

* Update detections route tests

Uses the new routes interfaces, and our corresponding new mocks.

* Remove unnecessary null checks

Our savedObjectsClient is always going to be there.

* Remove unused type

YAGNI

* Remove unused savedObjects client

Turns out we were only destructuring this client for the null check.

* Handle case where spaces is disabled

We already null-coalesce properly in the clients service, but this
property access was missed.

* Return default signals index if spaces are disabled

* Remove unnecessary casting of our alerts client mock

I think that this was the result of us importing the wrong AlertsClient
type, or perhaps the types were out of sync. Regardless, they work now.

* Return the 'default' space even when spaces are disabled

This will allow users with spaces disabled to enable spaces without
losing data. The tradeoff is that they may be surprised when signals
don't exist within their configured xpack.siem.signalsIndex.

* Account for spaces being disabled in ClientsService

* Updates types to reflect that spaces may be unavailable
* Adds a test for getSpaceId's behavior when spaces are disabled

* Fix false positives in query signals routes tests

* Refactors mock expectations so that they're actually evaluated; they
can't go within a mockImplementation call as it's evaluated in the wrong
scope.
* Fixes duplicated test to use the proper assertions

* style: Prefer null coalescing over ternary
2020-02-13 22:10:27 -06:00
Jonathan Budzenski
b22045433e
skip flaky tests (#57643) 2020-02-13 19:03:26 -06:00
Josh Dover
945daa4f05
[skip-ci] Remove plugin contracts header from TESTING.md (#57587) 2020-02-13 17:03:37 -07:00
spalger
b058dc2fe7 skip flaky suite (#50018) 2020-02-13 15:21:23 -07:00
Jonathan Budzenski
64625b282c
skip settings tests (#57608) 2020-02-13 16:19:51 -06:00
spalger
8aa718d11e skip failing suite (#44631) 2020-02-13 15:16:48 -07:00
Steph Milovic
ad600c8cd3
[SIEM] [Case] Initial UI (#57283) 2020-02-13 15:02:32 -07:00
Lee Drengenberg
04ec3535eb
handle viewing sample dashboards on default dist (#57510)
* handle viewing sample dashboards on default dist

* re-work change to not break jest test

* Update snap for addition of data-test-subj
2020-02-13 15:45:37 -06:00
Joe Portner
5b5421c5af
Fix detection of "system requests" in plugins (#57149)
This aligns plugin usage with the new way that the Kibana Platform
handles checking for system requests.
2020-02-13 16:33:17 -05:00
Melissa Alvarez
fdef02617e
[ML] New Platform server shim: update job service schema (#57614) 2020-02-13 14:13:59 -07:00
spalger
6e4efdfa7c skip flaky suite (#44631) 2020-02-13 13:40:55 -07:00
Casper Hübertz
5fe53d1cd6
[APM] Update monospace font family variable (#57555)
* [APM] Remove fontFamily variable (not in use)

* [APM] Update fontFamilyCode font family

* Update snapshots
2020-02-13 21:05:28 +01:00
spalger
59672ab5da skip flaky test (#57377) 2020-02-13 12:34:36 -07:00
Jonathan Budzenski
431a1e9c89
Skip save query tests (#57589)
Several tests using the
savedQueryManagementComponent.saveNewQueryMissingOrFail method have been
failing with 'waiting for element'.  Temproary adding a skip for tests
using this method

Related #50018
Related #44631
Related #45348
2020-02-13 12:30:22 -07:00
Nathan Reese
6b62f5a175
[Maps] allow simultaneous opening of multiple tooltips (#57226)
* split TooltipPopover from TooltipContent

* display multiple tooltips

* hack to fix spacing

* hover tooltip

* fix jest tests for new props

* update snapshots

* simplify jest tests

* avoid opening up multiple tooltips in same location

* remove duplicated code

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-13 12:09:42 -07:00
Shahzad
05bf3eeebd
[Uptime] Fix/host connected components (#56969)
* added test for pages

* fixed types

* moved redux logic to connected

* comment

* update type

* type fix
2020-02-13 18:34:18 +01:00
Brandon Morelli
b63e90c372
[logs][metrics][docs] Update screenshots for 7.6 (#57254) 2020-02-13 09:26:37 -08:00
Melissa Alvarez
fd1386ed18
[ML] New Platform server shim: update job service routes to use new platform router (#57403)
* wip: convert jobService route file to TS and use NP router

* add schema definitions for route params

* add api docs description for routes

* update schema and rename client

* update calendarManager

* fix typo in schema

* use NP context savedObjectsClient for rollup true

* request no longer passed to JobServiceProvider

* update anomalyDetectors schema for job update

* add missing key to anomalydetectors schema
2020-02-13 12:12:28 -05:00
Nathan Reese
3f3969dedf
[Maps] Fix document source top hits split by scripted field (#57481)
* [Maps] Fix document source top hits split by scripted field

* fix i18n message

* review feedback

* remove unneeded scss file
2020-02-13 09:22:36 -07:00
Mikhail Shustov
9c1f5ae061
Use log4j pattern syntax (#57433)
* address comments

* use log4j-like syntax in layout pattern

* %timestamp --> %date to match log4j conversion pattern

* %context --> %logger to match log4j pattern

* remove file from pre-defined appenders.

file name is required. let users to setup everything

* matchAll is not polyfilled in runtime

* document available patterns and migration path

* document BWC requirements

* Revert "matchAll is not polyfilled in runtime"

This reverts commit 9f491d4f53.

* address comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-13 14:28:06 +01:00
James Gowdy
02319b7da8
[ML] Categorization field example endpoint tests (#57471)
* [ML] Categorization example endpoint tests

* adding data

* removing debug code

* adding endpoint error test

* updating version in archive
2020-02-13 13:11:31 +00:00
Marta Bondyra
c333576a13
[Lens] Filter out pinned filters from saved object of Lens (#57197) 2020-02-13 13:59:27 +01:00
Joe Reuter
4437858fe3
Lens client side shim cleanup (#56976) 2020-02-13 13:54:51 +01:00
Nathan Reese
717d471a23
[Maps] do not show border color for icon in legend when border width is zero (#57501)
* [Maps] do not show border color for icon in legend when border width is zero

* fix jest tests

* fix jest tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-13 05:52:02 -07:00
MadameSheema
83cce379ad
refactors 'data-providers' tests (#57474) 2020-02-13 12:31:40 +01:00
Pierre Gayvallet
26ad756596
add absolute option to getUrlForApp (#57193) 2020-02-13 10:49:12 +01:00
Ahmad Bamieh
06df2b0db6
[Telemetry] Migrate public to NP (#56285)
* NP telemetry plugin barebones

* fully migrate telemetry sender

* license plugin to use NP telemetry

* fully migrated public to NP

* finish components testing

* fix all tests

* self code review

* remove commented code

* bracket notication for private methods

* bracket notication for private methods

* update license management tests

* afharo code review fixes

* type safe private method access in tests

* fix typecheck

* more type check fixes

* i18n check

* fix welcome page tests

* i18n optedInNoticeBanner title

* fix advanced settings field settings

* field name

* fix home snapshots

* listen to app id change

* NP code review fixes

* NP code review fixes

* update telemetry configs with np deprecations

* pass telemetry from setup instead of npStart

* type check

* update core snapshots with new api exposed

* remove debugging logs

* update home contract

* update home contract

* fix test eslint import

* navigate back to dashboard before start of next case for reporting

* gitignore reporting failure_debug generated dir

* use gotoDashboardEditMode instead of switch

* = instead of :

* merge master

* escape unused forced types in Field

* rename mock to mocks for eslint

* Update src/plugins/telemetry/public/components/telemetry_management_section.tsx

Co-Authored-By: Alejandro Fernández Haro <afharo@gmail.com>

* fix save/clear type

Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-13 09:44:01 +02:00
Gidi Meir Morris
c5a60b94a9
address flaky test where instances might have different start… (#57506) 2020-02-13 06:35:18 +02:00
Tiago Costa
d49a82e9d3
fix(NA): support legacy plugins path in plugins (#57472)
* fix(NA): support legacy plugins path in plugins

* chore(NA): add newly build dist
2020-02-13 03:12:53 +00:00
Spencer
4e8ab56497
build immutable bundles for new platform plugins (#53976)
* build immutable bundles for new platform plugins

* only inspect workers if configured to do so

* [navigation] use an index.scss file

* add yarn.lock symlink

* set pluginScanDirs in test so fixtures stay consistent

* cleanup helpers a little

* fix type error

* support KBN_OPTIMIZER_MAX_WORKERS for limiting workers via env

* test support for KBN_OPTIMIZER_MAX_WORKERS

* expand the available memory for workers when only running one or two

* add docs about KBN_OPTIMIZER_MAX_WORKERS environment variable

* fix README link

* update kbn/pm dist

* implement bundle caching/reuse

* update kbn/pm dist

* don't check for cache if --no-cache is passed

* update renovate config

* standardize on index.scss, move console styles over

* add support for --no-cache to cli

* include worker config vars in optimizer version

* ignore concatenated modules

* update integration test

* add safari to browserslist to avoid user-agent warnings in dev

* update docs, clean up optimizer message/misc naming

* always handle initialized messages, don't ignore states that are attached to specific events

* reword caching docs, add environment var to disable caching

* tweak logging and don't use optimizer.useBundleCache as that's disabled in dev

* handle change notifications

* batch changes for 1 second

* rename CompilerState type to CompilerMsg

* getChanges() no longer needs to assign changes to dirs

* remove unused deps

* split up run_worker.ts and share cacheKey generation logic

* add a couple docs

* update tests and remove unused imports

* specify files when creating bundle cache key

* remove one more unused import

* match existing dev cli output more closely

* update kbn/pm dist

* set KBN_NP_PLUGINS_BUILT to avoid warning in CI

* avoid extending global window type

* add note to keep pluginScanDirs in sync

* pass browserslistEnv in workerConfig so it is used for cache key

* load commons.bundle.js in parallel too

* emit initialized+success states if all bundles are cached

* load bootstraps as quickly as possible

* skip flaky suite

* bump

* update jest snapshots

* remove hashing from cache key generation

* remove unnecessary non-null assertion

* improve docs and break up Optimizer#run()

* remove unused import

* refactor kbn/optimizer to break up observable logic, implement more helpful cache invalidation logic with logging

* fix tests

* add initializing phase

* avoid rxjs observable constructor

* remove unnecessary rxjs helper, add tests for bundle cache

* update consumers of optimizer

* update readme with new call style

* replace "new platform" with "kibana platform"

* fix a couple more renames

* add support for several plain-text file formats

* fix naming of OptimizerMsg => OptimizerUpdate, use "store" naming too

* one more OptimizerMsg update

* ensure bundles are not cached when cache config is false

* test for initializing states and bundle cache events

* remove unnecessary timeout change

* Remove unnecessary helpers

* Add tests for BundleCache class

* Add tests for Bundle class

* test summarizeEvent$

* missing paths are no longer listed in mtimes map

* add tests for optimizer/cache_keys

* Add some extra docs

* Remove labeled loop

* add integration test for kbn-optimizer watcher components

* querystring-browser removed

* tweak logging a smidge, improve info and final message

* remove unused imports

* remove duplication of getModuleCount() method

* move type annotation that validates things

* clear up the build completion message

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-12 19:42:42 -07:00
Devin W. Hurley
ee6386b71f
[SIEM] [Detection Engine] Reject if duplicate rule_id in request payload (#57057)
* prevents creation of rules when duplicate rule_id is present

* adds unit test to reflect change

* genericizes duplicate discovery functions, allows creation of non-duplicated rules even when duplicates are discovered, keeps same return type signature, updates relevant test for duplicates in request payload

* utilizes countBy and removes reduce in favor of a filter on getDuplicates function

* fix type

* removes skip from e2e test for duplicates on bulk create, updates expected response in e2e test, fixes bug where duplicated error messages appeared for each instance of a duplicated rule_id (found this one through the e2e tests)! Adds unit test to catch this case.

* getDuplicate returns empty array instead of null, removes unnecessary return logic

* removes null coalescing from includes in filter

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-12 21:13:43 -05:00
Brandon Kobel
bc8a41a886
Add autocomplete="off" for input type="password" to appease the scanners (#56922)
* Add autocomplete="off" for input type="password" to appease the scanners

* Using new-password instead of off for the new/confirm passwords

* Setting more autoComplete="new-password" attributes

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-12 16:02:11 -08:00
Ryland Herrick
fef3a2958c
Use default spaces suffix for signals index if spaces disabled (#57244)
Addresses #57221.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-12 17:38:18 -06:00
Andrea Del Rio
0faab4aa48
[Alerting] Create alert design cleanup (#56929) 2020-02-12 14:58:15 -08:00
Matthew Kime
a5d661c7f4
Management Api - add to migration guide (#56892)
* update management info in migration guide
2020-02-12 16:18:59 -06:00
Peter Pisljar
5f8959c52d
fixing maps (#56706) 2020-02-12 16:54:43 -05:00
Nathan Reese
be7daa8057
[Maps] Autocomplete for custom color palettes and custom icon palettes (#56446)
* [Maps] type ahead for stop values for custom color maps and custom icon maps

* use Popover to show type ahead suggestions

* datalist version

* use EuiComboBox

* clean up

* wire ColorStopsCategorical to use StopInput component for autocomplete

* clean up

* cast suggestion values to string so boolean fields work

* review feedback

* fix problem with stall suggestions from previous field

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-12 14:23:47 -07:00