-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Disable Install All button when installation is in progress #201731
Conversation
💚 Build Succeeded
Metrics [docs]Async chunks
|
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management) |
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#7484[✅] [Serverless] Security Solution Rule Management - Prebuilt Rules - Cypress: 200/200 tests passed. |
Thanks for the PR, @jkelas! I've tested it locally and can confirm that the button remains disabled when you navigate away and then return to the page. I couldn't find a way to break it. State after clicking on "Install all" button State after returning to the installation page while "Install all" is in progress We can fix these if we move And then also make use of |
...ment_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table_context.tsx
Outdated
Show resolved
Hide resolved
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.
I have taken a look at the updated code and retested the PR. It looks good to me now.
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.
@jkelas It works like a charm! 🙌
Tested the fix locally and wasn't able to break it - the state is persisted between SPA navigations across all pages in Kibana. Great solution with react-query!
Also reviewed the code changes. Everything LGTM 👍 I left one minor suggestion regarding separating concerns in the FE code.
...ent_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_header_buttons.tsx
Show resolved
Hide resolved
...ent_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_install_button.tsx
Show resolved
Hide resolved
..._ui/components/rules_table/add_prebuilt_rules_table/use_add_prebuilt_rules_table_columns.tsx
Show resolved
Hide resolved
Starting backport for target branches: 8.16, 8.17, 8.x https://github.com/elastic/kibana/actions/runs/12050060645 |
…n progress (elastic#201731) **Resolves: elastic#180660** ## Summary In this PR I am fixing a problem of the `Install All` button being re-enabled when entering the page again. I am fixing only the UI problem here, only for the scenario described in the ticket: single user interacting with single instance of Kibana. During investigation I discovered and discussed with the team other scenarios which may lead to race condition when installing rules, but the team agreed to work on them separately. The fix uses `useIsMutating` hook to check that the mutation is pending. Such information is added to the `AddPrebuiltRulesTableContext` and then used to disable the `Install All` button in the component. Recording: https://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [X] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483 https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484 (cherry picked from commit 9ca719c)
…n progress (elastic#201731) **Resolves: elastic#180660** ## Summary In this PR I am fixing a problem of the `Install All` button being re-enabled when entering the page again. I am fixing only the UI problem here, only for the scenario described in the ticket: single user interacting with single instance of Kibana. During investigation I discovered and discussed with the team other scenarios which may lead to race condition when installing rules, but the team agreed to work on them separately. The fix uses `useIsMutating` hook to check that the mutation is pending. Such information is added to the `AddPrebuiltRulesTableContext` and then used to disable the `Install All` button in the component. Recording: https://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [X] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483 https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484 (cherry picked from commit 9ca719c)
…n progress (elastic#201731) **Resolves: elastic#180660** ## Summary In this PR I am fixing a problem of the `Install All` button being re-enabled when entering the page again. I am fixing only the UI problem here, only for the scenario described in the ticket: single user interacting with single instance of Kibana. During investigation I discovered and discussed with the team other scenarios which may lead to race condition when installing rules, but the team agreed to work on them separately. The fix uses `useIsMutating` hook to check that the mutation is pending. Such information is added to the `AddPrebuiltRulesTableContext` and then used to disable the `Install All` button in the component. Recording: https://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [X] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483 https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484 (cherry picked from commit 9ca719c)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…on is in progress (#201731) (#201962) # Backport This will backport the following commits from `main` to `8.17`: - [[Security Solution] Disable Install All button when installation is in progress (#201731)](#201731) <!--- 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":"2024-11-27T12:13:58Z","message":"[Security Solution] Disable Install All button when installation is in progress (#201731)\n\n**Resolves: #180660**\r\n\r\n## Summary\r\n\r\nIn this PR I am fixing a problem of the `Install All` button being\r\nre-enabled when entering the page again.\r\nI am fixing only the UI problem here, only for the scenario described in\r\nthe ticket: single user interacting with single instance of Kibana.\r\nDuring investigation I discovered and discussed with the team other\r\nscenarios which may lead to race condition when installing rules, but\r\nthe team agreed to work on them separately.\r\n\r\nThe fix uses `useIsMutating` hook to check that the mutation is pending.\r\nSuch information is added to the `AddPrebuiltRulesTableContext` and then\r\nused to disable the `Install All` button in the component.\r\n\r\nRecording:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409\r\n\r\n\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\r\n- [X] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484","sha":"9ca719c2926c766a2a8623bab5814996a3e43833","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","backport:version","v8.17.0","v8.18.0","v8.16.2"],"title":"[Security Solution] Disable Install All button when installation is in progress","number":201731,"url":"https://github.com/elastic/kibana/pull/201731","mergeCommit":{"message":"[Security Solution] Disable Install All button when installation is in progress (#201731)\n\n**Resolves: #180660**\r\n\r\n## Summary\r\n\r\nIn this PR I am fixing a problem of the `Install All` button being\r\nre-enabled when entering the page again.\r\nI am fixing only the UI problem here, only for the scenario described in\r\nthe ticket: single user interacting with single instance of Kibana.\r\nDuring investigation I discovered and discussed with the team other\r\nscenarios which may lead to race condition when installing rules, but\r\nthe team agreed to work on them separately.\r\n\r\nThe fix uses `useIsMutating` hook to check that the mutation is pending.\r\nSuch information is added to the `AddPrebuiltRulesTableContext` and then\r\nused to disable the `Install All` button in the component.\r\n\r\nRecording:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409\r\n\r\n\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\r\n- [X] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484","sha":"9ca719c2926c766a2a8623bab5814996a3e43833"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201731","number":201731,"mergeCommit":{"message":"[Security Solution] Disable Install All button when installation is in progress (#201731)\n\n**Resolves: #180660**\r\n\r\n## Summary\r\n\r\nIn this PR I am fixing a problem of the `Install All` button being\r\nre-enabled when entering the page again.\r\nI am fixing only the UI problem here, only for the scenario described in\r\nthe ticket: single user interacting with single instance of Kibana.\r\nDuring investigation I discovered and discussed with the team other\r\nscenarios which may lead to race condition when installing rules, but\r\nthe team agreed to work on them separately.\r\n\r\nThe fix uses `useIsMutating` hook to check that the mutation is pending.\r\nSuch information is added to the `AddPrebuiltRulesTableContext` and then\r\nused to disable the `Install All` button in the component.\r\n\r\nRecording:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409\r\n\r\n\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\r\n- [X] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484","sha":"9ca719c2926c766a2a8623bab5814996a3e43833"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jacek Kolezynski <[email protected]>
…on is in progress (#201731) (#201961) # Backport This will backport the following commits from `main` to `8.16`: - [[Security Solution] Disable Install All button when installation is in progress (#201731)](#201731) <!--- 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":"2024-11-27T12:13:58Z","message":"[Security Solution] Disable Install All button when installation is in progress (#201731)\n\n**Resolves: #180660**\r\n\r\n## Summary\r\n\r\nIn this PR I am fixing a problem of the `Install All` button being\r\nre-enabled when entering the page again.\r\nI am fixing only the UI problem here, only for the scenario described in\r\nthe ticket: single user interacting with single instance of Kibana.\r\nDuring investigation I discovered and discussed with the team other\r\nscenarios which may lead to race condition when installing rules, but\r\nthe team agreed to work on them separately.\r\n\r\nThe fix uses `useIsMutating` hook to check that the mutation is pending.\r\nSuch information is added to the `AddPrebuiltRulesTableContext` and then\r\nused to disable the `Install All` button in the component.\r\n\r\nRecording:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409\r\n\r\n\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\r\n- [X] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484","sha":"9ca719c2926c766a2a8623bab5814996a3e43833","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","backport:version","v8.17.0","v8.18.0","v8.16.2"],"title":"[Security Solution] Disable Install All button when installation is in progress","number":201731,"url":"https://github.com/elastic/kibana/pull/201731","mergeCommit":{"message":"[Security Solution] Disable Install All button when installation is in progress (#201731)\n\n**Resolves: #180660**\r\n\r\n## Summary\r\n\r\nIn this PR I am fixing a problem of the `Install All` button being\r\nre-enabled when entering the page again.\r\nI am fixing only the UI problem here, only for the scenario described in\r\nthe ticket: single user interacting with single instance of Kibana.\r\nDuring investigation I discovered and discussed with the team other\r\nscenarios which may lead to race condition when installing rules, but\r\nthe team agreed to work on them separately.\r\n\r\nThe fix uses `useIsMutating` hook to check that the mutation is pending.\r\nSuch information is added to the `AddPrebuiltRulesTableContext` and then\r\nused to disable the `Install All` button in the component.\r\n\r\nRecording:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409\r\n\r\n\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\r\n- [X] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484","sha":"9ca719c2926c766a2a8623bab5814996a3e43833"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201731","number":201731,"mergeCommit":{"message":"[Security Solution] Disable Install All button when installation is in progress (#201731)\n\n**Resolves: #180660**\r\n\r\n## Summary\r\n\r\nIn this PR I am fixing a problem of the `Install All` button being\r\nre-enabled when entering the page again.\r\nI am fixing only the UI problem here, only for the scenario described in\r\nthe ticket: single user interacting with single instance of Kibana.\r\nDuring investigation I discovered and discussed with the team other\r\nscenarios which may lead to race condition when installing rules, but\r\nthe team agreed to work on them separately.\r\n\r\nThe fix uses `useIsMutating` hook to check that the mutation is pending.\r\nSuch information is added to the `AddPrebuiltRulesTableContext` and then\r\nused to disable the `Install All` button in the component.\r\n\r\nRecording:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409\r\n\r\n\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\r\n- [X] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484","sha":"9ca719c2926c766a2a8623bab5814996a3e43833"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jacek Kolezynski <[email protected]>
…n is in progress (#201731) (#201963) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Disable Install All button when installation is in progress (#201731)](#201731) <!--- 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":"2024-11-27T12:13:58Z","message":"[Security Solution] Disable Install All button when installation is in progress (#201731)\n\n**Resolves: #180660**\r\n\r\n## Summary\r\n\r\nIn this PR I am fixing a problem of the `Install All` button being\r\nre-enabled when entering the page again.\r\nI am fixing only the UI problem here, only for the scenario described in\r\nthe ticket: single user interacting with single instance of Kibana.\r\nDuring investigation I discovered and discussed with the team other\r\nscenarios which may lead to race condition when installing rules, but\r\nthe team agreed to work on them separately.\r\n\r\nThe fix uses `useIsMutating` hook to check that the mutation is pending.\r\nSuch information is added to the `AddPrebuiltRulesTableContext` and then\r\nused to disable the `Install All` button in the component.\r\n\r\nRecording:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409\r\n\r\n\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\r\n- [X] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484","sha":"9ca719c2926c766a2a8623bab5814996a3e43833","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","backport:version","v8.17.0","v8.18.0","v8.16.2"],"title":"[Security Solution] Disable Install All button when installation is in progress","number":201731,"url":"https://github.com/elastic/kibana/pull/201731","mergeCommit":{"message":"[Security Solution] Disable Install All button when installation is in progress (#201731)\n\n**Resolves: #180660**\r\n\r\n## Summary\r\n\r\nIn this PR I am fixing a problem of the `Install All` button being\r\nre-enabled when entering the page again.\r\nI am fixing only the UI problem here, only for the scenario described in\r\nthe ticket: single user interacting with single instance of Kibana.\r\nDuring investigation I discovered and discussed with the team other\r\nscenarios which may lead to race condition when installing rules, but\r\nthe team agreed to work on them separately.\r\n\r\nThe fix uses `useIsMutating` hook to check that the mutation is pending.\r\nSuch information is added to the `AddPrebuiltRulesTableContext` and then\r\nused to disable the `Install All` button in the component.\r\n\r\nRecording:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409\r\n\r\n\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\r\n- [X] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484","sha":"9ca719c2926c766a2a8623bab5814996a3e43833"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201731","number":201731,"mergeCommit":{"message":"[Security Solution] Disable Install All button when installation is in progress (#201731)\n\n**Resolves: #180660**\r\n\r\n## Summary\r\n\r\nIn this PR I am fixing a problem of the `Install All` button being\r\nre-enabled when entering the page again.\r\nI am fixing only the UI problem here, only for the scenario described in\r\nthe ticket: single user interacting with single instance of Kibana.\r\nDuring investigation I discovered and discussed with the team other\r\nscenarios which may lead to race condition when installing rules, but\r\nthe team agreed to work on them separately.\r\n\r\nThe fix uses `useIsMutating` hook to check that the mutation is pending.\r\nSuch information is added to the `AddPrebuiltRulesTableContext` and then\r\nused to disable the `Install All` button in the component.\r\n\r\nRecording:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409\r\n\r\n\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\r\n- [X] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484","sha":"9ca719c2926c766a2a8623bab5814996a3e43833"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jacek Kolezynski <[email protected]>
…n progress (elastic#201731) **Resolves: elastic#180660** ## Summary In this PR I am fixing a problem of the `Install All` button being re-enabled when entering the page again. I am fixing only the UI problem here, only for the scenario described in the ticket: single user interacting with single instance of Kibana. During investigation I discovered and discussed with the team other scenarios which may lead to race condition when installing rules, but the team agreed to work on them separately. The fix uses `useIsMutating` hook to check that the mutation is pending. Such information is added to the `AddPrebuiltRulesTableContext` and then used to disable the `Install All` button in the component. Recording: https://github.com/user-attachments/assets/777dd6a5-2441-4101-8368-04cdcede1409 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [X] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483 https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484
…4022) ## 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](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]>
… (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)
… (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)
… (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)
… (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]>
… (#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]>
… (#204022) (#205904) # Backport This will backport the following commits from `main` to `8.17`: - [[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]>
#204022) (#205905) # Backport This will backport the following commits from `main` to `8.x`: - [[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]>
… (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]>
… (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]>
Resolves: #180660
Summary
In this PR I am fixing a problem of the
Install All
button being re-enabled when entering the page again.I am fixing only the UI problem here, only for the scenario described in the ticket: single user interacting with single instance of Kibana.
During investigation I discovered and discussed with the team other scenarios which may lead to race condition when installing rules, but the team agreed to work on them separately.
The fix uses
useIsMutating
hook to check that the mutation is pending. Such information is added to theAddPrebuiltRulesTableContext
and then used to disable theInstall All
button in the component.Recording:
Screen.Recording.2024-11-26.at.10.18.36.mov
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7483
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7484