* bump @elastic/elasticsearch to canary.7
* address errors in core
* address errors in data plugin
* address errors in Alerting team plugins
* remove outdated messages in Lens
* remove unnecessary comments in ML
* address errors in Observability plugin
* address errors in reporting plugin
* address errors in Rule registry plugin
* fix errors in Security plugins
* fix errors in ES-UI plugin
* remove unnecessary union.
* update core tests
* fix kbn-es-archiver
* update to canary 8
* bump to v9
* use new typings
* fix new errors in core
* fix errors in core typeings
* fix type errors in data plugin
* fix type errors in telemetray plugin
* fix data plugin tests
* fix search examples type error
* fix errors in discover plugin
* fix errors in index_pattern_management
* fix type errors in vis_type_*
* fix errors in typings/elasticsearch
* fix type errors in actions plugin
* fix type errors in alerting and apm plugins
* fix type errors in canvas and cases
* fix errors in event_log
* fix type errors in ILM and ingest_pipelines
* fix errors in lens plugin
* fix errors in lists plugin
* fix errors in logstash
* fix errors in metrics_entities
* fix errors in o11y
* fix errors in watcher
* fix errors in uptime
* fix errors in upgrade_assistant
* fix errors in task_manager
* fix errors in stack_alerts
* fix errors in security_solution
* fix errors in rule_registry
* fix errors in snapshot_restore
* fix remaining errors
* fix search intergration tests
* adjust assetion
* bump version to canary.10
* adapt code to new naming schema
* use mapping types provided by the client library
* Revert "adjust assetion"
This reverts commit 19b8fe0464.
* fix so intergration tests
* fix http integration tests
* bump version to canary 11
* fix login test
* fix http integration test
* fix apm test
* update docs
* fixing some ml types
* fix new errors in data plugin
* fix new errors in alerting plugin
* fix new errors in lists plugin
* fix new errors in reporting
* fix or mute errors in rule_registry plugin
* more ML type fixes
* bump to canary 12
* fix errors after merge conflict
* additional ML fixes
* bump to canary 13
* fix errors in apm plugin
* fix errors in fleet plugin
* fix errors in infra plugin
* fix errors in monitoring plugin
* fix errors in osquery plugin
* fix errors in security solution plugins
* fix errors in transform plugin
* Update type imports for ES
* fix errors in x-pack plugins
* fix errors in tests
* update docs
* fix errors in x-pack/test
* update error description
* fix errors after master merge
* update comment in infra plugin
* fix new errors on xpack tests/
Co-authored-by: James Gowdy <jgowdy@elastic.co>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
* Use client from branch
* Get type checking working in core
* Fix types in other plugins
* Update client types + remove type errors from core
* migrate Task Manager Elasticsearch typing from legacy library to client library
* use SortOrder instead o string in alerts
* Update client types + fix core type issues
* fix maps ts errors
* Update Lens types
* Convert Search Profiler body from a string to an object to conform to SearchRequest type.
* Fix SOT types
* Fix/mute Security/Spaces plugins type errors.
* Fix bootstrap types
* Fix painless_lab
* corrected es typing in Event Log
* Use new types from client for inferred search responses
* Latest type defs
* Integrate latest type defs for APM/UX
* fix core errors
* fix telemetry errors
* fix canvas errors
* fix data_enhanced errors
* fix event_log errors
* mute lens errors
* fix or mute maps errors
* fix reporting errors
* fix security errors
* mute errors in task_manager
* fix errors in telemetry_collection_xpack
* fix errors in data plugins
* fix errors in alerts
* mute errors in index_management
* fix task_manager errors
* mute or fix lens errors
* fix upgrade_assistant errors
* fix or mute errors in index_lifecycle_management
* fix discover errors
* fix core tests
* ML changes
* fix core type errors
* mute error in kbn-es-archiver
* fix error in data plugin
* fix error in telemetry plugin
* fix error in discover
* fix discover errors
* fix errors in task_manager
* fix security errors
* fix wrong conflict resolution
* address errors with upstream code
* update deps to the last commit
* remove outdated comments
* fix core errors
* fix errors after update
* adding more expect errors to ML
* pull the lastest changes
* fix core errors
* fix errors in infra plugin
* fix errors in uptime plugin
* fix errors in ml
* fix errors in xpack telemetry
* fix or mute errors in transform
* fix errors in upgrade assistant
* fix or mute fleet errors
* start fixing apm errors
* fix errors in osquery
* fix telemetry tests
* core cleanup
* fix asMutableArray imports
* cleanup
* data_enhanced cleanup
* cleanup events_log
* cleaup
* fix error in kbn-es-archiver
* fix errors in kbn-es-archiver
* fix errors in kbn-es-archiver
* fix ES typings for Hit
* fix SO
* fix actions plugin
* fix fleet
* fix maps
* fix stack_alerts
* fix eslint problems
* fix event_log unit tests
* fix failures in data_enhanced tests
* fix test failure in kbn-es-archiver
* fix test failures in index_pattern_management
* fixing ML test
* remove outdated comment in kbn-es-archiver
* fix error type in ml
* fix eslint errors in osquery plugin
* fix runtime error in infra plugin
* revert changes to event_log cluser exist check
* fix eslint error in osquery
* fixing ML endpoint argument types
* fx types
* Update api-extractor docs
* attempt fix for ese test
* Fix lint error
* Fix types for ts refs
* Fix data_enhanced unit test
* fix lens types
* generate docs
* Fix a number of type issues in monitoring and ml
* fix triggers_actions_ui
* Fix ILM functional test
* Put search.d.ts typings back
* fix data plugin
* Update typings in typings/elasticsearch
* Update snapshots
* mute errors in task_manager
* mute fleet errors
* lens. remove unnecessary ts-expect-errors
* fix errors in stack_alerts
* mute errors in osquery
* fix errors in security_solution
* fix errors in lists
* fix errors in cases
* mute errors in search_examples
* use KibanaClient to enforce promise-based API
* fix errors in test/ folder
* update comment
* fix errors in x-pack/test folder
* fix errors in ml plugin
* fix optional fields in ml api_integartoon tests
* fix another casting problem in ml tests
* fix another ml test failure
* fix fleet problem after conflict resolution
* rollback changes in security_solution. trying to fix test
* Update type for discover rows
* uncomment runtime_mappings as its outdated
* address comments from Wylie
* remove eslint error due to any
* mute error due to incompatibility
* Apply suggestions from code review
Co-authored-by: John Schulz <github.com@jfsiii.org>
* fix type error in lens tests
* Update x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
* Update x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
* update deps
* fix errors in core types
* fix errors for the new elastic/elasticsearch version
* remove unused type
* remove unnecessary manual type cast and put optional chaining back
* ML: mute Datafeed is missing indices_options
* Apply suggestions from code review
Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>
* use canary pacakge instead of git commit
Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Nathan Reese <reese.nathan@gmail.com>
Co-authored-by: Wylie Conlon <wylieconlon@gmail.com>
Co-authored-by: CJ Cenizal <cj@cenizal.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
Co-authored-by: restrry <restrry@gmail.com>
Co-authored-by: James Gowdy <jgowdy@elastic.co>
Co-authored-by: John Schulz <github.com@jfsiii.org>
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
* SavedObjectsRepository.incrementCounter supports array of fields
* Fix TS errors
* Fix failing test
* Ensure all the remarks make it into our documentation
* SavedObjectsRepository.incrementCounter initialize option
* Move usage collection-specific docs out of repository into usage collection plugins readme
* Update api docs
* Polish generated docs
* _cluster/state/metadata/* and added a comment to function
* add another comment regarding why we are asking for *
* update jest test
* refactor and clean up use of cluster status to get index state
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* adapt retryCallCluster for new ES client
* review comments
* retry on 408 ResponseError
* remove legacy retry functions
* use Migrator Es client in SO migration
* update migration tests
* improve ES typings and mocks
* migrate decorate ES errors
* add repository es client
* use new es client in so repository
* update repository tests
* fix migrator integration tests
* declare _seq_no & _primary_term on get response. _source expect to be a string
* make _sourceIncludes and refresh compatible with the client
* add test for repository_es_client
* move ApiResponse to es client mocks
* TEMP: handle wait_for as true for deleteByNamespace
* add tests for migration_es_client
* TEMP: skip test for deleteByNamespace refresh
* pass ignore as transport option in mget
* log both es client and response errors
* fix update method test failures
* update deleteByNamespace refresh settings
es doesn't support 'refresh: wait_for' for `updateByQuery` endpoint
* update repository tests. we do not allow customising wait_for
* do not delegate retry logic to es client
* fix type errors after master merged
* fix repository tests
* fix security solutions code
SO doesn't throw Error with status code anymore. Always use SO error helpers
* switch error conditions to use SO error helpers
* cleanup
* address comments about mocks
* use isResponseError helper
* address comments
* fix type errors
Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
* move last snapshot to inline
* move legacy files to legacy subfolder
* move request types out of legacy
* export Headers from http instead of elasticsearch
* renaming - first pass
* renaming - second pass
* fix core mocks
* adapt new calls
* update generated doc
* fix IT test mocks
* fix new usages
Major cleanup of the no_restricted_paths rule for imports of core.
For relative imports, we use eslint-module-utils/resolve which resolves
to the full filesystem path. So, to support relative and absolute
imports from the src alias we need to define both the directory and the
index including file extension.
This rule was handling both core imports, as well as imports from other
plugins. Imports from other plugins are being used much more liberally
allowed through the exceptions in tests. I choose to break these up,
removing this exception for tests for core imports.
Fixes:
Absolute imports of src/core/server/mocks were not allowed in src. This
was not an issue in x-pack due to the target excluding
!x-pack/**/*.test.* and !x-pack/test/**/*.
Non-top-level public and server imports were allowed from X-Pack tests
to the previously mentioned exclusion.
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
* 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
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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