Skip to content
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

[Alerting] Add Generics support to Alerting #64147

Closed
gmmorris opened this issue Apr 22, 2020 · 2 comments · Fixed by #72716 or #71439
Closed

[Alerting] Add Generics support to Alerting #64147

gmmorris opened this issue Apr 22, 2020 · 2 comments · Fixed by #72716 or #71439
Assignees
Labels
Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@gmmorris
Copy link
Contributor

Work on #64145 has revealed a potential issue in our framework.

We currently use any instead of unknown throughout all types which interact with solutions - this has the potential of breaking the typing in solutions without them knowing and makes it harder to interact with our framework as manual conversions are forced on anyone using the framework and due to any's permissive nature it can actually cause solutions' code to typecheck incorrectly.

Changing the any to unknown will prevent the permissive typechecking issues, but will still require manual conversions and will require fixing all solutions already integrated.
It's worth investigating the use of generics as that will allow us to default to any, which means we won't break existing usage`, but that will offer solutions the option of using generics to get the exact type they expect to get and not need to typecheck or convert themselves.

@gmmorris gmmorris added Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Apr 22, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@gmmorris
Copy link
Contributor Author

It's worth noting that in order for this to work well we probably want to add generics in TaskManager as well so that you can specify the type there and remove the current use of any too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
4 participants