Makes alerting and actions optional properties for interface RequestH…#59264
Conversation
|
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
pmuellr
left a comment
There was a problem hiding this comment.
Interesting! Technically correct, but given the type-check errors in CI, we'll need to guard our own usage of these :-)
I worry that other users will need such guards, which is going to get noisy/boiler-platey.
One thing we could do instead, is add a function to the request handler, to get the actions/alerts client. Which returned the type expected, and throws an error if the relevant client wasn't available.
I guess there must be some other common pattern to access these request context properties other plugins are using?
mikecote
left a comment
There was a problem hiding this comment.
Changes LGTM, thanks for doing this!
One thing we could do instead, is add a function to the request handler, to get the actions/alerts client. Which returned the type expected, and throws an error if the relevant client wasn't available.
It is strange for sure. The actions and alerting objects will be null when the plugin is disabled. When disabled, we won’t be able to register the function to the request context that returns the type expected. Maybe platform team has suggestions for this?
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
elastic#59264) * Makes alerting and actions optional properties for interface RequestHandlerContext * Added an error response result if context for actions and alerting is not registered
|
This PR was causing type errors after being merged: https://kibana-ci.elastic.co/job/elastic+kibana+master/3430/execution/node/146/log/ |
…re/files-and-filetree * 'master' of github.com:elastic/kibana: (254 commits) Convert discover_page to ts, remove redundunt methods (elastic#59312) [Fix for Vis Editor] Revert setting time field to empty string when it's undefined (elastic#58873) Delete legacy search endpoint (elastic#59341) [Uptime] Improve duration chart (elastic#58404) [Snapshot & Restore] NP migration (elastic#59109) [ML] Add support for date_nanos time field in anomaly job wizard (elastic#59017) Revert "Makes alerting and actions optional properties for interface RequestH… (elastic#59264)" Change remote_clusters ID to remoteClusters (elastic#59246) Makes alerting and actions optional properties for interface RequestH… (elastic#59264) Clean up date histogram agg type. (elastic#58805) [ML] Management: fix license unsubscribe (elastic#59365) Remove documentation for server.cors settings (elastic#59096) Edit alert flyout (elastic#58964) [SIEM] Fix rule delete/duplicate actions (elastic#59306) move mouse to close obstructing tooltip (elastic#59214) Reset page after deleting (elastic#59310) Make sure phrases input filter triggers autosuggestons (elastic#59299) Add loading count source for http requests (elastic#59245) Revert "[ML] Transforms: Deprecate custom KibanaContext. (elastic#59133)" Expose metrics service to public API (elastic#59294) ... # Conflicts: # src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx
Resolves #59239