Commit graph

57 commits

Author SHA1 Message Date
Tiago Costa 5e2dbdaa69
refact(NA): remove set loop from upgrade assistant usage collector (#63977)
* refact(NA): use default telemetry obj in the set loop

* chore(NA): fix typecheck

* fix(NA): test run with lodash has

* chore(NA): fix older lodash has

* chore(NA): remove lodash has usage
2020-04-22 14:11:17 +01:00
Rudolf Meijering 00a1144ae2
Refactor Plugins to access elasticsearch from CoreStart (#59915)
* x-pack/watcher: use Elasticsearch from CoreStart

* x-pack/upgrade_assistant: use Elasticsearch from CoreStart

* x-pack/actions: use Elasticsearch from CoreStart

* x-pack/alerting: use Elasticsearch from CoreStart

* x-pack/lens: use Elasticsearch from CoreStart

* expressions: use Elasticsearch from CoreStart

* x-pack/remote_clusters: remove unused Elasticsearch dependency on CoreSetup

* x-pack/oss_telemetry: use Elasticsearch from CoreStart

* Cleanup after #59886

* x-pack/watcher: create custom client only once

* Revert "x-pack/watcher: create custom client only once"

This reverts commit 78fc4d2e93.

* Revert "x-pack/watcher: use Elasticsearch from CoreStart"

This reverts commit b621af9388.

* x-pack/task_manager: use Elasticsearch from CoreStart

* x-pack/event_log: use Elasticsearch from CoreStart

* x-pack/alerting: use Elasticsearch from CoreStart

* x-pack/apm: use Elasticsearch from CoreStart

* x-pack/actions: use Elasticsearch from CoreStart

* PR Feedback

* APM review nits

* Remove unused variable

* Remove unused variable

* x-pack/apm: better typesafety

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-15 17:07:57 +02:00
Mikhail Shustov 5940b72d67
load assets lazily in es-ui plugins (#62487)
* load assets lazily

* addres cj comments
2020-04-06 12:29:11 +02:00
Jean-Louis Leysens 12c8ff78d7
[UA] Tight worker loop can cause high CPU usage (#60950)
* Addded worker padding to save some CPU

* Updated comments

* Update worker scheduler and add a new util

The worker scheduler should only sleep when it cannot process any
in progress operations. Additionally, logic has been added
for handling of queue operations that have been in the queue for
a long time and may be viewed as still in small window of time
by wokers that do not have the credentials to process those
reindex operations.

* res 👉🏻resolve

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-31 17:26:46 +02:00
Alison Goryachev 85481a7017
[UA] Upgrade assistant migration meta data can become stale (#60789) 2020-03-23 13:35:27 -04:00
Jean-Louis Leysens 938ad37640
[Upgrade Assistant] Fix edge case where reindex op can falsely be seen as stale (#60770)
* Fix edge case where reindex op is can falsely be seen as stale

This is for multiple Kibana workers, to ensure that an item just
coming off the queue is seen as "new" we set a "startedAt" field
which will update the reindex op and give it the full timeout
window.

* Update tests to use new api too

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-23 16:47:49 +01:00
Jean-Louis Leysens abc14f5d34
[Upgrade Assistant] Open And Close Slight Refactor (#59890)
* Refactor: Move checking of closed index to single point

We should rather only check if an index is currently closed the
moment before starting to reindex. We still store a flag to
indicate that we opened an index that was closed, but this
should not be set from the reindex handlers because the reindex
task may only start some time later in which case the closed
index could have been opened and our reindex job will open it
and close it again.

* Added debug log

* Added comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-12 11:39:33 +01:00
Jean-Louis Leysens 492a97e288
[Upgrade Assistant] Better handling of closed indices (#58890)
* Exclude disallowed, private setting at index creation

* Remove intl from tabs component

* Added logic for checking the current index status

* Added ES contract integration test

Using _cluster/state is considered internal. This adds an integration
test for checking the contract in CI.

* Add the client side notification for closed indices

* First version of end-to-end functionality working

* Clean up unused, incorrect type information

* Fix type issues and added a comment about the new reindex options

* Fixed server side tests, added comments and logic updates

Updated the handling of reindexOptions to make it more
backwards compatible (treat it as if it could be undefined).

Also update the logic for checking for open or closed indices.
No optional chaining! It should break if the response does not
exactly match.

* Clean up unused code

* Improved idempotency of test and check explicitly for "close".

Rather check for the specific value we want, as this is what is
also gauranteed by the tests. In this way, the information we
send back to the client is also more accurate regarding the index
status. If, in future, more index states are introduced this will
need to be revisited if it affects the ability for an index to be
re-indexed.

* Update client-side tests

* Fix types

* Handle a case where the index name provided may be an alias

* Fix types

* merge-conflict: finish merge conflict resolution

* Update x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/closed_warning_icon.tsx

Co-Authored-By: Alison Goryachev <alisonmllr20@gmail.com>

* merge-conflict: Remove duplicate import

VSCode does not auto-save as expected :sigh:

* ui: Revisit the UI

Moved the warning icon to inside of the button and tooltip to
on the button.

Added a callout to the reindex flyout for when an index is closed.

* logic: slight update to when the index closed callout is shown

We only show the index closed callout in the flyout when the
reindex operation is not considered "completed"

* tests: fix jest tests

* refactor: remove "openAndClose" from reindex endpoints

"openAndClose" should just happen automatically. The user should
not have to pass the flag in, that would be a weird API. We just
need to warn the user about that reindexing a closed index will
take more resources

* test: update upgrade assistant integration test

* fix: types

* copy: use sentence case

* refactor: use the in scope declaration of reindex op

* test: Clean up tests

Reindexing test was generating index name, could just get it from
server response. Also removed openAndClose from all integration
tests

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
2020-03-09 14:11:31 +01:00
Jean-Louis Leysens 651d0a9739
[Upgrade Assistant] Server-side batch reindexing (#58598)
* Added server side logic for handling batch reindex

* Remove literal string interpolation from translation

* Refactor return value of batch endpoint

"sucesses" does not communicate accurately what has happened.
"started" more closely reflects what has happened.

* First iteration of batch queues

* Single queue

Changed the batchqueues implementation to only using a single queue
 - since there is only one ES that it is interacting with.

Before continuing with this work, just making sure that these pre-
cautions are necessary!

* Clean up old batch queue implementation

* Slight refactor

* Revert batch queues implementation

* Introduction of QueueSettings

Queue settings can be set on a reindex operation and set a
timemstamp value on the reindex operation for the scheduler
to use down the line for ordering operations and running them
in series

* Updated worker logic to handle items in queue in series

* Refactor /batch endpoint response to "enqueued" not "started"

* Fixed jest tests

* Refactor worker refresh operations for readability

Created a new file op_utils where logic repsonsible for sorting
and ordering reindex operation saved objects is.

* Add batch API integration test

Also assert that reindexing is happening in the expected order

* Added a new endpoint: GET batch/queue

This allows users of the API to see what the current queue state
is for visibility. Using the queue endpoint int he API integration
tests for batch too.

* Reset the queuedAt timestamp on resume

If a reindexOperation is being resumed and put in a queue we
also need to reset the queuedAt timestamp to respect the new
batch queue ordering.

* Fix jest test

Added 'undefined' as the second optional param to
resumeIndexOperation call.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-06 10:18:21 +01:00
Jean-Louis Leysens ac5e7aa81e
[Upgrade Assistant] Remove "boom" from reindex service (#58715)
* Removed Boom from reindex-service

The reindex service had logic inside it for mapping errors
to HTTP. This has been moved to the route handlers and also
removed Boom.

There is one more instance of Boom use inside of reindex-actions
but that comes from Saved Objects which should probably be removed
at a later stage.

* Fix import path

Specify the full relative import path to the kibana's core
server folder

* Remove unnecessary if statement

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-02 11:08:19 +01:00
Jean-Louis Leysens 899270a108
[Upgrade Assistant] Move out of legacy folder (#58034)
* Create x-pack/plugins skeleton for upgrade assistant

* Move public folder contents

Move the public folder of Upgrade Assistant and migrate public to use HttpSetup (remove axios)

* Include stylesheets in public

* Move server side out of legacy

Begin migration of Reindex worker to new platform

Move imports around so that it satsifies new platform constraints like not importing
server side code (even types) in client.

* Updated the routes with new dependencies and removed server shim

* Fix router unit tests

* Fix server lib tests

After changing function signatures for the reindex server factory (and others) all
of the tests needed to be revisited and brought in line with the new APIs.

Also used core/server mocks where appropriate

* Clean up types issues

* Fix setting credentials on request header

* Removed the security plugin from Upgrade Assistant

The security plugin is a potential future consumer of the Upgrade Assistant's deprecation feature
and we would therefore not want to create a circular depedency here. We pull in the licensing plugin
rather (as it is less likely that we will depend on that) and use it to determine whether security
is available and enabled.

* Migrate to config to new platform config

xpack.upgrade_assistant.enabled

* Remove unused types

* Fix import issue

* Move upgrade assistant back to Elasticsearch management section

* Update dotfiles

Added elasticsearch ui team as upgrade assistant code owner
Updated i18nrc.json path

* Alphabetical ordering in xpack/i18nrc.json

* Implemented PR feedback

Renamed callCluster -> callAsUser to be more consistent
with platform naming.

Added comment about why we are not using security plugin
directly inside of Upgrade Assistant.

Fixed long path imports and use 'src/core/..' throughout.

Fixed import ordering.

Renamed variables inside of telemetry lib.

* Revert to longer import path

In plugin.ts importing from 'kibana/server' or 'src/core/server'
results in a module not found error.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-25 15:31:04 +01:00
Court Ewing 7ac8e4d9cc Move x-pack plugins/server/common to x-pack/legacy 2019-06-20 13:34:48 -04:00
Rudolf Meijering 260d907f90
[Core] Move Saved objects files to core (#38771)
* Move src/legacy/server/saved_objects -> src/core/server/saved_objects

* Fix SavedObject import references after moving files to core

* First pass at SavedObjects api docs

* Expose and import all saved object types through core/server

* Don't expose SavedObjectsManagement from core and fix imports

* Improve typings for SavedObject error helpers

* Fix type errors after master merge

* Fix SavedObjectErrorHelpers tests
2019-06-18 13:10:23 +02:00
Tim Roes 2d37b05a43
Improve jest mocking infrastructure (#38760)
* Always mock metadata/chrome in OSS

* Enable jest env in jest mocks

* Exclude jest mocks in karma bundles

* Use setupFilesAfterEnv in config

* Remove chrome/metadata mock from x-pack

* Remove kuery mock

* Add missing mock to SIEM test

* Fix typo in mock import

* Remove top level capabilities x-pack mock

* Move kfetch mock to ui/public

* Move moment-timezone to mocks file

* Unmock kfetch in kfetch specific tests

* Make kfetch mock manual

* Removed unnecessary jest.mock

* Remove kfetch unmocks
2019-06-14 23:36:51 +02:00
Rudolf Meijering ea9721ad13
[Core] Rewrite saved objects in typescript (#36829)
* Convert simple files to TS

* Fix jest tests

* Rename saved_objects_client{.js => .ts}

* WIP saved_objects_client

* saved_objects repository{.js => .ts}

* includedFields support string[] for type paramater

* Repository/saved_objects_client -> TS

* Fix tests and dependencies

* Fix saved objects type errors and simplify

* saved_objects/index saved_objects/service/index -> ts

* Fix saved objects export test after switching to typed mock

* Workaround type error

* Revert "Workaround type error"

This reverts commit de3252267eb2e6bf56a5584d271b55a7afdc1c53.

* Correctly type Server.savedObjects.SaveObjectsClient constructor

* saved_objects/service/lib/index.{js -> ts}

* saved_objects/service/lib/scoped_client_provider{js -> ts}

* Typescriptify scoped_client_provider

* Fix x-pack jest imports

* Add lodash/internal/toPath typings to xpath

* Introduce SavedObjectsClientContract

We need a way to specify that injected dependencies should adhere to the
SavedObjectsClient "contract". We can't use the SavedObjectsClient class
itself since it contains the private _repository property which in TS is
included in the type signature of a class.

* Cleanup and simplify types

* Fix repository#delete should return {}

* Add SavedObjects repository test for uncovered bug

Test for a bug in our previous js implementation that can lead to data
corruption and data loss.

If a bulkGet request is made where one of the objects to fetch is of a type
that isn't allowed, the returned result will include documents which have the
incorrect id and type assigned. E.g. the data of an object with id '1' is
returned with id '2'. Saving '2' will incorrectly override it's data with that
of the data of object '1'.

* SavedObject.updated_at: string and unify saved_object / serializer types

* Cleanup

* Address code review feedback

* Don't mock errors helpers in SavedObjectsClient Mock

* Address CR feedback

* CR Feedback #2

* Add kibana-platform as code owners of Saved Objects

* Better typings for SavedObjectsClient.errors

* Use unknown as default for generic type request paramater

* Bump @types/elasticsearch

* Fix types for isForbiddenError

* Bump x-pack @types/elasticsearch
2019-06-06 10:49:13 +02:00
Chris Roberson c87e8811cb
[Monitoring/Telemetry] Force collectors to indicate when they are ready (#36153)
* Initial code to force collectors to indicate when they are ready

* Add and fix tests

* Remove debug

* Add ready check in api call

* Fix prettier complaints

* Return 503 if not all collectors are ready

* PR feedback

* Add retry logic for  usage collection in the reporting tests

* Fix incorrect boomify usage

* Fix more issues with the tests

* Just add debug I guess

* More debug

* Try and handle this exception

* Try and make the tests more defensive and remove console logs

* Retry logic here too

* Debug for the reporting tests failure

* I don't like this, but lets see if it works

* Move the retry logic into the collector set directly

* Add support for this new collector

* Localize this

* This shouldn't be static on the class, but rather static for the entire runtime
2019-05-20 13:03:24 -04:00
Chandler Prall d449ff4e3f
Update EUI 10.1.0 -> 10.3.1 (#35970) 2019-05-02 12:27:36 -06:00
Greg Thompson e05098dd27
Upgrade EUI to v10.0.1 (#35112)
* eui@10.0.0; tsconfig update

* limit key lookups to strings

* Search Profiler hightlight details flyout classes

* bump

* snapshot updates

* x-pack snapshot updates
2019-04-17 09:16:34 -05:00
Tyler Smalley 98e6c99799
[UA] Specify allow_restricted_indices for _has_privileges (#35125)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2019-04-16 09:33:44 -07:00
Josh Dover 5e32992a54
[UA] Show different interstital text when cluster is upgraded (#34762) 2019-04-09 09:54:17 -05:00
Tiago Costa ed795d28ee
Migrate from tslint (#33826)
* chore(NA): remove tslint dependencies, configs and enable eslint typescript parser.

* fix(NA): apply recommend eslint typescript rule.s

* chore(NA): upgrade eslint package versions.

* chore(NA): split javascript eslint config in an override section.

* chore(NA): split all eslint configs with overrides.

* chore(NA): remove missing console.log.

* chore(NA): change eslint splits and overrides order.

* chore(NA): replace tslint disable comments with eslint ones.

* chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export

* chore(NA): fixed multiple eslint typescript rule failures.

* chore(NA): add tarfet folder to the eslint ignore.

* chore(NA): apply prettier rule to ts type file.

* chore(NA): remove last mentions to tslint

* chore(NA): add old defined rules

* chore(NA): missing port rules website

* chore(na): ordered rules

* chore(NA): solved eslint typescript problems.

* chore(NA): fix spaced comment problems.

* chore(NA): fix some more eslint typescript rules: import/order no-empty-interface

* chore(NA): fix last rules and comment out what are the ones still failing.

* chore(NA): comment out camelcase rule.

* chore(NA): regenerate kbn pm dist.

* chore(NA): updated snapshots.

* chore(NA): updated snapshots.

* chore(NA): disabled sort-keys rule.

* chore(NA): remove rule prefer-arrow/prefer-arrow-functions.

* chore(NA): fix for @typescript-eslint/no-var-requires rule.

* chore(NA): fixes for @typescript-eslint/camelcase rule.

* chore(NA): fix typo on eslint config kibana typescript.

Co-Authored-By: mistic <tiagoffcc@hotmail.com>

* chore(NA): remove legacy note after the intellij upgrade to 2019.1

* fix(NA): import order plugin.

* chore(NA): fix ts ignore positions after auto fix.

* fix(NA): performance issue with typescript eslint.

* refact(NA): eslint configs organization.

* chore(NA): apply resticted paths to ts files too.

* chore(NA): split comment from eslint ignore.
2019-04-05 17:45:23 +01:00
Tyler Smalley 1b95bed2da
[linting] Enforce relative paths for X-Pack modules (#34349)
* Add module-migration support for toRelative

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* tslint fixes

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Move configuration to root

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Simplify root definition

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2019-04-02 10:08:13 -07:00
Tiago Costa 20bdf7d4a9
Migration to Babel7 and @babel/preset-typescript (#33093)
* chore(NA): first changes on every package.json order to support new babel 7. chore(NA): build for kbn-pm with babel 7.

* chore(NA): patch babel register to load typescrit

* chore(NA): first working version with babel 7 replacing typescript compiler.

* fix(NA): common preset declaration in order to make it work with babel-loader.

* chore(na): organizing babel preset env package json.

* chore(NA): mocha tests enabled.

* fix(NA): typo on importing

* test(NA): majority of x-pack tests ported to use babel-jest

* fix(NA): report info button test with babel-jest.

* fix(NA): polling service tests.

* test(na): fix server plugins plugin tests.

* test(NA): batch of test fixs for jest tests under babel-jest hoisting.

* chore(NA): add babel plugin to hoist mock prefixed vars on jest tests.

* chore(NA): update yarn.lock file.

* chore(NA): tests passing.

* chore(NA): remove wrong dep

* chore(NA): fix tsconfig

* chore(NA): skip babel for ts-jest.

* chore(NA): selectively apply the plugin to strip off namespace from ts files.

* chore(NA): remove not needed changes from ts tests

* chore(NA): removed ts-jest dependency. chore(NA): migrate ts tests on x-pack to use babel-jest with the new pattern.

* chore(NA): migrate kibana default distribution typescript tests to run with babel-jest and the new test mock pattern.

* chore(NA): merge and solve conflicts with master.

* chore(NA): fix problems reported by eslint

* chore(NA): fix license ovveride for babel-plugin-mock-imports

* chore(NA): update jest integration tests for kbn pm

* chore(NA): update babel jest integration tests for kbn pm.

* test(NA): update jest integration snapshot for kbn pm.

* chore(NA): apply changes according to the pull request reviews.

* chore(NA): apply changes according to the pull request reviews.

* refact(NA): migrate jest tests to the new pattern.

* fix(NA): babel 7 polyfill in the tests bundle.

* chore(NA): restore needed step in order to compile x-pack with typescript.

* chore(NA): change build to compile typescript with babel for the oss code. chore(NA): change transpile typescript task to only transpile types for x-pack. refact(NA): common preset for babel 7

* Revert "chore(NA): change build to compile typescript with babel for the oss code. chore(NA): change transpile typescript task to only transpile types for x-pack. refact(NA): common preset for babel 7"

This reverts commit 2707d538f5.

* fix(NA): import paths for tabConfigConst

* chore(NA): fix transpiling error on browser tests

* chore(NA): simplify kbn babel preset package.

* chore(NA): migrate build to use babel transpiler for typescript excluding xpack.

* fix(NA): introduced error on test quick task.

* fix(NA): fix preset for client side code on build.

* fix(NA): build with babel

* fix(NA): negated patterns in the end.

* fix(NA): kbn_tp_sample_panel_action creation.

* fix(NA): babel typescript transform plugin workaround when exporting interface name.

* refact(NA): remove not needed type cast to any on jest test.

* docs(NA): add developement documentation about jest mocks test pattern.

* chore(NA): missing unmerged path.

* chore(NA): fix jest tests for template.

* [CCR] Client integration tests (table lists) (#33525)

* Force user to re-authenticate if token refresh fails with `400` status code. (#33774)

* Improve performance of the Logstash Pipeline Viewer (#33793)

Resolves #27513.

_This PR is a combination of #31293 (the code changes) + #33570 (test updates). These two PRs were individually reviewed and merged into a feature branch. This combo PR here simply sets up the merge from the feature branch to `master`._

Summary of changes, taken from #31293:

## Before this PR
The Logstash Pipeline Viewer UI would make a single Kibana API call to fetch all the information necessary to render the Logstash pipeline. This included information necessary to render the detail drawer that opens up when a user clicks on an individual vertex in the pipeline.

Naturally, this single API call fetched _a lot_ of data, not just from the Kibana server but also, in turn, from Elasticsearch as well. The "pro" of this approach was that the user would see instantaneous results if they clicked on a vertex in a pipeline and opened the detail drawer for that vertex. The "cons" were the amount of computation Elasticsearch had to perform and the amount of data being transferred over the wire between Elasticsearch and the Kibana server as well as between the Kibana server and the browser.

## With this PR
This PR makes the Kibana API call to fetch data necessary for **initially** rendering the pipeline — that is, with the detail drawer closed — much lighter. When the user clicks on a vertex in a pipeline, a second API call is then made to fetch data necessary for the detail drawer.

## Gains, by the numbers

Based on a simple, 1-input, 1-filter, and 1-output pipeline.

* Before this PR, the Elasticsearch `logstash_stats` API responses (multiple calls were made using the `composite` aggregation over the `date_histogram` aggregation) generated a total of 1228 aggregation buckets (before any `filter_path`s were applied but across all `composite` "pages"). With this PR, the single `logstash_stats` API response (note that this is just for the initial rendering of the pipeline, with the detail drawer closed) generated 12 buckets (also before any `filter_path`s were applied). That's a **99.02% reduction** in number of buckets.

* Before this PR, the Elasticsearch `logstash_stats` API responses added up to 70319 bytes. With this PR, the single `logstash_stats` API response for the same pipeline is 746 bytes. That's a **98.93% reduction** in size.

* Before this PR, the Elasticsearch `logstash_state` API response was 7718 bytes. With this PR, the API response for the same pipeline is 2328 bytes. That's a **69.83% reduction** in size.

* Before this PR the Kibana API response was 51777 bytes. With this PR, the API response for the same pipeline is 2567 bytes (again, note that this is just for the initial rendering of the pipeline, with the detail drawer closed). That's a **95.04% reduction** in size.

* [Maps] split settings into layer and source panels (#33788)

* [Maps] split settings into layer and source panels

* fix SCSS import

* [env] exit if starting as root (#21563)

* [env] exit if starting as root

* fix windows

* s/--allow-root

* Typescript sample panel action (#33602)

* Typescript sample panel action

* Update EUI version to match main cabana version

* update yarn.lock

* add back typings include

* use correct relative path

* Home page "recent links" should communicate saved object type #21896 (#33694)

* adds object type for screen order
* adds object type for pointer hovering
* Update src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx

Co-Authored-By: rockfield <philipp.b@ya.ru>
2019-03-26 20:44:03 +00:00
Jason Rhodes 721161f3d1
Upgrades EUI to 9.5 (#33672)
* Updates EUI to 9.5.0

* Remove duplicate type

* Updates snapshots and fixes a few type errors

* Updates x-pack snapshots
2019-03-22 10:28:37 -04:00
Josh Dover 14cce19c67
[UA] Move Kibana stacktrace from UI to logs (#33150) 2019-03-20 12:16:38 -05:00
Josh Dover 689bba3c86
[UA] Handle privilege error during node precheck (#33176)
* [UA] Handle privilege error during node precheck

* Fix tests
2019-03-13 17:09:39 -05:00
Josh Dover 4a45262d20
[UA] Add searching by index and node to UI, fixes #32075 (#33065) (#33087) 2019-03-13 11:20:28 -05:00
Josh Dover 3c60eb1165 [UA] Make reindex error handle more robust (#33060) 2019-03-12 22:34:54 -07:00
dave.snider@gmail.com 3ada0259cc
Eui/9.2.1 + better dark mode (#32728)
Updates EUI and makes some dark mode adjustments.
2019-03-11 12:36:06 -07:00
Jason Rhodes ae754ac607
Upgrades EUI to 9.x (#32009)
* Fixed a simple argument bug and removed infra date picker EUI types

* Fixes for EUI date picker types

* eui_8.0.0

* fix type errors in query_bar

* Small changes for EUI types

* Updates EUI to 9.0.0 and removes @types/react-datepicker as it now ships with EUI

* Updates to EUI 9.0.1 and removes duplicate types in infra eui.d.ts

* ts-ignore applied to ongoing type error with styled components and EUI

* Changes EuiProgress props to avoid TS errors

* Updates EUI 9.0 snapshots

* Updates kibana root snapshots for EUI 9.0 upgrade

* Update detail_panel.test.js for EUI changes

* Updated functioanl and unit tests to properly inspect EuiTableRowCell rendered values

* Fix docs_level_security_roles.js func tests

* Update EUI to 9.0.2

* Fixed failing snapshot for EUI icon default prop
2019-03-07 07:03:11 -05:00
Mikhail Shustov 5fc7addac5
Update jest to v24 (#31825)
* udpate jest, jest-cli, @types/jest to v24

* fix type error in kibana-i18n package

* return serivce explicitly to fix typings

* add explicit never

* suppress typings errors

* update jest versions in x-pack

* make tests in x-pack more robust and fix incompatibility

* suppress CallCluster mock typings

Mock interface doesn't match CallCluster. Requires
additional work

* x-pack. resolve other typing conflicts

* remove unused types/jest

* fix snapshots

* restore mocks after jest.spyOn

* remove outdated definitions for jest

* cleanup x-pack package.json and update @types/jest

* fix tests merged from master

* updated yarn.lock and log errors for scripts/type_check

* This commit fixes error in TS, which failed on parsing the file.

* suppress type errors from master

* jest-cli is devDep
2019-02-28 13:26:16 +01:00
Tyler Smalley cadec2326c
[UA] Support previously re-indexed ML/Watcher indices (#31046)
* [UA] Support previously re-indexed ML/Watcher indices

Previously we were comparing the start of the indices to determine if ML/Watcher
should be stopped before re-indexing. Since we are now pre-pending the index
name we should compare the index names without the re-indexed portion.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2019-02-22 14:35:19 -08:00
Tyler Smalley fc55ca5d60
[UA] Protects against Cloud plugin being disabled (#31637)
Currently, if the Cloud plugin is disabled the server will fail to start

Fixes #31612

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2019-02-22 10:06:24 -08:00
Josh Dover 46edc4fe8c
Show interstitial prompt when ES is upgrading (#31309)
* Show interstitial prompt when ES is upgrading

* Update copy
2019-02-21 14:05:16 -06:00
Josh Dover 951ab5bb53
[upgrade] Localize reindexing flyout in Upgrade Assistant (#30432) 2019-02-19 09:56:10 -06:00
Matthew Kime 317834738e
restore upgrade assistant data test subj (#29775)
* restore upgrade assistant data test subj

* move data-test-subj to wrapping div

* remove unneeded class

* Update app.tsx

* Update app.tsx

* Update app.tsx
2019-02-14 11:51:38 -06:00
Court Ewing 2ce51a5be5 Update paths to ui, server, deprecation, plugin_discovery in src/legacy
This commit accompanies the four that precede it. Rather than squash
them altogether, the four previous commits all do nothing except move
files to help avoid conflicts.
2019-02-11 10:41:37 -05:00
Tyler Smalley f741137c99
Resets Upgrades Assistant in preperation for 9.0 (#30334)
**Removes APM reindexing**: Since indices created in 6.x will be required to
re-index in 7.x there is no longer a need to support migrating APM indices to
the ECS format since ECS is shipped starting in 7.0

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2019-02-08 13:08:06 -08:00
Tyler Smalley c16849dc3b
Support for reindexing APM indices (#29845)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2019-02-05 19:47:48 -08:00
Tyler Smalley c20bb3a0d4
Reindexing prepends to index name instead of appending (#30114) (#30166)
Similar to what is done in the Index Lifecycle Management, we prepend as to
avoid possible issues with conflicts in index patterns, templates, etc.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2019-02-05 18:48:54 -08:00
Caroline Horn f8c7320277
EUI 6.10.0 & Background color fixes (#30136)
* First foray into turning .application background off

* Hopefully fixing the last few plugins

* Update EUI to 6.9.0

* removing hacks

* last fixes

* Remove a few more `100vh`

* Can I remember to copy & REPLACE

* EUI at 6.10.0
2019-02-05 21:29:30 -05:00
CJ Cenizal 2f92df5ee3
Add configPrefix to Index Management, License Management, Rollup Jobs, and Upgrade Assistant. (#30149) 2019-02-05 15:00:18 -08:00
Josh Dover d166001a88
[upgrade] Add cancel button to reindexing (#29913) 2019-02-05 00:19:13 -06:00
Josh Dover 20ffce229b
Filter out security realm deprecations on Cloud (#30018) 2019-02-05 00:17:47 -06:00
Spencer b4725b7d34
Remove dependency on doc versions (#29906)
See https://github.com/elastic/elasticsearch/pull/38254

Using the `version` parameter to implement optimistic concurrency is not going to be supported in 7.0, so we need to replace our usage of document version with the new `_seq_no` and `_primary_term` parameters. These fields are returned in the same way that `_version` was returned on all read/write requests except for search, where it needs to be requested by sending `seq_no_primary_term: true` in the body of the search request. These parameters are sent back to Elasticsearch on write requests with the `if_seq_no` and `if_primary_term` parameters, and are functionally equivalent to sending a `version` in a write request before elastic/elasticsearch#38254.

To make these updates I searched the code base for uses of a `version` and `_version`, then triaged each usage, so I'm fairly confident that I got everything but it's possible something slipped through the cracks, so if you know of any usage of the document version field please help me out by double checking that I converted it.

- [x] **Saved Objects**:  @elastic/kibana-platform, @elastic/es-security - for BWC and ergonomics the `version` provided by the Saved Objects client/API was not removed, it was converted from a number to a string whose value is `base64(json([_seq_no, _primary_term]))`. This allows the Saved Objects API and its consumers to remain mostly unmodified, as long as the underlying value in the version field is irrelevant. This was the case for all usages in Kibana, only thing that needed updating was tests and TS types.

- [x] **Reporting/esqueue**: @joelgriffith, @tsullivan - the version parameter was used here specifically for implementing optimistic concurrency, and since its usage was contained within the esqueue module I just updated it to use the new `_seq_no` and `_primary_term` fields.

- [x] **Task Manager**: @tsullivan @njd5475 - Like esqueue this module uses version for optimistic concurrency but the usage is contained with the module so I just updated it to use, store, and request the `_seq_no` and `_primary_term` fields.

- [ ] **ML**: @elastic/ml-ui - Best I could tell the only "version" in the ML code refers to the stack version, 077245fed8

- [ ] **Beats CM**: @elastic/beats - Looks like the references to `_version` in the code is only in the types but not in the code itself. I updated the types to use `_seq_no` and `_primary_term`, and their camelCase equivalents where appropriate. I did find a method that used one of the types referencing version but when investigating its usage it seemed the only consumer of that method was itself so i removed it. 52d890fed7

- [x] **Spaces (tests)**: @elastic/kibana-security - The spaces test helpers use saved objects with versions in a number of places, so I updated them to use the new string versions where the version was predictable, and removed the assertion on version where it wasn't. We test the version in the saved objects code so this should be fine.
2019-02-04 21:13:34 -08:00
Tiago Costa 64334ca26e
Upgrade assistant telemetry (#28878)
* feat(NA): very first version with telemetry working for the upgrade assistant.

* refact(NA): import all types from a file and rewrite first version code.

* chore(NA): missing types for register and makeCollector functions.

* test(NA): tests for upgrade assistant telemetry routes.

* refact(NA): extra spaces on imports and imports order.

* test(NA): for ui_open saved objects on upgrade assistant telemetry.

* test(NA): for usage_collector functions.

* chore(NA): change the return object into the upgrade assistant telemetry.

* chore(NA): fix type imports.

* fix(NA): importing saved objects client types.

* refact(NA): simplify saved objects schema for upgrade assistant telemetry.

* feat(NA): only send upgrade assistant metrics after we have data. Never send telemetry info about a clicked tab if it is the current selected one.

* fix(NA): typo on word

* feat(NA): add telemetry schema support for for ui_reindex.

* test(NA): update integration test fixture to include new telemetry stats.

* chore(NA): fix mappings for ui_reindex.

* refact(NA): invest telemetry local expect data order.

* chore(NA): includeDefaults for callCluster.

* chore(NA): remove ignore 404 from callCluster.

* refact(NA): wrap get logging status from cluster settings into a function.

* feat(NA): add reindex ui telemetry.

* fix(NA): typo on mappings. fix(NA): non wait for send telemetry to complete will cause es doc errors when increment counters

* test(NA): wait for telemetry requests to end before esArchiver.unload on functional tests.

* refact(NA): remove bad added async to tabs onclick function.
2019-02-04 21:24:31 +00:00
Josh Dover 888217dc0f
Upgrade Assistant Follow-ups (#29663)
* Check security privileges before allowing reindexing

* Add global readyForUpgrade flag for Cloud

* Add ml_settings to cluster_settings

* Generalize locking mechanism for stop/starting watcher

* Display ML/Watcher stopping/resuming steps in UI

* Fix type issues

* Handle security being disabled for privilege check

* Use xpack_main.info + add types

* Fix x-pack builds
2019-02-04 13:36:42 -06:00
Aleh Zasypkin d05437703d
Introduce I18nService core service and I18nContext. (#29379) 2019-02-04 13:38:00 +01:00
Josh Dover c0a2e8014e
Make ReindexWorker resilient to ES connection issues (#29908) 2019-02-02 12:11:25 -06:00
Josh Dover 908db0de07
[7.0] Add reindex feature to Upgrade Assistant (#27457) (#29516) 2019-01-29 17:55:35 -06:00