Skip to content

Conversation

@yctercero
Copy link
Contributor

@yctercero yctercero commented Oct 7, 2020

Summary

Fixes the following in the rule query preview feature:

  • toasters were previously just showing an error message, not the details. Updated to use addError so now user can click to view details
  • disables eql query preview button while request is loading
  • moved to use existing search strategy pattern, this resolved the react memory leak error encountered when moving away from page before preview resolved
  • removes super descriptive someAriaId
  • adds tests 🎺 🎉

Checklist

@yctercero yctercero self-assigned this Oct 7, 2020
@yctercero yctercero added Feature:Detection Rules Security Solution rules and Detection Engine release_note:fix Team:Detections and Resp Security Detection Response Team v7.10.0 v7.11.0 v8.0.0 labels Oct 7, 2020
@yctercero yctercero marked this pull request as ready for review October 7, 2020 23:06
@yctercero yctercero requested review from a team as code owners October 7, 2020 23:06
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@XavierM please let me know if this is what you were thinking.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes but the const bucketEmpty need to go on line 34 ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@patrykkopycinski @angorayc @XavierM Is this change here ok? addDanger only shows an error message, while addError allows the user to click to view full error details.

Copy link
Contributor

Choose a reason for hiding this comment

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

we might need to change it everywhere for consistency, but we can take care of that. Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's an existing bug with warnings, working on the fix in a separate PR to keep these small-ish.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@patrykkopycinski I was able to test this hook more thoroughly, and was going to do the same for useMatrixHistogram but required one small change of first declaring the variable let subscription$ and then assigning it. Otherwise, the tests failed saying the variable was unreachable. If this seems like an ok change, happy to add similar tests to useMatrixHistogram.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@rylnd rylnd left a comment

Choose a reason for hiding this comment

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

Looking good so far! Just a few minor things. Big remaining one is the syncing of validity to the preview button; I hit that a bunch in testing this.

Copy link
Contributor

@rylnd rylnd Oct 8, 2020

Choose a reason for hiding this comment

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

This seems a bit strange to me. Is one of the comparisons meant to be a type check? If they're both numbers I think the latter check should be sufficient

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if it's the implementation here or something else, but I see a behavioral difference between the EQL preview loading and the other query previews loading. With EQL it does not populate the histogram with the loader:

Oct-08-2020 16-58-13

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, I wanted to try to keep the PRs smallish - so I focused on fixing the bugs/tests with the api here and have a sequel "preview_buggies_2" that addresses these issues (#80110). I promise it's a really good sequel 😄

It currently includes the changes from this PR, but if you check out the last 2 commits you can see the new changes.

@yctercero yctercero removed the Feature:Detection Rules Security Solution rules and Detection Engine label Oct 10, 2020
@yctercero
Copy link
Contributor Author

Had been trying to have smaller PRs, but going to just address the comments from here in this new PR that tackles all known bugs at once - #80110

@yctercero yctercero closed this Oct 12, 2020
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

async chunks size

id before after diff
securitySolution 10.6MB 10.6MB +3.8KB

page load bundle size

id before after diff
securitySolution 593.2KB 600.5KB +7.2KB

History

  • 💚 Build #80634 succeeded 32d5421247ea2e509b4950219f1e024b0bfecc10

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

@yctercero yctercero deleted the preview_buggies branch October 14, 2020 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants