Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [Reporting] Delete the task from Task Manager when deleting a r…
…eport (#192417) (#194758) # Backport This will backport the following commits from `main` to `8.x`: - [[Reporting] Delete the task from Task Manager when deleting a report (#192417)](#192417) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Tim Sullivan","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-02T19:04:39Z","message":"[Reporting] Delete the task from Task Manager when deleting a report (#192417)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/191676\r\n\r\nThis PR ensures that when a user deletes a report, if there is a backing\r\nTask Manager task that references the report job, that task is deleted\r\nas well. With these changes, the report job will truly be \"cancelled\"\r\nwhen a report is deleted.\r\n\r\nThe risk of not cancelling the Task Manager task when deleting a report\r\nis evident in server logs and in task monitoring, when automated tests\r\nare run on the reporting features.\r\n\r\n### How to test\r\nPrimarily, the API Integration test for the Reporting Datastream\r\nexercises the changes in this PR.\r\n\r\n### Checklist\r\n\r\n- [x] Ensure the API/Functional tests are using the delete report\r\nendpoint rather than directly deleting reports from the ES store.\r\n* **To prevent this PR from becoming very large, this assurance is only\r\nneeded for serverless tests, and for tests that do not wait for the\r\nreport job to be completed before deleting the report document.**\r\n* Those constrictions narrow the changes down to just the test on the\r\nReporting Datastream\r\n- [x] Handle scenario of report document deleted before task begins or\r\ncompletes\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\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"dfee92802d386a9d1d64e62bd363695a2b860b31","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:SharedUX","v8.16.0","Feature:Reporting:Framework","backport:version"],"title":"[Reporting] Delete the task from Task Manager when deleting a report","number":192417,"url":"https://github.com/elastic/kibana/pull/192417","mergeCommit":{"message":"[Reporting] Delete the task from Task Manager when deleting a report (#192417)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/191676\r\n\r\nThis PR ensures that when a user deletes a report, if there is a backing\r\nTask Manager task that references the report job, that task is deleted\r\nas well. With these changes, the report job will truly be \"cancelled\"\r\nwhen a report is deleted.\r\n\r\nThe risk of not cancelling the Task Manager task when deleting a report\r\nis evident in server logs and in task monitoring, when automated tests\r\nare run on the reporting features.\r\n\r\n### How to test\r\nPrimarily, the API Integration test for the Reporting Datastream\r\nexercises the changes in this PR.\r\n\r\n### Checklist\r\n\r\n- [x] Ensure the API/Functional tests are using the delete report\r\nendpoint rather than directly deleting reports from the ES store.\r\n* **To prevent this PR from becoming very large, this assurance is only\r\nneeded for serverless tests, and for tests that do not wait for the\r\nreport job to be completed before deleting the report document.**\r\n* Those constrictions narrow the changes down to just the test on the\r\nReporting Datastream\r\n- [x] Handle scenario of report document deleted before task begins or\r\ncompletes\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\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"dfee92802d386a9d1d64e62bd363695a2b860b31"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192417","number":192417,"mergeCommit":{"message":"[Reporting] Delete the task from Task Manager when deleting a report (#192417)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/191676\r\n\r\nThis PR ensures that when a user deletes a report, if there is a backing\r\nTask Manager task that references the report job, that task is deleted\r\nas well. With these changes, the report job will truly be \"cancelled\"\r\nwhen a report is deleted.\r\n\r\nThe risk of not cancelling the Task Manager task when deleting a report\r\nis evident in server logs and in task monitoring, when automated tests\r\nare run on the reporting features.\r\n\r\n### How to test\r\nPrimarily, the API Integration test for the Reporting Datastream\r\nexercises the changes in this PR.\r\n\r\n### Checklist\r\n\r\n- [x] Ensure the API/Functional tests are using the delete report\r\nendpoint rather than directly deleting reports from the ES store.\r\n* **To prevent this PR from becoming very large, this assurance is only\r\nneeded for serverless tests, and for tests that do not wait for the\r\nreport job to be completed before deleting the report document.**\r\n* Those constrictions narrow the changes down to just the test on the\r\nReporting Datastream\r\n- [x] Handle scenario of report document deleted before task begins or\r\ncompletes\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\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"dfee92802d386a9d1d64e62bd363695a2b860b31"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Tim Sullivan <[email protected]>
- Loading branch information