Skip to content
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] Implement refactoring remark from PR #201731 #204022

Merged
merged 16 commits into from
Jan 8, 2025

Conversation

jkelas
Copy link
Contributor

@jkelas jkelas commented Dec 12, 2024

Summary

In the PR #201731 for ticket #180660 @banderror advised to refactor code in that PR to better separate the concerns (business logic from components). This is the implementation of that review remark.

Recording:

Refactoring_for_install_all_button.mov

@jkelas jkelas added refactoring impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. v9.0.0 Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team backport:version Backport to applied version labels v8.18.0 v8.16.2 v8.17.1 labels Dec 12, 2024
@jkelas jkelas marked this pull request as ready for review December 12, 2024 14:05
@jkelas jkelas requested a review from a team as a code owner December 12, 2024 14:05
@jkelas jkelas requested a review from xcrzx December 12, 2024 14:05
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)

@banderror banderror added v8.16.3 release_note:skip Skip the PR/issue when compiling release notes Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area and removed v8.16.2 release_note:fix impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Dec 13, 2024
@jpdjere jpdjere requested review from jpdjere and removed request for xcrzx December 16, 2024 13:58
@banderror banderror requested review from banderror and removed request for jpdjere January 2, 2025 11:02
@nikitaindik nikitaindik requested review from nikitaindik and removed request for banderror January 6, 2025 13:30
@banderror
Copy link
Contributor

@elasticmachine merge upstream

@nikitaindik nikitaindik added ci:cloud-deploy Create or update a Cloud deployment ci:project-deploy-security Create a Security Serverless Project labels Jan 7, 2025
Copy link
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.

If I understand Georgii's comment correctly, he's suggesting moving the computation of isRuleInstalling and isDisabled into the context and then using these computed values in components.

After discussing this with @xcrzx, we concluded that isRuleInstalling from add_prebuilt_rules_header_buttons.tsx can be renamed to isAnyRuleInstalling, moved to AddPrebuiltRulesTableContextProvider, and exposed as state.isAnyRuleInstalling. Since it represents a generic business logic state, it makes sense to move it to the context.

However, we think that isRuleInstalling in add_prebuilt_rules_install_button.tsx and isDisabled in use_add_prebuilt_rules_table_columns.tsx should remain as they are. Ideally, the context should provide generic data without being tied to specific usage scenarios, but if we move these into context, it'll know too much.

Feel free to reach out if you have questions about this.

@jkelas jkelas force-pushed the Followup_for_PR_201731_for_ticket_180660 branch from b8869fb to b343667 Compare January 8, 2025 12:00
Copy link
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.

Thanks for the PR, @jkelas! Nicely done! 👍

I've tested the changes locally and can confirm that it works as expected.

@elasticmachine
Copy link
Contributor

elasticmachine commented Jan 8, 2025

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
securitySolution 22.2MB 22.2MB -6.0B

History

cc @jkelas

@jkelas jkelas enabled auto-merge (squash) January 8, 2025 13:40
@jkelas jkelas merged commit 20eb87d into elastic:main Jan 8, 2025
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.17, 8.x

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 8, 2025
… (elastic#204022)

## Summary

In the PR elastic#201731 for ticket elastic#180660 @banderror advised to refactor code
in that PR to better separate the concerns (business logic from
components). This is the implementation of that review
[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).

Recording:

https://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Nikita Indik <[email protected]>
(cherry picked from commit 20eb87d)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 8, 2025
… (elastic#204022)

## Summary

In the PR elastic#201731 for ticket elastic#180660 @banderror advised to refactor code
in that PR to better separate the concerns (business logic from
components). This is the implementation of that review
[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).

Recording:

https://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Nikita Indik <[email protected]>
(cherry picked from commit 20eb87d)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 8, 2025
… (elastic#204022)

## Summary

In the PR elastic#201731 for ticket elastic#180660 @banderror advised to refactor code
in that PR to better separate the concerns (business logic from
components). This is the implementation of that review
[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).

Recording:

https://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Nikita Indik <[email protected]>
(cherry picked from commit 20eb87d)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.16
8.17
8.x

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

Questions ?

Please refer to the Backport tool documentation

crespocarlos pushed a commit to crespocarlos/kibana that referenced this pull request Jan 8, 2025
… (elastic#204022)

## Summary

In the PR elastic#201731 for ticket elastic#180660 @banderror advised to refactor code
in that PR to better separate the concerns (business logic from
components). This is the implementation of that review
[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).

Recording:


https://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Nikita Indik <[email protected]>
kibanamachine added a commit that referenced this pull request Jan 8, 2025
… (#204022) (#205903)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Security Solution] Implement refactoring remark from PR #201731
(#204022)](#204022)

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

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

<!--BACKPORT [{"author":{"name":"Jacek
Kolezynski","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-08T14:01:47Z","message":"[Security
Solution] Implement refactoring remark from PR #201731 (#204022)\n\n##
Summary\n\nIn the PR #201731 for ticket #180660 @banderror advised to
refactor code\nin that PR to better separate the concerns (business
logic from\ncomponents). This is the implementation of that
review\n[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).\n\nRecording:\n\n\nhttps://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47\n\n---------\n\nCo-authored-by:
Elastic Machine
<[email protected]>\nCo-authored-by: Nikita Indik
<[email protected]>","sha":"20eb87d778a69b6b0d7132732cbea9cce44e895c","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["refactoring","release_note:skip","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","ci:cloud-deploy","ci:project-deploy-security","backport:version","v8.18.0","v8.16.3","v8.17.1"],"title":"[Security
Solution] Implement refactoring remark from PR
#201731","number":204022,"url":"https://github.com/elastic/kibana/pull/204022","mergeCommit":{"message":"[Security
Solution] Implement refactoring remark from PR #201731 (#204022)\n\n##
Summary\n\nIn the PR #201731 for ticket #180660 @banderror advised to
refactor code\nin that PR to better separate the concerns (business
logic from\ncomponents). This is the implementation of that
review\n[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).\n\nRecording:\n\n\nhttps://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47\n\n---------\n\nCo-authored-by:
Elastic Machine
<[email protected]>\nCo-authored-by: Nikita Indik
<[email protected]>","sha":"20eb87d778a69b6b0d7132732cbea9cce44e895c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16","8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204022","number":204022,"mergeCommit":{"message":"[Security
Solution] Implement refactoring remark from PR #201731 (#204022)\n\n##
Summary\n\nIn the PR #201731 for ticket #180660 @banderror advised to
refactor code\nin that PR to better separate the concerns (business
logic from\ncomponents). This is the implementation of that
review\n[remark](https://github.com/elastic/kibana/pull/201731/files#r1860492191).\n\nRecording:\n\n\nhttps://github.com/user-attachments/assets/471a0986-bcdb-4611-ab1a-bdcbe5151f47\n\n---------\n\nCo-authored-by:
Elastic Machine
<[email protected]>\nCo-authored-by: Nikita Indik
<[email protected]>","sha":"20eb87d778a69b6b0d7132732cbea9cce44e895c"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jacek Kolezynski <[email protected]>
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 ci:cloud-deploy Create or update a Cloud deployment ci:project-deploy-security Create a Security Serverless Project Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area refactoring release_note:skip Skip the PR/issue when compiling release notes Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.16.3 v8.17.1 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants