Commit graph

7381 commits

Author SHA1 Message Date
Patrick Mueller 7db4196164
[Alerting] add more alert properties to action parameter templating (#59718)
This is a pre-cursor to https://github.com/elastic/kibana/issues/58529

I realized a bit ago that we weren't making quite enough info available
in the action parameter templating that happens when alerts schedule
actions to execute.  Missing were alert name, tags, and spaceId.

For the index threshold alert, I had added them to it's context, but
then every other action would have to do the same if they also
wanted those values.

So I added these as additional top-level variables that can be
used in templates, along with the alert id, alert instance id,
context, and state.  The other bits in RawAlert didn't seem
that interesting, to be used as an action parameter.
2020-03-10 16:50:19 -04:00
dave.snider@gmail.com 8c0da24e6c
[Design] Branding changes in Elastic to focus more towards the Elastic brand (#58160)
Elastic Kibana branding.
2020-03-10 13:33:21 -07:00
MadameSheema 0f71886f83
[SIEM] Adds 'Create new rule' Cypress test (#59790)
* adds 'Creates and activates new rule'

* loads data using es_archive

* refactor test
2020-03-10 21:03:48 +01:00
Greg Thompson 4e52deeca3
Use EUI test environment build with Jest (#55877)
* wip

* dir name

* src snapshot changes

* x-pack snapshots

* svg element lookups

* snapshot updates

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 13:48:49 -05:00
Steph Milovic ecac63f258
[SIEM] [Case] Insert timeline into case textarea (#59586) 2020-03-10 11:49:55 -06:00
Robert Oskamp 8bc051ac49
[ML] Functional tests - stabilize saved search tests (#59652)
This PR stabilizes the saved search functional UI tests by adding a retry to navigateToApp('ml')
2020-03-10 18:10:59 +01:00
marshallmain 435cb0b959
[Endpoint] Sample data generator for endpoint app (#58936)
* scaffolding and notes.md

* add skeleton event generator to kibana

* add optional entityID param to generateEvent

* add tree generation

* add tests

* working tests

* fix up tests

* fix linting

* fix event types

* make process parent types consistent

* make generator match types

* move test resolver node out of common types

* fix random string generation

* fix typecheck errors

* remove extraneous stuff

* address PR comments

* add test for full resolver tree

* cleanup

* make tests clearer

* add seedrandom to endpoint plugin. contains DONOTMERGE example code

* remove robs test

* start replacing random with seedrandom

* use seeded random for uuidv4

* separate out IP randomization

* typecheck fixes

Co-authored-by: oatkiller <robert.austin@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 12:31:57 -04:00
Zacqary Adam Xeper 5ad8337634
[Metrics Alerts] Add support for search query and groupBy on alerts (#59388)
* Add filterQuery to metric alert params

* Add groupBy alert support

* Fix typings

* Fix malformed query

* Fix filterQuery merge

* Fix groupBy afterkey insertion, add group name to alert action

* Convert iife to getter

* Fix type check

* Fix type check again

* Remove unnecessary order param
2020-03-10 10:45:57 -05:00
Walter Rafelsberger ec1f46bdbd
[ML] Transforms: Data grid fixes. (#59538)
- Fixes data grid schemas to avoid crashing the page.
- Fixes date formatting.
- Uses data grid for preview table in transform list.
2020-03-10 15:52:17 +01:00
Ryland Herrick b56cd41412
[SIEM] Fix and consolidate handling of error responses in the client (#59438)
* Convert our manual throwing of TypeError to a custom Error

Throwing a TypeError meant that our manual errors were indistinguishable
from, say, trying to invoke a method on undefined. This adds a custom
error, BadRequestError, that disambiguates that situation.

* Present API Error messages to the user

With Core's new HTTP client, an unsuccessful API call will raise an
error containing the body of the response it received. In the case of
SIEM endpoints, this will include a useful error message with
potentially more specificity than e.g. 'Internal Server Error'.

This adds a type predicate to check for such errors, and adds a handling
case in our errorToToaster handler.

If the error does not contain our SIEM-specific message, it will fall
through as normal and the general error.message will be displayed in the
toaster.

* Remove unnecessary use of throwIfNotOk in our client API calls

The new HTTP client raises an error on a 4xx or 5xx response, so there
should not be a case where throwIfNotOk is actually going to throw an
error.

The established pattern on the frontend is to catch errors at the call
site and handle them appropriately, so I'm mainly just verifying that
these are caught where they're used, now.

* Move errorToToaster and ToasterError to general location

These were living in ML since that's where they originated. However, we
have need of it (and already use it) elsewhere.

The basic pattern for error handling on the frontend is:
1) API call throws error
2) caller catches error and dispatches a toast

throwIfNotOk is meant to convert the error into a useful message in 1).
We currently use both errorToToaster and displayErrorToast to display
that in a toaster in 2)

Now that errorToToaster handles a few different types of errors, and
throwIfNotOk is going to be bypassed due to the new client behavior of
throwing on error, we're going to start consolidating on:

1) Api call throws error
2) caller catches error and passes it to errorToToaster

* Refactor Rules API functions to not use throwIfNotOk

* Ensures that all callers of these methods properly catch errors
* Updates error toasterification to use errorToToaster
* Simplifies tests now that we mainly just invoke the http client and
return the result.

throwIfNotOk is not being used in the majority of cases, as the client
raises an error and bypasses that call.

The few cases this might break are where we return a 200 but have errors
within the response. Whether throwIfNotOk handled this or not, I'll need
a simpler helper to accomplish the same behavior.

* Define a type for our BulkRule responses

These can be an array of errors OR rules; typing it as such forces
downstream to deal with both. enableRules was being handled correctly
with the bucketing helper, and TS has confirmed the rest are as well.

This obviates the need to raise from our API calls, as bulk errors are
recoverable and we want to both a) continue on with any successful rules
and b) handle the errors as necessary. This is highly dependent on the
caller and so we can't/shouldn't handle it here.

* Address case where bulk rules errors were not handled

I'm not sure that we're ever using this non-dispatch version, but it was
throwing a type error. Will bring it up in review.

* Remove more throwIfNotOk uses from API calls

These are unneeded as an error response will already throw an error to
be handled at the call site.

* Display an error toaster on newsfeed fetch failure

* Remove dead code

This was left over as a result of #56261

* Remove throwIfNotOk from case API calls

Again, not needed because the client already throws.

* Update use_get_tags for NP

* Gets rid of throwIfNotOK usage
* uses core http fetch

* Remove throwIfNotOk from signals API

* Remove throwIfNotOk

This served the same purpose as errorToToaster, but in a less robust
way. All usages have been replaced, so now we say goodbye.

* Remove custom errors in favor of KibanaApiError and isApiError type predicate

There was no functional difference between these two code paths, and
removing these custom errors allowed us to delete a bunch of associated
code as well..

* Fix test failures

These were mainly related to my swapping any remaining fetch calls with
the core router as good kibana denizens should :salute:

* Replace use of core mocks with our simpler local ones

This is enough to get our tests to pass. We can't use the core mocks for
now since there are circular dependencies there, which breaks our build.

* add signal api unit tests

* privilege unit test api

* Add unit tests on the signals container

* Refactor signals API tests to use core mocks

* Simplifies our mocking verbosity by leveraging core mocks
* Simplifies test setup by isolating a reference to our fetch mock
* Abstracts response structure to pure helper functions

The try/catch tests had some false positives in that nothing would be
asserted if the code did not throw an error. These proved to be masking
a gap in coverage for our get/create signal index requests, which do not
leverage `throwIfNotOk` but instead rely on the fetch to throw an error;
once that behavior is verified we can update those tests to have our
fetchMock throw errors, and we should be all set.

* Simplify signals API tests now that the subjects do less

We no longer re-throw errors, or parse the response, we just return the
result of the client call. Simple!

* Simplify API functions to use implict returns

When possible. Also adds missing error-throwing documentation where
necessary.

* Revert "Display an error toaster on newsfeed fetch failure"

This reverts commit 64213221f5.

* Error property is readonly

* Pull uuid generation into default argument value

* Fix type predicate isApiError

Uses has to properly inspect our errorish object. Turns out we have a
'message' property, not an 'error' property.

* Fix test setup following modification of type predicate

We need a message (via new Error), a body.message, and a
body.status_code to satisfy isApiError.

Co-authored-by: Xavier Mouligneau <189600+XavierM@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 09:11:17 -05:00
Nathan Reese eb533c8211
[Maps] convert tooltip classes to typescript (#59589)
* getting started

* fix ts lint errors

* TS es_tooltip_property

* convert ESAggTooltipProperty to TS

* final clean up

* ts lint cleanup

* review feedback

* remove unused import

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 07:33:20 -06:00
Robert Oskamp 848188e517
[ML] Functional tests - re-activate date_nanos test (#59649)
This PR re-activates the date_nanos functional UI test.
2020-03-10 14:15:20 +01:00
Corey Robertson e982bed7c6
Move canvas to use NP Expressions service (#58387)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-10 09:11:58 -04:00
Anton Dosov 8a3e9c6b32
[Unit Testing] Configure react-testing-library queries to use Kibana's data-test-subj instead of default data-testid (#59445) 2020-03-10 13:16:58 +01:00
Kerry Gallagher 565dd25a8b
[Logs / Metrics UI] Link handling / stop page reloads (#58478)
* Add a hook for seamlessly handling onClick and href props of links, buttons etc

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
2020-03-10 10:36:13 +00:00
Pierre Gayvallet f1272b5ffe
Add SavedObject management section registration in core (#59291)
* add management section to SavedObjectsType

* adapt import/export routes to get types accessor

* add documentation

* update generated doc

* update migration guide

* use request context to access exportable types

* update generated doc

* adapt SavedObjectsManagement to use the registry

* stop magical tricks about the config type, register it as any other so type.

* fix FTR assertions

* fix so_mixin tests

* register the `config` type from the uiSettings service

* nits and comments

* update generated doc

* remove true from dynamic property definition, use force-cast back for config type

* remove obsolete test comment
2020-03-10 11:13:45 +01:00
Oliver Gupte 35bcb36ee6
Fixes #59513 by hiding one of the symmetric edges rather than omiting it (#59514)
in cytoscape graph. Also selects root nodes with no incoming edges
rather than just unconnected nodes.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-09 23:55:44 -07:00
Patrick Mueller 3f365a82f8
[Alerting] replace watcher http APIs used by index threshold Alerting (#59475)
Prior to this PR, the alerting UI used two HTTP endpoints provided by the
Kibana watcher plugin, to list index and field names.  There are now two HTTP
endpoints in the alerting_builtins plugin which will be used instead.

The code for the new endpoints was largely copied from the existing watcher
endpoints, and the HTTP request/response bodies kept pretty much the same.

resolves https://github.com/elastic/kibana/issues/53041
2020-03-09 19:30:20 -04:00
Vadim Dalecky 405b0fa30c
chore: 🤖 hide Drilldowns in master (#59698) 2020-03-09 22:10:46 +01:00
Robert Austin 12a3ccf565
Use HTTP request schemas to create types, use those types in the client (#59340)
* wip

* wip

* wip

* will this work?

* wip but it works

* pedro

* remove thing

* remove TODOs

* fix type issue

* add tests to check that alert index api works

* Revert "add tests to check that alert index api works"

This reverts commit 5d40ca18337cf8deb63a0291150780ec094db016.

* Moved schema

* undoing my evils

* fix comments. fix incorrect import

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-09 13:23:22 -04:00
Thomas Neirynck 6e5e8c815e
[Maps] Support categorical styling for numbers and dates (#57908) 2020-03-09 13:22:30 -04:00
Robert Oskamp 4bd7b36431
[ML] Functional API tests - bucket span estimation with custom search.max_buckets (#59665)
This PR adds functional API tests for the bucket span estimation endpoint with a transient or persistent `search.max_buckets` setting.
2020-03-09 18:03:47 +01:00
CJ Cenizal 239ca74fc9
Fix slm_ui setting by changing camel case back to snake case. (#59663) 2020-03-09 09:55:59 -07:00
James Gowdy 8a4bb61f05
[ML] Fixes bucket span estimators loading of max_buckets setting (#59639)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-09 14:43:23 +00:00
James Gowdy 92cc04c7df
[ML] Refactoring anomaly detector job types (#59556)
* [ML] Refactoring anomaly detector job types

* removing calendar type

* update validateCardinality

* fixing test

* updating  types in functional tests

* using state constants
2020-03-09 13:51:07 +00: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
Peter Pisljar a6489aa70e
additional visualizations plugin cleanup before moving to NP (#59318) 2020-03-09 13:11:05 +01:00
Mikhail Shustov 5c436534d6
Add an optional authentication mode for HTTP resources (#58589)
* add authRequred: 'optional'

* expose auth status via request context

* update security plugin to use notHandled auth outcome

* capabilities service uses optional auth

* update tests

* attach security headers only to unauthorised response

* add isAuthenticated tests for 'optional' auth mode

* security plugin relies on http.auth.isAuthenticated to calc capabilities

* generate docs

* reword test suit names

* update tests

* update test checking isAuth on optional auth path

* address Oleg comments

* add test for auth: try

* fix

* pass isAuthenticted as boolean via context

* remove response header from notHandled

* update docs

* add redirected for auth interceptor

* security plugin uses t.redirected to be compat with auth: optional

* update docs

* require location header in the interface

* address comments #1

* declare isAuthenticated on KibanaRequest

* remove auth.isAuthenticated from scope

* update docs

* remove unnecessary comment

* do not fail on FakrRequest

* small improvements
2020-03-07 11:55:20 +01:00
Matthew Kime 74f9b448f7
Implement embeddable drilldown menu options (#59232)
* Implement embeddable drilldown menu options
2020-03-06 20:58:24 -06:00
Andrea Del Rio 55fa3d6f42
[Alerting] "Create alert" graph visualization design improvements (#59399) 2020-03-06 18:29:17 -08:00
Yuliia Naumenko b960c6aff7
Alerting update route throttle property is missing (#59580)
* Added throttle property to update method of alertClient

* Fixed failing snapshot

* Fixed type check errors

* Fixed null update for siem throttle
2020-03-06 17:21:21 -08:00
MadameSheema 9ab4aa027c
[SIEM] Adds 'Load prebuilt rules' Cypress test (#59529)
* adds 'load prebuilt rules'

* fixes typecheck issue

* updates jest snapshot
2020-03-06 22:41:05 +01:00
Brian Seeders dd9999bf5d
Check for alert dialog when doing a force logout (#59329) 2020-03-06 16:03:41 -05:00
Spencer 76c205cd1e
ensure fs deletes are not cwd dependent (#59570)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-03-06 11:54:49 -07:00
Nathan L Smith 0d3dd97691
Empty message for APM service map (#59518)
When only one node is displayed, show an empty message.

Also:

* Start adding a basic Jest test for the ServiceMap component
* Fix bug where EuiDocsLink was rendering "children" instead of the actual children

Closes #59326.
Closes #59128.
2020-03-06 12:54:28 -06:00
Anton Dosov 3c4cf56008
[Drilldowns] <ActionWizard/> Component (#59032) 2020-03-06 19:46:47 +01:00
Tim Sullivan fbbb3f8091
[Reporting] Improve the page exit error messages (#59351)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-06 11:43:15 -07:00
Brian Seeders 8fa9962641
Ensure logged out starting state for tests that need it (#59322) 2020-03-06 12:16:06 -05:00
Pierre Gayvallet 45fb6f38b8
Hide input value from kbn-config-schema error messages (#58843)
* use inline snapshots instead of snapshots

* hide input value from error messages

* update core snapshots

* update xpack snapshots

* fix ftr assertions

* fix new snapshots

* hide values for byte_size and duration

* update new snapshots

* remove another byte_size value reference

* fix yet another value references in error messages

* update xpack snapshots

* update xpack ftr assertions
2020-03-06 17:47:28 +01:00
Walter Rafelsberger f4f956dfeb
[ML] Transforms: Migrate client plugin to NP. (#59443)
Migrates the client side plugin of transforms to NP.
- Gets rid of the last parts of the shim (http, documentation links)
- Moves the plugin from x-pack/legacy/plugins/transform/public to x-pack/plugins/transform
- Creates a custom mock for appDependencies based on NP services
- Fixes jest tests to get rid of all act() related warnings
2020-03-06 17:44:35 +01:00
Robert Oskamp 708d92a00e [ML] Disable failing functional tests 2020-03-06 16:55:57 +01:00
Andrew Goldstein 060b9fb10e
[SIEM] Update Timeline to use the latest euiFlyoutBody style (#59524)
## [SIEM] Update Timeline to use the latest euiFlyoutBody style

[A recent update to EUI](https://github.com/elastic/eui/pull/2837) requires an update to Timeline to restore its original padding, per the before / after screenshots below:

### Before

The previous code, which was using the `euiFlyoutBody__overflow` style, has extra padding (before this PR):

![timeline-padding-before-chrome](https://user-images.githubusercontent.com/4459398/76060425-81e37500-5f3e-11ea-8083-a58297afee85.png)

### After Chrome `80.0.3987.132`

The new code in this PR uses `euiFlyoutBody__overflowContent`, which restores the Timeline's original padding:

![timeline-paddng-after-chrome-default-theme](https://user-images.githubusercontent.com/4459398/76060436-8b6cdd00-5f3e-11ea-80d6-9ff0e74722c3.png)

![timeline-padding-after-chrome-dark-theme](https://user-images.githubusercontent.com/4459398/76060601-dedf2b00-5f3e-11ea-8a46-1008d7defe09.png)

### After Firefox `73.0.1`

![timeline-padding-after-firefox](https://user-images.githubusercontent.com/4459398/76060692-18b03180-5f3f-11ea-8277-31b6f9dbf211.png)

### After Safari `13.0.5`

![timeline-padding-after-safari](https://user-images.githubusercontent.com/4459398/76060744-38475a00-5f3f-11ea-9b04-cdd45fa41702.png)
2020-03-06 08:45:08 -07:00
Patrick Mueller ba40d25d46
[Alerting] replace index threshold graph usage of watcher APIs with new API (#59385)
Changes the alerting UI to use the new time series query HTTP endpoint provided by the builtin index threshold alertType; previously it used a watcher HTTP endpoint.

This is part of the ongoing index threshold work tracked in https://github.com/elastic/kibana/issues/53041
2020-03-06 10:26:52 -05:00
Dima Arnautov d969c08a00
[ML] Show view series link in anomalies table for machine_learning_user role (#59549) 2020-03-06 16:19:03 +01:00
Corey Robertson 9a3d0a5229
Move build_embeddable_filters into public (#59087)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-06 10:12:05 -05:00
Jonathan Buttner 2e41a27c46
[Endpoint] Unifying the test index name for resolver and alerts (#59073)
* Unifying the test index name for resolver and alerts

* Endpoint isn't sending the agent field so check for it

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-06 09:43:52 -05:00
Marta Bondyra 4977e57a3e
[Lens] Remove warnings in tests in EditorFrame (#59447)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-06 13:06:41 +01:00
Dima Arnautov 3a53fe8e45
[ML] Use Kibana's HttpHandler for HTTP requests (#59320)
* [ML] use kibana http

* [ML] fromHttpHandler

* [ML] remove __LEGACY, update asSystemRequest header

* [ML] transform with NP http
2020-03-06 11:34:19 +01:00
Cauê Marcondes 2817d6e3a8
[APM] Create settings page to manage Custom Links (#57788)
* creating custom action index

* reverting service form to service section

* creating useForm hooks and fields section

* adding react-hook-form

* refactoring

* validating filters

* fixing imports

* refactoring to NP and creating save custom action

* creating basic apis for custom actions

* refactoring

* changing custom action filters type

* adding delete option

* removing useForm

* fixing flyout view

* filters are invalid when selecting the default value

* ui fixes

* ui fixes

* fixing typescript

* fixing typescript

* fixing labels and adding space btw components

* refactoring filters structure

* removing reach-hook-form

* removing reach-hook-form

* adding unit tests

* adding unit tests

* create custom action index

* adding filter option

* refactoring create index, creating filter links

* creating list api

* rename custom action to custom link

* fixing unit tests

* adding unit tests

* refactoring callApmApi

* removing useCallApmApi hook

* Rename Flyoutfooter.tsx to FlyoutFooter.tsx

* removing unused import

* fixing typescript errors

* fixing duplicate messages

* removing filters

* fixing save functionality

* fixing pr comments

* fixing pr comments
2020-03-06 11:06:16 +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