-
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
[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table #195736
[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table #195736
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
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.
Could you please add a unit test to test the new behavior?
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.
Done in cae83a7 ✅
@@ -71,6 +71,9 @@ export function RuleComponent({ | |||
}: RuleComponentProps) { | |||
const { ruleTypeRegistry, actionTypeRegistry, alertsTableConfigurationRegistry } = | |||
useKibana().services; | |||
// The lastReloadRequestTime should be updated when the refreshToken changes | |||
// eslint-disable-next-line react-hooks/exhaustive-deps | |||
const lastReloadRequestTime = useMemo(() => +new Date(), [refreshToken]); |
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.
nit: For readability maybe we can do new Date().getTime()
. +new Date()
is a bit difficult to understand what it does.
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.
This isn't exactly what memo is meant to be used for. Is this a hack or is there an underlaying issue? Shouldn't this be done with an effect?
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.
Changed to getTime()
in cae83a7 ✅
@jcger it's a temporary solution based on the two tools we already have at our disposal (refreshToken
for the rule page and lastReloadRequestTime
for the alerts table). In alerts-table-refactor
I introduced an imperative handle to forward a couple of APIs such as the original refresh
function, which we could use as a more definitive and cleaner solution 🙂
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.
Tested and works 🙌
Starting backport for target branches: 8.15, 8.16, 8.x https://github.com/elastic/kibana/actions/runs/11382486175 |
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
|
…ton to alerts table (elastic#195736) ## Summary Forwards the reload request from the Stack Management rule detail page `🔄 Refresh` button to the alerts table. ## To verify 1. Create a Stack rule that fires alerts 2. Visit that rule's detail page 3. Check that the `🔄 Refresh` button correctly refreshes the alerts table (i.e. by changing the rule params and checking that the alerts update accordingly) ## References Fixes elastic#188405, elastic#183155 (cherry picked from commit 6a0ad10)
…ton to alerts table (elastic#195736) ## Summary Forwards the reload request from the Stack Management rule detail page `🔄 Refresh` button to the alerts table. ## To verify 1. Create a Stack rule that fires alerts 2. Visit that rule's detail page 3. Check that the `🔄 Refresh` button correctly refreshes the alerts table (i.e. by changing the rule params and checking that the alerts update accordingly) ## References Fixes elastic#188405, elastic#183155 (cherry picked from commit 6a0ad10)
…ton to alerts table (elastic#195736) ## Summary Forwards the reload request from the Stack Management rule detail page `🔄 Refresh` button to the alerts table. ## To verify 1. Create a Stack rule that fires alerts 2. Visit that rule's detail page 3. Check that the `🔄 Refresh` button correctly refreshes the alerts table (i.e. by changing the rule params and checking that the alerts update accordingly) ## References Fixes elastic#188405, elastic#183155 (cherry picked from commit 6a0ad10)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…esh button to alerts table (#195736) (#196652) # Backport This will backport the following commits from `main` to `8.15`: - [[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)](#195736) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Umberto Pepato","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-17T09:46:29Z","message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-major","v8.16.0","v8.15.3"],"title":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table","number":195736,"url":"https://github.com/elastic/kibana/pull/195736","mergeCommit":{"message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195736","number":195736,"mergeCommit":{"message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Umberto Pepato <[email protected]>
…sh button to alerts table (#195736) (#196654) # Backport This will backport the following commits from `main` to `8.x`: - [[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)](#195736) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Umberto Pepato","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-17T09:46:29Z","message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-major","v8.16.0","v8.15.3"],"title":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table","number":195736,"url":"https://github.com/elastic/kibana/pull/195736","mergeCommit":{"message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195736","number":195736,"mergeCommit":{"message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Umberto Pepato <[email protected]>
This PR didn't make it into the latest BC of v8.15.3. Updating the labels. |
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
…esh button to alerts table (#195736) (#196653) # Backport This will backport the following commits from `main` to `8.16`: - [[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)](#195736) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Umberto Pepato","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-17T09:46:29Z","message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-major","v8.16.0","v8.15.3"],"title":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table","number":195736,"url":"https://github.com/elastic/kibana/pull/195736","mergeCommit":{"message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195736","number":195736,"mergeCommit":{"message":"[ResponseOps][Rules][Alerts] Link stack rule details page refresh button to alerts table (#195736)\n\n## Summary\r\n\r\nForwards the reload request from the Stack Management rule detail page\r\n`🔄 Refresh` button to the alerts table.\r\n\r\n## To verify\r\n\r\n1. Create a Stack rule that fires alerts\r\n2. Visit that rule's detail page\r\n3. Check that the `🔄 Refresh` button correctly refreshes the alerts\r\ntable (i.e. by changing the rule params and checking that the alerts\r\nupdate accordingly)\r\n\r\n## References\r\n\r\nFixes #188405, #183155","sha":"6a0ad109087fd8b9efe9198a6df23f4658929c05"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Umberto Pepato <[email protected]>
Summary
Forwards the reload request from the Stack Management rule detail page
🔄 Refresh
button to the alerts table.To verify
🔄 Refresh
button correctly refreshes the alerts table (i.e. by changing the rule params and checking that the alerts update accordingly)References
Fixes #188405, #183155