-
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
[Security Solutions] Adds type fixes for case cache in case it's null/undefined #123643
Merged
FrankHassanabad
merged 1 commit into
elastic:main
from
FrankHassanabad:fix-case-telemetry
Jan 25, 2022
Merged
[Security Solutions] Adds type fixes for case cache in case it's null/undefined #123643
FrankHassanabad
merged 1 commit into
elastic:main
from
FrankHassanabad:fix-case-telemetry
Jan 25, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FrankHassanabad
changed the title
[Security Solutions] ADDS type fixes for case cache in case it's null/undefined
[Security Solutions] Adds type fixes for case cache in case it's null/undefined
Jan 24, 2022
FrankHassanabad
added
v8.1.0
v8.0.0
Team:Security Solution Platform
Security Solution Platform Team
auto-backport
Deprecated - use backport:version if exact versions are needed
labels
Jan 24, 2022
FrankHassanabad
added
backport:skip
This commit does not require backporting
release_note:skip
Skip the PR/issue when compiling release notes
and removed
backport:skip
This commit does not require backporting
labels
Jan 24, 2022
💚 Build Succeeded
Metrics [docs]
To update your PR or re-run it, just comment with: |
pjhampton
approved these changes
Jan 25, 2022
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.
🌔 🚀 ✨ LGTM ✨ 🚀 🌔
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jan 25, 2022
…123643) ## Summary See this PR from here: elastic#123094 Where `"rule": { "id": null, "name": null },` can be null. This just adds guards around it to prevent possible errors. Note, I tested it first and there aren't errors with this even if we don't merge but that is not a guarantee that later NodeJS wouldn't cause errors if the implementation details of [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) change. Note, I don't try to do any additional lookups if these are `null` as the release is coming very quickly and I do not want to overcomplicate telemetry and we don't have dashboards around the cases feature. Over time I would expect the telemetry to become more accurate again even if cases are `nulled` out. **Manual testing** Either create a true upgrade where all the id's changed by going to 7.16 and making a new space, then within that space outside of default creating cases and alerts and then do an upgrade to 8.0.0 ... or ... Downgrade a `case-comments` like so manually in dev tools: ```ts # Get all case-comments to choose an id GET .kibana/_search { "query": { "term": { "type": "cases-comments" } } } ``` ```ts # Downgrades a case comment of id "25554290-7a36-11ec-8d37-0d0e30a77b60" POST .kibana/_update/cases-comments:25554290-7a36-11ec-8d37-0d0e30a77b60 { "script" : { "source": """ ctx._source.migrationVersion['cases-comments'] = "7.16.3"; """, "lang": "painless" } } ``` Restart Kibana and you should query the same `case-comments` and see that the `"rule": { "id": null, "name": null },` are all null. Either way once you have a null rule go to `Advanced Settings -> cluster data` and ensure that you still get metrics flowing and that one is no longer counted but if you create a new one everything still works as expected: <img width="647" alt="Screen Shot 2022-01-24 at 11 48 39 AM" src="https://user-images.githubusercontent.com/1151048/150846789-d94ac212-6c45-44cc-a663-cd304bfda22e.png"> ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios We still don't have this for the existing telemetry and are running out of time for 8.0.0 to add them. We might re-write this part of telemetry as well so I am not adding tests just yet. (cherry picked from commit 607feec)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Jan 25, 2022
…#123747) ## Summary See this PR from here: #123094 Where `"rule": { "id": null, "name": null },` can be null. This just adds guards around it to prevent possible errors. Note, I tested it first and there aren't errors with this even if we don't merge but that is not a guarantee that later NodeJS wouldn't cause errors if the implementation details of [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) change. Note, I don't try to do any additional lookups if these are `null` as the release is coming very quickly and I do not want to overcomplicate telemetry and we don't have dashboards around the cases feature. Over time I would expect the telemetry to become more accurate again even if cases are `nulled` out. **Manual testing** Either create a true upgrade where all the id's changed by going to 7.16 and making a new space, then within that space outside of default creating cases and alerts and then do an upgrade to 8.0.0 ... or ... Downgrade a `case-comments` like so manually in dev tools: ```ts # Get all case-comments to choose an id GET .kibana/_search { "query": { "term": { "type": "cases-comments" } } } ``` ```ts # Downgrades a case comment of id "25554290-7a36-11ec-8d37-0d0e30a77b60" POST .kibana/_update/cases-comments:25554290-7a36-11ec-8d37-0d0e30a77b60 { "script" : { "source": """ ctx._source.migrationVersion['cases-comments'] = "7.16.3"; """, "lang": "painless" } } ``` Restart Kibana and you should query the same `case-comments` and see that the `"rule": { "id": null, "name": null },` are all null. Either way once you have a null rule go to `Advanced Settings -> cluster data` and ensure that you still get metrics flowing and that one is no longer counted but if you create a new one everything still works as expected: <img width="647" alt="Screen Shot 2022-01-24 at 11 48 39 AM" src="https://user-images.githubusercontent.com/1151048/150846789-d94ac212-6c45-44cc-a663-cd304bfda22e.png"> ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios We still don't have this for the existing telemetry and are running out of time for 8.0.0 to add them. We might re-write this part of telemetry as well so I am not adding tests just yet. (cherry picked from commit 607feec) Co-authored-by: Frank Hassanabad <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
auto-backport
Deprecated - use backport:version if exact versions are needed
release_note:skip
Skip the PR/issue when compiling release notes
Team:Security Solution Platform
Security Solution Platform Team
v8.0.0
v8.1.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
See this PR from here:
#123094
Where
"rule": { "id": null, "name": null },
can be null. This just adds guards around it to prevent possible errors. Note, I tested it first and there aren't errors with this even if we don't merge but that is not a guarantee that later NodeJS wouldn't cause errors if the implementation details of Map change.Note, I don't try to do any additional lookups if these are
null
as the release is coming very quickly and I do not want to overcomplicate telemetry and we don't have dashboards around the cases feature. Over time I would expect the telemetry to become more accurate again even if cases arenulled
out.Manual testing
Either create a true upgrade where all the id's changed by going to 7.16 and making a new space, then within that space outside of default creating cases and alerts and then do an upgrade to 8.0.0 ... or ...
Downgrade a
case-comments
like so manually in dev tools:Restart Kibana and you should query the same
case-comments
and see that the"rule": { "id": null, "name": null },
are all null.Either way once you have a null rule go to
Advanced Settings -> cluster data
and ensure that you still get metrics flowing and that one is no longer counted but if you create a new one everything still works as expected:Checklist
We still don't have this for the existing telemetry and are running out of time for 8.0.0 to add them. We might re-write this part of telemetry as well so I am not adding tests just yet.