Skip to content

[Security Solution][Detection Engine] fixes rule preview works for form's invalid state (#173930)#213801

Merged
denar50 merged 2 commits intomainfrom
173930-allow-rule-preview-when-define-step-form-is-valid
Mar 17, 2025
Merged

[Security Solution][Detection Engine] fixes rule preview works for form's invalid state (#173930)#213801
denar50 merged 2 commits intomainfrom
173930-allow-rule-preview-when-define-step-form-is-valid

Conversation

@denar50
Copy link
Contributor

@denar50 denar50 commented Mar 10, 2025

Summary

This PR changes the behavior of the Preview rule button in the create rule form. Now the button will always be enabled, but upon clicking it the validation of the define rule form will be triggered. If the form is invalid, it will show a warning redirecting the user to the form in order to fix the errors.

This PR removes the helper function getIsRulePreviewDisabled after verifying that all the validations that it was doing are already covered by the validation rules of the define rule form.

This solves issue #173930

@denar50 denar50 requested a review from nkhristinin March 10, 2025 17:52
@denar50 denar50 requested a review from a team as a code owner March 10, 2025 17:52
@denar50 denar50 self-assigned this Mar 10, 2025
@denar50 denar50 added release_note:fix v9.0.0 Feature:Detection Rules Security Solution rules and Detection Engine Feature:Detection Rule Preview Security Solution Detection Rule Preview feature Team:Detection Engine Security Solution Detection Engine Area backport:version Backport to applied version labels v8.18.0 v8.17.4 labels Mar 10, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-engine (Team:Detection Engine)

@denar50 denar50 force-pushed the 173930-allow-rule-preview-when-define-step-form-is-valid branch from 74a8465 to 031fa99 Compare March 10, 2025 17:55
@denar50 denar50 force-pushed the 173930-allow-rule-preview-when-define-step-form-is-valid branch 3 times, most recently from 89be0ef to cf61e38 Compare March 11, 2025 09:45
@denar50 denar50 force-pushed the 173930-allow-rule-preview-when-define-step-form-is-valid branch 2 times, most recently from a1814ad to 8e7eb09 Compare March 11, 2025 12:49
@elasticmachine
Copy link
Contributor

elasticmachine commented Mar 12, 2025

Copy link
Contributor

@nkhristinin nkhristinin left a comment

Choose a reason for hiding this comment

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

LGTM, great work!

@nkhristinin nkhristinin self-requested a review March 14, 2025 11:02
denar50 and others added 2 commits March 17, 2025 09:32
…ection_engine/rule_creation_ui/components/rule_preview/translations.ts

Co-authored-by: Nastasha Solomon <79124755+nastasha-solomon@users.noreply.github.com>
@denar50 denar50 force-pushed the 173930-allow-rule-preview-when-define-step-form-is-valid branch from abc4512 to 491899c Compare March 17, 2025 08:32
@denar50 denar50 merged commit 07baf3a into main Mar 17, 2025
9 checks passed
@denar50 denar50 deleted the 173930-allow-rule-preview-when-define-step-form-is-valid branch March 17, 2025 12:56
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.18, 9.0

https://github.com/elastic/kibana/actions/runs/13899995733

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 17, 2025
…rm's invalid state (elastic#173930) (elastic#213801)

# Summary
This PR changes the behavior of the Preview rule button in the create
rule form. Now the button will always be enabled, but upon clicking it
the validation of the define rule form will be triggered. If the form is
invalid, it will show a warning redirecting the user to the form in
order to fix the errors.

This PR removes the helper function `getIsRulePreviewDisabled` after
verifying that all the validations that it was doing are already covered
by the validation rules of the define rule form.

This solves issue elastic#173930

---------

Co-authored-by: Nastasha Solomon <79124755+nastasha-solomon@users.noreply.github.com>
(cherry picked from commit 07baf3a)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 17, 2025
…rm's invalid state (elastic#173930) (elastic#213801)

# Summary
This PR changes the behavior of the Preview rule button in the create
rule form. Now the button will always be enabled, but upon clicking it
the validation of the define rule form will be triggered. If the form is
invalid, it will show a warning redirecting the user to the form in
order to fix the errors.

This PR removes the helper function `getIsRulePreviewDisabled` after
verifying that all the validations that it was doing are already covered
by the validation rules of the define rule form.

This solves issue elastic#173930

---------

Co-authored-by: Nastasha Solomon <79124755+nastasha-solomon@users.noreply.github.com>
(cherry picked from commit 07baf3a)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.17 Backport failed because of merge conflicts
8.18
9.0

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 213801

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Mar 17, 2025
…for form's invalid state (#173930) (#213801) (#214744)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Security Solution][Detection Engine] fixes rule preview works for
form's invalid state (#173930)
(#213801)](#213801)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Edgar
Santos","email":"edgar.santos@elastic.co"},"sourceCommit":{"committedDate":"2025-03-17T12:56:13Z","message":"[Security
Solution][Detection Engine] fixes rule preview works for form's invalid
state (#173930) (#213801)\n\n# Summary\nThis PR changes the behavior of
the Preview rule button in the create\nrule form. Now the button will
always be enabled, but upon clicking it\nthe validation of the define
rule form will be triggered. If the form is\ninvalid, it will show a
warning redirecting the user to the form in\norder to fix the
errors.\n\nThis PR removes the helper function
`getIsRulePreviewDisabled` after\nverifying that all the validations
that it was doing are already covered\nby the validation rules of the
define rule form.\n\n\nThis solves issue
#173930\n\n---------\n\nCo-authored-by: Nastasha Solomon
<79124755+nastasha-solomon@users.noreply.github.com>","sha":"07baf3a79f5d2e37ba2a4823c3c4ef339684959d","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Feature:Detection
Rules","Feature:Detection Rule Preview","Team:Detection
Engine","backport:version","v8.18.0","v9.1.0","v8.17.4"],"title":"[Security
Solution][Detection Engine] fixes rule preview works for form's invalid
state
(#173930)","number":213801,"url":"https://github.com/elastic/kibana/pull/213801","mergeCommit":{"message":"[Security
Solution][Detection Engine] fixes rule preview works for form's invalid
state (#173930) (#213801)\n\n# Summary\nThis PR changes the behavior of
the Preview rule button in the create\nrule form. Now the button will
always be enabled, but upon clicking it\nthe validation of the define
rule form will be triggered. If the form is\ninvalid, it will show a
warning redirecting the user to the form in\norder to fix the
errors.\n\nThis PR removes the helper function
`getIsRulePreviewDisabled` after\nverifying that all the validations
that it was doing are already covered\nby the validation rules of the
define rule form.\n\n\nThis solves issue
#173930\n\n---------\n\nCo-authored-by: Nastasha Solomon
<79124755+nastasha-solomon@users.noreply.github.com>","sha":"07baf3a79f5d2e37ba2a4823c3c4ef339684959d"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/213801","number":213801,"mergeCommit":{"message":"[Security
Solution][Detection Engine] fixes rule preview works for form's invalid
state (#173930) (#213801)\n\n# Summary\nThis PR changes the behavior of
the Preview rule button in the create\nrule form. Now the button will
always be enabled, but upon clicking it\nthe validation of the define
rule form will be triggered. If the form is\ninvalid, it will show a
warning redirecting the user to the form in\norder to fix the
errors.\n\nThis PR removes the helper function
`getIsRulePreviewDisabled` after\nverifying that all the validations
that it was doing are already covered\nby the validation rules of the
define rule form.\n\n\nThis solves issue
#173930\n\n---------\n\nCo-authored-by: Nastasha Solomon
<79124755+nastasha-solomon@users.noreply.github.com>","sha":"07baf3a79f5d2e37ba2a4823c3c4ef339684959d"}},{"branch":"8.17","label":"v8.17.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Edgar Santos <edgar.santos@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 17, 2025
… for form's invalid state (#173930) (#213801) (#214743)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Security Solution][Detection Engine] fixes rule preview works for
form's invalid state (#173930)
(#213801)](#213801)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Edgar
Santos","email":"edgar.santos@elastic.co"},"sourceCommit":{"committedDate":"2025-03-17T12:56:13Z","message":"[Security
Solution][Detection Engine] fixes rule preview works for form's invalid
state (#173930) (#213801)\n\n# Summary\nThis PR changes the behavior of
the Preview rule button in the create\nrule form. Now the button will
always be enabled, but upon clicking it\nthe validation of the define
rule form will be triggered. If the form is\ninvalid, it will show a
warning redirecting the user to the form in\norder to fix the
errors.\n\nThis PR removes the helper function
`getIsRulePreviewDisabled` after\nverifying that all the validations
that it was doing are already covered\nby the validation rules of the
define rule form.\n\n\nThis solves issue
#173930\n\n---------\n\nCo-authored-by: Nastasha Solomon
<79124755+nastasha-solomon@users.noreply.github.com>","sha":"07baf3a79f5d2e37ba2a4823c3c4ef339684959d","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Feature:Detection
Rules","Feature:Detection Rule Preview","Team:Detection
Engine","backport:version","v8.18.0","v9.1.0","v8.17.4"],"title":"[Security
Solution][Detection Engine] fixes rule preview works for form's invalid
state
(#173930)","number":213801,"url":"https://github.com/elastic/kibana/pull/213801","mergeCommit":{"message":"[Security
Solution][Detection Engine] fixes rule preview works for form's invalid
state (#173930) (#213801)\n\n# Summary\nThis PR changes the behavior of
the Preview rule button in the create\nrule form. Now the button will
always be enabled, but upon clicking it\nthe validation of the define
rule form will be triggered. If the form is\ninvalid, it will show a
warning redirecting the user to the form in\norder to fix the
errors.\n\nThis PR removes the helper function
`getIsRulePreviewDisabled` after\nverifying that all the validations
that it was doing are already covered\nby the validation rules of the
define rule form.\n\n\nThis solves issue
#173930\n\n---------\n\nCo-authored-by: Nastasha Solomon
<79124755+nastasha-solomon@users.noreply.github.com>","sha":"07baf3a79f5d2e37ba2a4823c3c4ef339684959d"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/213801","number":213801,"mergeCommit":{"message":"[Security
Solution][Detection Engine] fixes rule preview works for form's invalid
state (#173930) (#213801)\n\n# Summary\nThis PR changes the behavior of
the Preview rule button in the create\nrule form. Now the button will
always be enabled, but upon clicking it\nthe validation of the define
rule form will be triggered. If the form is\ninvalid, it will show a
warning redirecting the user to the form in\norder to fix the
errors.\n\nThis PR removes the helper function
`getIsRulePreviewDisabled` after\nverifying that all the validations
that it was doing are already covered\nby the validation rules of the
define rule form.\n\n\nThis solves issue
#173930\n\n---------\n\nCo-authored-by: Nastasha Solomon
<79124755+nastasha-solomon@users.noreply.github.com>","sha":"07baf3a79f5d2e37ba2a4823c3c4ef339684959d"}},{"branch":"8.17","label":"v8.17.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Edgar Santos <edgar.santos@elastic.co>
clintandrewhall pushed a commit to clintandrewhall/kibana that referenced this pull request Mar 20, 2025
…rm's invalid state (elastic#173930) (elastic#213801)

# Summary
This PR changes the behavior of the Preview rule button in the create
rule form. Now the button will always be enabled, but upon clicking it
the validation of the define rule form will be triggered. If the form is
invalid, it will show a warning redirecting the user to the form in
order to fix the errors.

This PR removes the helper function `getIsRulePreviewDisabled` after
verifying that all the validations that it was doing are already covered
by the validation rules of the define rule form.


This solves issue elastic#173930

---------

Co-authored-by: Nastasha Solomon <79124755+nastasha-solomon@users.noreply.github.com>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
…rm's invalid state (elastic#173930) (elastic#213801)

# Summary
This PR changes the behavior of the Preview rule button in the create
rule form. Now the button will always be enabled, but upon clicking it
the validation of the define rule form will be triggered. If the form is
invalid, it will show a warning redirecting the user to the form in
order to fix the errors.

This PR removes the helper function `getIsRulePreviewDisabled` after
verifying that all the validations that it was doing are already covered
by the validation rules of the define rule form.


This solves issue elastic#173930

---------

Co-authored-by: Nastasha Solomon <79124755+nastasha-solomon@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Detection Rule Preview Security Solution Detection Rule Preview feature Feature:Detection Rules Security Solution rules and Detection Engine release_note:fix Team:Detection Engine Security Solution Detection Engine Area v8.17.4 v8.18.0 v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants