-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] [Rules] Fixes bug where editing a rule with a data view throws an unhandled exception #145658
Conversation
return kibanaDataViews == null || Object.keys(kibanaDataViews).length === 0 ? ( | ||
<EuiLoadingSpinner size="l" /> | ||
) : ( |
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.
unsure why the kibanaDataViews passed down to the edit page started breaking the edit page this release compared to last release. Either way, this will fix the issue going forward.
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! Thanks for the fix👍
@@ -158,5 +165,24 @@ describe('Custom query rules', () => { | |||
.should('match', /^[1-9].+$/); | |||
cy.get(ALERT_GRID_CELL).contains(this.rule.name); | |||
}); | |||
it('Creates and edits a new rule with a data view', function () { | |||
visit(RULE_CREATION); | |||
fillDefineCustomRuleAndContinue(this.rule); |
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.
Not related to this PR, but I've noticed that we access rules in our Cypress tests via this
. And that leads to the type of this.rule
being any
. @dhurley14 Do you happen to know why we access rules using this
?
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.
That's a good question. It's not clear to me either. @MadameSheema?
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @dhurley14 |
…a view throws an unhandled exception (elastic#145658) ## Summary Ref: elastic#145078 (cherry picked from commit 584752f)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… a data view throws an unhandled exception (#145658) (#146153) # Backport This will backport the following commits from `main` to `8.6`: - [[Security Solution] [Rules] Fixes bug where editing a rule with a data view throws an unhandled exception (#145658)](#145658) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Devin W. Hurley","email":"devin.hurley@elastic.co"},"sourceCommit":{"committedDate":"2022-11-23T14:11:05Z","message":"[Security Solution] [Rules] Fixes bug where editing a rule with a data view throws an unhandled exception (#145658)\n\n## Summary\r\n\r\nRef: https://github.com/elastic/kibana/issues/145078","sha":"584752f36693d2e9af56605f2e914285a1d4d62d","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["review","release_note:skip","Team:Security Solution Platform","Feature:Rule Details","backport:prev-minor","v8.6.0","v8.7.0"],"number":145658,"url":"https://github.com/elastic/kibana/pull/145658","mergeCommit":{"message":"[Security Solution] [Rules] Fixes bug where editing a rule with a data view throws an unhandled exception (#145658)\n\n## Summary\r\n\r\nRef: https://github.com/elastic/kibana/issues/145078","sha":"584752f36693d2e9af56605f2e914285a1d4d62d"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145658","number":145658,"mergeCommit":{"message":"[Security Solution] [Rules] Fixes bug where editing a rule with a data view throws an unhandled exception (#145658)\n\n## Summary\r\n\r\nRef: https://github.com/elastic/kibana/issues/145078","sha":"584752f36693d2e9af56605f2e914285a1d4d62d"}}]}] BACKPORT--> Co-authored-by: Devin W. Hurley <devin.hurley@elastic.co>
Summary
Ref: #145078
I was unable to track down the reason as to why this error started appearing in 8.6 but this fix resolves the issue.
Checklist
Delete any items that are not applicable to this PR.