-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Upgrade Assistant] Remove "boom" from reindex service #58715
[Upgrade Assistant] Remove "boom" from reindex service #58715
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
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes LGTM. Tested locally and all error handling working as expected.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* 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 <[email protected]> # Conflicts: # x-pack/plugins/upgrade_assistant/server/routes/reindex_indices.ts
…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
…#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 <[email protected]> # Conflicts: # x-pack/plugins/upgrade_assistant/server/routes/reindex_indices.ts * Added support for 7.x specific error
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
mapAnyErrorToKibanaHttpResponse
insidereindex_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.ts
over the handlerif
statement around thethrow
statement on line 287. This will demonstrate an integration test.Hack cluster_checkup.ts, ln 32
To reviewers
processNextStep
function 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 Error
withsymbol
to uniquely identify errors. Open to discussing this approach here too.Additional
isBoom
check against an error that could be emitted from Saved Objects client.For maintainers