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

[Security Solution][Detections] Update telemetry to use ML contract #71665

Merged
merged 4 commits into from
Jul 14, 2020

Conversation

rylnd
Copy link
Contributor

@rylnd rylnd commented Jul 14, 2020

Summary

This interface recently changed and we're now able to use the ML contract to retrieve these values. A few unnecessary arguments are stubbed as we're in a non-user, non-request context.

For maintainers

This interface recently changed and we're now able to use the ML
contract to retrieve these values. A few unnecessary arguments are
stubbed as we're in a non-user, non-request context.
@rylnd rylnd added Team:SIEM v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.9.0 labels Jul 14, 2020
@rylnd rylnd self-assigned this Jul 14, 2020
 Conflicts:
	x-pack/plugins/ml/server/shared_services/providers/modules.ts
	x-pack/plugins/security_solution/server/usage/detections/detections_helpers.ts
@rylnd rylnd marked this pull request as ready for review July 14, 2020 15:19
@rylnd rylnd requested review from a team as code owners July 14, 2020 15:19
@elasticmachine
Copy link
Contributor

Pinging @elastic/siem (Team:SIEM)

This is more legible but still gets the point across; the intermediate
variable was explicit but ultimately unnnecessary.
Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

We're not calling different methods, so our mocks need to change
slightly.
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@@ -40,8 +41,14 @@ export function getModulesProvider({
request: KibanaRequest,
savedObjectsClient: SavedObjectsClientContract
) {
const hasMlCapabilities = getHasMlCapabilities(request);
let hasMlCapabilities: HasMlCapabilities;
if (request.params === 'DummyKibanaRequest') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just make DummyKibanaRequest a shared constant somewhere so someone doesn't accidentally break this in the future 😂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... uptime is doing something similar as well. We want to be consistent while discouraging this temporary workaround... if it's used in a third place maybe we move it upstream into getHasMlCapabilities.

@rylnd rylnd merged commit 9e2ebe2 into elastic:master Jul 14, 2020
@rylnd rylnd deleted the telemetry_with_new_ml branch July 14, 2020 19:20
rylnd added a commit to rylnd/kibana that referenced this pull request Jul 14, 2020
…lastic#71665)

* Update security solution telemetry to use ML providers

This interface recently changed and we're now able to use the ML
contract to retrieve these values. A few unnecessary arguments are
stubbed as we're in a non-user, non-request context.

* Simplify our capabilities stub assignment

This is more legible but still gets the point across; the intermediate
variable was explicit but ultimately unnnecessary.

* Update tests following telemetry refactor

We're not calling different methods, so our mocks need to change
slightly.
rylnd added a commit that referenced this pull request Jul 14, 2020
…71665) (#71733)

* Update security solution telemetry to use ML providers

This interface recently changed and we're now able to use the ML
contract to retrieve these values. A few unnecessary arguments are
stubbed as we're in a non-user, non-request context.

* Simplify our capabilities stub assignment

This is more legible but still gets the point across; the intermediate
variable was explicit but ultimately unnnecessary.

* Update tests following telemetry refactor

We're not calling different methods, so our mocks need to change
slightly.
@MindyRS MindyRS added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Sep 23, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:SIEM v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants