Skip to content

[Security Solution][Detection Engine] changes codeowners for rule create/edit form components#173906

Merged
vitaliidm merged 18 commits intoelastic:mainfrom
vitaliidm:de-8-13/rule-creation-codeowners
Jan 8, 2024
Merged

[Security Solution][Detection Engine] changes codeowners for rule create/edit form components#173906
vitaliidm merged 18 commits intoelastic:mainfrom
vitaliidm:de-8-13/rule-creation-codeowners

Conversation

@vitaliidm
Copy link
Contributor

@vitaliidm vitaliidm commented Dec 22, 2023

Summary

  • addresses [Security Solution][Alerts] change ownership for components used in rule create/edit #145420
  • moves almost all of the components from /x-pack/plugins/security_solution/public/detections/components/rules to
    • x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components , rule_creation_ui
      components that used only in rule creation are placed here
    • x-pack/plugins/security_solution/public/detection_engine/rule_creation/components , rule_creation
      components that used also in another areas(details, or rule tables), placed here
    • some of the basic components, like technical_preview_badge or severity_badge moved to common area: x-pack/plugins/security_solution/public/common/components

The rest of the components, used by rule-management team only, left /x-pack/plugins/security_solution/public/detections/components/rules.

rule_creation and rule_creation_ui folders owned by detection-engine team

Next steps?

Since the main purpose of this PR to change codeownership of components, there are still quite a few places where different types are imported from rule_creation_ui folder. For example. Type FieldValueQueryBar is imported in timeline component. With this refactoring, it becomes much easier to identify such imports and refactor it further in future

@vitaliidm
Copy link
Contributor Author

/ci

@vitaliidm vitaliidm self-assigned this Dec 22, 2023
@vitaliidm
Copy link
Contributor Author

/ci

@vitaliidm
Copy link
Contributor Author

/ci

@vitaliidm vitaliidm added refactoring release_note:skip Skip the PR/issue when compiling release notes Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Engine Security Solution Detection Engine Area v8.13.0 labels Dec 22, 2023
@vitaliidm vitaliidm requested a review from yctercero December 22, 2023 15:45
@vitaliidm vitaliidm changed the title [Security Solution][Detection Engine] change codeowners for rule creation [Security Solution][Detection Engine] changes codeowners for rule create/edit form components Dec 22, 2023
@vitaliidm vitaliidm requested a review from banderror December 22, 2023 16:35
@vitaliidm vitaliidm marked this pull request as ready for review December 22, 2023 16:35
@vitaliidm vitaliidm requested review from a team as code owners December 22, 2023 16:35
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@stephmilovic stephmilovic left a comment

Choose a reason for hiding this comment

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

Code changes LGTM for Explore team!

Copy link
Contributor

@yctercero yctercero left a comment

Choose a reason for hiding this comment

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

Thanks so much for getting to this - I think it's super helpful. I don't want to block as this touches a ton of files and I think it's a good move forward. I am wondering if we could reduce a bit of the complexity by merging some of these folders so the structure might be something like:

detections_response
  --> rule_creation
        --> components
               --> common
        --> containers
         --> logic
        --> pages (what you have as rule_creation_ui right now)
  --> rule_details
        --> components
               --> common
        --> containers
         --> logic
        --> pages (what you have as rule_details_ui right now)
  --> rule_edit
        --> components
               --> common
        --> containers
         --> logic
        --> pages 

@vitaliidm
Copy link
Contributor Author

@yctercero , thanks for feedback and proposal

Changes in PR are based on adopted earlier folder structure(#142950, a lot more in description with diagrams) and follow existing approach.
If we would like to change it, I propose to start discussion outside of this PR and agree on a new folder structure, if we find it more helpful. As my aim here was mainly to assign correct ownership and follow existing guidelines, I don't want to go outside of its scope and introduce major code structuring changes

@yctercero
Copy link
Contributor

@yctercero , thanks for feedback and proposal

Changes in PR are based on adopted earlier folder structure(#142950, a lot more in description with diagrams) and follow existing approach. If we would like to change it, I propose to start discussion outside of this PR and agree on a new folder structure, if we find it more helpful. As my aim here was mainly to assign correct ownership and follow existing guidelines, I don't want to go outside of its scope and introduce major code structuring changes

Makes sense! I don't think further restructure is a priority and like you mentioned the goal is to update ownership and this does just that! Thanks, I'll LGTM.

Copy link
Contributor

@banderror banderror left a comment

Choose a reason for hiding this comment

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

Rule Management changes LGTM 👍

Components moved and components left in public/detections/components/rules make sense. I left a couple of minor questions.

Great refactoring, thank you @vitaliidm!

Copy link
Contributor

Choose a reason for hiding this comment

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

I think MITRE components and model should be either under public/detection_engine/rule_management or its own generic subdomain public/detection_engine/mitre. Maybe except for the code that implements the form inputs for MITRE mappings, not sure.

Updating MITRE mappings is on the Rule Management team, specifically, @dplumlee used to do that work. We also own the MITRE Coverage Overview page.

I'd be ok merging this as is and taking a closer look at the public/detection_engine/rule_creation_ui/components/mitre folder later.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Just curious why components for the About, Define, and Schedule sections are under rule_creation_ui, but the one for the Actions section is under rule_creation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actions component is used within details section: https://github.com/elastic/kibana/pull/173906/files#diff-910140c9d6034d2b98eab04e82f22ac18451fe485e1951997ad22004b8920f56R66

I also notices, Details component used there too, so moved it as well to rule_creation. The rest are still in rule_creation_ui

@banderror
Copy link
Contributor

@yctercero @vitaliidm regarding #173906 (review):

The complexity is objectively there, but it has a reason. Our pages are complex and contain pieces from different subdomains. For instance, the Rule Details page contains: the rule details functionality itself, rule management actions, some ML jobs UI, rule monitoring UI, alerts table, exceptions. We can't keep all that code under a single detection_engine/rule_details folder - because some of it is used on other pages too. If we'd keep reusable code in folders like detection_engine/rule_details, we'd end up having bi-directional and circular dependencies between folders and unclear rules where to keep what code.

That's why we need at least two layers of code on the FE side: a layer of subdomains and a layer for pages. In #142950 we proposed that pages should live in "UI subdomains". Maybe that's what confuses people and we just need to tweak the folder structure a bit to remove this confusion. Something like that:

  • detection_engine
    • core or subdomains
      • rule_creation
      • rule_management
      • etc
    • pages
      • rule_creation
      • rule_editing
      • rule_details
      • rule_management
      • etc

++ for "If we would like to change it, I propose to start discussion outside of this PR and agree on a new folder structure"

@yctercero
Copy link
Contributor

@yctercero @vitaliidm regarding #173906 (review):

The complexity is objectively there, but it has a reason. Our pages are complex and contain pieces from different subdomains. For instance, the Rule Details page contains: the rule details functionality itself, rule management actions, some ML jobs UI, rule monitoring UI, alerts table, exceptions. We can't keep all that code under a single detection_engine/rule_details folder - because some of it is used on other pages too. If we'd keep reusable code in folders like detection_engine/rule_details, we'd end up having bi-directional and circular dependencies between folders and unclear rules where to keep what code.

That's why we need at least two layers of code on the FE side: a layer of subdomains and a layer for pages. In #142950 we proposed that pages should live in "UI subdomains". Maybe that's what confuses people and we just need to tweak the folder structure a bit to remove this confusion. Something like that:

  • detection_engine

    • core or subdomains

      • rule_creation
      • rule_management
      • etc
    • pages

      • rule_creation
      • rule_editing
      • rule_details
      • rule_management
      • etc

++ for "If we would like to change it, I propose to start discussion outside of this PR and agree on a new folder structure"

Thanks for the background on it. I do like that suggested structure. Though I think it's not a priority right now. Maybe if we get feedback from devs that it's confusing we can re-examine.

Copy link
Contributor

@tomsonpl tomsonpl left a comment

Choose a reason for hiding this comment

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

Defend Workflows changes LGTM 👍

Copy link
Contributor

@janmonschke janmonschke left a comment

Choose a reason for hiding this comment

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

THI changes lgtm 👍

@vitaliidm vitaliidm enabled auto-merge (squash) January 8, 2024 12:04
@kibana-ci
Copy link

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 4863 4864 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 11.4MB 11.4MB -281.0B

History

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

cc @vitaliidm

@vitaliidm vitaliidm merged commit c3801ce into elastic:main Jan 8, 2024
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Jan 8, 2024
delanni pushed a commit to delanni/kibana that referenced this pull request Jan 11, 2024
…ate/edit form components (elastic#173906)

## Summary

- addresses elastic#145420
- moves almost all of the components from
`/x-pack/plugins/security_solution/public/detections/components/rules`
to
-
`x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components`
, **rule_creation_ui**
  components that used only in rule creation are placed here
-
`x-pack/plugins/security_solution/public/detection_engine/rule_creation/components`
, **rule_creation**
components that used also in another areas(details, or rule tables),
placed here
- some of the basic components, like `technical_preview_badge` or
`severity_badge` moved to common area:
`x-pack/plugins/security_solution/public/common/components`

The rest of the components, used by rule-management team only, left
`/x-pack/plugins/security_solution/public/detections/components/rules`.

**rule_creation** and **rule_creation_ui** folders owned by
detection-engine team


## Next steps?

Since the main purpose of this PR to change codeownership of components,
there are still quite a few places where different types are imported
from `rule_creation_ui` folder. [For
example](https://github.com/elastic/kibana/pull/173906/files#diff-4162e1e577d6b1891a6865ffea6950a9e8a04183e4ea345659bd04fd31ed135dR23).
Type `FieldValueQueryBar` is imported in timeline component. With this
refactoring, it becomes much easier to identify such imports and
refactor it further in future

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@vitaliidm vitaliidm deleted the de-8-13/rule-creation-codeowners branch March 4, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting refactoring release_note:skip Skip the PR/issue when compiling release notes Team:Detection Engine Security Solution Detection Engine Area Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.13.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants