Skip to content

[Rules migration] Allow partial RuleResponse object to be passed to RuleOverviewTab#204318

Merged
e40pud merged 1 commit intoelastic:mainfrom
e40pud:security/siem-migrations/partial-RuleResponse
Dec 16, 2024
Merged

[Rules migration] Allow partial RuleResponse object to be passed to RuleOverviewTab#204318
e40pud merged 1 commit intoelastic:mainfrom
e40pud:security/siem-migrations/partial-RuleResponse

Conversation

@e40pud
Copy link
Copy Markdown
Contributor

@e40pud e40pud commented Dec 14, 2024

Summary

These changes allow Partial<RuleResponse> to be used as a parameter for RuleOverviewTab component.

We re-use this component for "SIEM Migrations" feature to display translated state of the rule which has just a few fields that represent the RuleResponse object. The set of fields used in RuleMigration object is a minimum set of fields enough for the rule creation.

Right now, RuleOverviewTab component requires the complete RuleResponse object to be passed even though internally each section (RuleAboutSection, RuleDefinitionSection, RuleScheduleSection and RuleSetupGuideSection) of the rule's overview expects Partial<RuleResponse>. To be able to use this component we force type casting at the moment and would like to get rid of it.

@elastic/security-detection-rule-management do you have objects regarding this change in RuleOverviewTab intefrace?

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

@e40pud e40pud added release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting Security Solution Threat Hunting Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team backport:prev-minor labels Dec 14, 2024
@e40pud e40pud requested review from banderror, maximpn and semd December 14, 2024 15:35
@e40pud e40pud self-assigned this Dec 14, 2024
@e40pud e40pud requested review from a team as code owners December 14, 2024 15:36
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Copy Markdown
Contributor

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

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #62 / Entity Manager _count API is resilient to no valid sources

Metrics [docs]

✅ unchanged

cc @e40pud

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7601

[✅] Security Solution Rule Management - Cypress: 100/100 tests passed.
[✅] [Serverless] Security Solution Rule Management - Cypress: 100/100 tests passed.

see run history

Copy link
Copy Markdown
Contributor

@nikitaindik nikitaindik left a comment

Choose a reason for hiding this comment

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

IMO, the change to Partial<RuleResponse> in RuleOverviewTab is fine since underlying section components already use Partial<RuleResponse>.

Copy link
Copy Markdown
Contributor

@maximpn maximpn left a comment

Choose a reason for hiding this comment

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

@e40pud I agree with @nikitaindik. RuleOverviewTab was already prepared for partial rule data.

Copy link
Copy Markdown
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

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

LGTM

@e40pud e40pud merged commit c92899e into elastic:main Dec 16, 2024
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 16, 2024
… `RuleOverviewTab` (elastic#204318)

## Summary

These changes allow `Partial<RuleResponse>` to be used as a parameter
for `RuleOverviewTab` component.

We re-use this component for "SIEM Migrations" feature to display
translated state of the rule which has just a few fields that represent
the `RuleResponse` object. The set of fields used in `RuleMigration`
object is a minimum set of fields enough for the rule creation.

Right now, `RuleOverviewTab` component requires the complete
`RuleResponse` object to be passed even though internally each section
(`RuleAboutSection`, `RuleDefinitionSection`, `RuleScheduleSection` and
`RuleSetupGuideSection`) of the rule's overview expects
`Partial<RuleResponse>`. To be able to use this component we force type
casting at the moment and would like to get rid of it.

@elastic/security-detection-rule-management do you have objects
regarding this change in `RuleOverviewTab` intefrace?

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- Rule management cypress tests ([100 ESS & 100
Serverless](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7601))

(cherry picked from commit c92899e)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.x

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 Dec 16, 2024
… to be passed to &#x60;RuleOverviewTab&#x60; (#204318) (#204353)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Rules migration] Allow partial &#x60;RuleResponse&#x60; object to be
passed to &#x60;RuleOverviewTab&#x60;
(#204318)](#204318)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Ievgen
Sorokopud","email":"ievgen.sorokopud@elastic.co"},"sourceCommit":{"committedDate":"2024-12-16T10:15:52Z","message":"[Rules
migration] Allow partial `RuleResponse` object to be passed to
`RuleOverviewTab` (#204318)\n\n## Summary\r\n\r\nThese changes allow
`Partial<RuleResponse>` to be used as a parameter\r\nfor
`RuleOverviewTab` component.\r\n\r\nWe re-use this component for \"SIEM
Migrations\" feature to display\r\ntranslated state of the rule which
has just a few fields that represent\r\nthe `RuleResponse` object. The
set of fields used in `RuleMigration`\r\nobject is a minimum set of
fields enough for the rule creation.\r\n\r\nRight now, `RuleOverviewTab`
component requires the complete\r\n`RuleResponse` object to be passed
even though internally each section\r\n(`RuleAboutSection`,
`RuleDefinitionSection`, `RuleScheduleSection`
and\r\n`RuleSetupGuideSection`) of the rule's overview
expects\r\n`Partial<RuleResponse>`. To be able to use this component we
force type\r\ncasting at the moment and would like to get rid of
it.\r\n\r\n@elastic/security-detection-rule-management do you have
objects\r\nregarding this change in `RuleOverviewTab`
intefrace?\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- Rule management cypress tests
([100 ESS &
100\r\nServerless](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7601))","sha":"c92899e142c3edf8318d0a7a13c15ff7cfb3a0f4","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat
Hunting","Team: SecuritySolution","Team:Detection Rule
Management","backport:prev-minor"],"title":"[Rules migration] Allow
partial `RuleResponse` object to be passed to
`RuleOverviewTab`","number":204318,"url":"https://github.com/elastic/kibana/pull/204318","mergeCommit":{"message":"[Rules
migration] Allow partial `RuleResponse` object to be passed to
`RuleOverviewTab` (#204318)\n\n## Summary\r\n\r\nThese changes allow
`Partial<RuleResponse>` to be used as a parameter\r\nfor
`RuleOverviewTab` component.\r\n\r\nWe re-use this component for \"SIEM
Migrations\" feature to display\r\ntranslated state of the rule which
has just a few fields that represent\r\nthe `RuleResponse` object. The
set of fields used in `RuleMigration`\r\nobject is a minimum set of
fields enough for the rule creation.\r\n\r\nRight now, `RuleOverviewTab`
component requires the complete\r\n`RuleResponse` object to be passed
even though internally each section\r\n(`RuleAboutSection`,
`RuleDefinitionSection`, `RuleScheduleSection`
and\r\n`RuleSetupGuideSection`) of the rule's overview
expects\r\n`Partial<RuleResponse>`. To be able to use this component we
force type\r\ncasting at the moment and would like to get rid of
it.\r\n\r\n@elastic/security-detection-rule-management do you have
objects\r\nregarding this change in `RuleOverviewTab`
intefrace?\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- Rule management cypress tests
([100 ESS &
100\r\nServerless](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7601))","sha":"c92899e142c3edf8318d0a7a13c15ff7cfb3a0f4"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204318","number":204318,"mergeCommit":{"message":"[Rules
migration] Allow partial `RuleResponse` object to be passed to
`RuleOverviewTab` (#204318)\n\n## Summary\r\n\r\nThese changes allow
`Partial<RuleResponse>` to be used as a parameter\r\nfor
`RuleOverviewTab` component.\r\n\r\nWe re-use this component for \"SIEM
Migrations\" feature to display\r\ntranslated state of the rule which
has just a few fields that represent\r\nthe `RuleResponse` object. The
set of fields used in `RuleMigration`\r\nobject is a minimum set of
fields enough for the rule creation.\r\n\r\nRight now, `RuleOverviewTab`
component requires the complete\r\n`RuleResponse` object to be passed
even though internally each section\r\n(`RuleAboutSection`,
`RuleDefinitionSection`, `RuleScheduleSection`
and\r\n`RuleSetupGuideSection`) of the rule's overview
expects\r\n`Partial<RuleResponse>`. To be able to use this component we
force type\r\ncasting at the moment and would like to get rid of
it.\r\n\r\n@elastic/security-detection-rule-management do you have
objects\r\nregarding this change in `RuleOverviewTab`
intefrace?\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- Rule management cypress tests
([100 ESS &
100\r\nServerless](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7601))","sha":"c92899e142c3edf8318d0a7a13c15ff7cfb3a0f4"}}]}]
BACKPORT-->

Co-authored-by: Ievgen Sorokopud <ievgen.sorokopud@elastic.co>
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this pull request Dec 19, 2024
… `RuleOverviewTab` (elastic#204318)

## Summary

These changes allow `Partial<RuleResponse>` to be used as a parameter
for `RuleOverviewTab` component.

We re-use this component for "SIEM Migrations" feature to display
translated state of the rule which has just a few fields that represent
the `RuleResponse` object. The set of fields used in `RuleMigration`
object is a minimum set of fields enough for the rule creation.

Right now, `RuleOverviewTab` component requires the complete
`RuleResponse` object to be passed even though internally each section
(`RuleAboutSection`, `RuleDefinitionSection`, `RuleScheduleSection` and
`RuleSetupGuideSection`) of the rule's overview expects
`Partial<RuleResponse>`. To be able to use this component we force type
casting at the moment and would like to get rid of it.

@elastic/security-detection-rule-management do you have objects
regarding this change in `RuleOverviewTab` intefrace?

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- Rule management cypress tests ([100 ESS & 100
Serverless](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7601))
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:Detection Rule Management Security Detection Rule Management Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team v8.18.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants