[Upgrade Assistant] Remove "boom" from reindex service#58715
Merged
jloleysens merged 6 commits intoelastic:masterfrom Mar 2, 2020
Merged
[Upgrade Assistant] Remove "boom" from reindex service#58715jloleysens merged 6 commits intoelastic:masterfrom
jloleysens merged 6 commits intoelastic:masterfrom
Conversation
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.
Specify the full relative import path to the kibana's core server folder
Contributor
|
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
Contributor
Author
|
@elasticmachine merge upstream |
3 tasks
alisonelizabeth
approved these changes
Feb 28, 2020
Contributor
alisonelizabeth
left a comment
There was a problem hiding this comment.
Code changes LGTM. Tested locally and all error handling working as expected.
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
jloleysens
added a commit
to jloleysens/kibana
that referenced
this pull request
Mar 2, 2020
* 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> # Conflicts: # x-pack/plugins/upgrade_assistant/server/routes/reindex_indices.ts
jloleysens
added a commit
to jloleysens/kibana
that referenced
this pull request
Mar 2, 2020
…dex-server-side * 'master' of github.com:elastic/kibana: (34 commits) [Upgrade Assistant] Remove "boom" from reindex service (elastic#58715) [data] Clean up QueryStringInput unit tests (elastic#58704) [SIEM] Detection Fix typo in Adobe Hijack Persistence rule (elastic#58804) Restores [SIEM][CASE] Init Configure Case Page (elastic#58121) (elastic#58924) Skips additional failing Ingest Manager integration tests Skips failing Ingest Manager integration tests Move dev tools styles to NP (elastic#58855) change to have kibana --ssl cli option use more recent certs (elastic#57933) disable failing suite (elastic#58942) Don't start pollEsNodesVersion unless someone subscribes (elastic#56923) Do not write UUID file during optimize process (elastic#58899) [Endpoint] Task/add nav bar (elastic#58604) [Metric Alerts] Add backend support for multiple expressions per alert (elastic#58672) [Metrics Alerts] Fix alerting on a rate aggregation (elastic#58789) disable flaky suite (elastic#55953) Revert "[SIEM] apollo@3 (elastic#51926)" and "[SIEM][CASE] Init Confi… (elastic#58806) [resubmit] Prep agg types for new platform (elastic#58893) [Lens] Allow number formatting within Lens (elastic#56253) [Autocomplete] Use settings from config rather than UI settings (elastic#58784) Improve action and trigger types (elastic#58657) ... # Conflicts: # x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.ts
3 tasks
jloleysens
added a commit
that referenced
this pull request
Mar 2, 2020
…#59010) * [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> # Conflicts: # x-pack/plugins/upgrade_assistant/server/routes/reindex_indices.ts * Added support for 7.x specific error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This contribution replaces the error handling inside reindex service with custom error handling (which was prone to errors could either be Boom HTTP errors or actual Errors which led to complications in handling). Custom Errors are also platform prescribed: #57458. The mapping to HTTP specific codes is moved to just the handlers (see
mapAnyErrorToKibanaHttpResponseinsidereindex_indices).How to test
The existing Jest test coverage tests that all throws are still occurring when expected.
This was integration tested locally using this setup:
cluster_checkup.tsover the handlerifstatement around thethrowstatement on line 287. This will demonstrate an integration test.Hack cluster_checkup.ts, ln 32
To reviewers
processNextStepfunction is used inside of reindex worker. These cases are all covered and tested, flag it here if you can find any instance of reindex service being used (and errors being caught) that I may have missed.MyError extends Errorwithsymbolto uniquely identify errors. Open to discussing this approach here too.Additional
isBoomcheck against an error that could be emitted from Saved Objects client.For maintainers