-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[FTR] Collapse Alerting API Helpers Impl #192216
[FTR] Collapse Alerting API Helpers Impl #192216
Conversation
9a8ef08
to
6e9c32d
Compare
/ci |
2 similar comments
/ci |
/ci |
bf80a43
to
c2df265
Compare
/ci |
c2df265
to
4dcabbc
Compare
/ci |
Pinging @elastic/appex-qa (Team:QA) |
@@ -17,6 +16,7 @@ import { SvlCasesServiceProvider } from '../../api_integration/services/svl_case | |||
import { MachineLearningProvider } from './ml'; | |||
import { LogsSynthtraceProvider } from './log'; | |||
import { UISettingsServiceProvider } from './ui_settings'; | |||
import { services as SvlApiIntegrationSvcs } from '../../api_integration/services'; |
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.
since it is shared by api integration and functional tests, lets move straight to x-pack/test_serverless//shared/services
?
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.
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.
LGTM, left suggestion about moving it to shared
services
…rom deployment agnostic (DA).
This reverts commit 9d22e8c.
…x-pack/test/api_integration/deployment_agnostic` (#193975) ## Summary Follow up of [this pr](#192216), per [this discussion](#192216 (comment)). Also, switch from `svlCommonApi` to `samlAuth` for internal headers. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11516349219 |
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11516354456 |
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11516354504 |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## Summary Resolves: elastic#192201 - Expose `TryWithRetriesOptions` - Tune timeouts to pass ci - Add attempt count debug info to `retry/retry_for_success.ts` - Helps with tuning timeout params - Move exposure of `AlertingApiProvider` from `x-pack/test_serverless/api_integration/services/index.ts` -> `x-pack/test_serverless/shared/services/deployment_agnostic_services.ts` - This exposes the alerting api under Deployment Agnostic Services (DA), and DA is exposed within `x-pack/test_serverless/functional/services/index.ts` (Shared Services [Serverless]) - Collapse helper script functions into just another object literal stanza within `AlertingApiProvider` - Update all references - Refactor alerting api to use `retry` service, instead of p-retry (following [this pr](elastic#178660)) ### Additional debug logging Run in debug mode (add `-v`): ``` node scripts/functional_tests \ --config x-pack/test_serverless/api_integration/test_suites/search/common_configs/config.group1.ts \ --grep "Summary actions" -v ``` #### After ``` │ sill retry.tryWithRetries('Alerting API - waitForDocumentInIndex, retryOptions: {"retryCount":5,"retryDelay":200}', [object AsyncFunction], [object Object]) │ debg --- retry.tryWithRetries error: index_not_found_exception │ Root causes: │ index_not_found_exception: no such index [alert-action-es-query] - Attempt #: 1 │ sill es.search([object Object]) │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 2 │ sill es.search([object Object]) │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 3 │ sill es.search([object Object]) │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 4 │ sill es.search([object Object]) │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 5 ... // Msg after all attempts fail: │ Error: retry.tryWithRetries reached the limit of attempts waiting for 'Alerting API - waitForDocumentInIndex, retryOptions: {"retryCount":5,"retryDelay":200}': 5 out of 5 │ ResponseError: index_not_found_exception │ Root causes: │ index_not_found_exception: no such index [alert-action-es-query] │ at SniffingTransport._request (node_modules/@elastic/transport/src/Transport.ts:601:17) │ at processTicksAndRejections (node:internal/process/task_queues:95:5) │ at /Users/trezworkbox/dev/main.worktrees/cleanup-alerting-api/node_modules/@elastic/transport/src/Transport.ts:704:22 │ at SniffingTransport.request (node_modules/@elastic/transport/src/Transport.ts:701:14) │ at Proxy.SearchApi (node_modules/@elastic/elasticsearch/src/api/api/search.ts:96:10) │ at alerting_api.ts:123:28 │ at runAttempt (retry_for_success.ts:30:15) │ at retryForSuccess (retry_for_success.ts:99:21) │ at Proxy.tryWithRetries (retry.ts:113:12) │ at Object.waitForDocumentInIndex (alerting_api.ts:120:14) │ at Context.<anonymous> (summary_actions.ts:146:20) │ at Object.apply (wrap_function.js:74:16) │ at Object.apply (wrap_function.js:74:16) │ at onFailure (retry_for_success.ts:18:9) │ at retryForSuccess (retry_for_success.ts:75:7) │ at Proxy.tryWithRetries (retry.ts:113:12) │ at Object.waitForDocumentInIndex (alerting_api.ts:120:14) │ at Context.<anonymous> (summary_actions.ts:146:20) │ at Object.apply (wrap_function.js:74:16) │ at Object.apply (wrap_function.js:74:16) ``` ### Notes Was put back in draft to additional scope detailed in issue linked above. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 9d22e8c)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [[FTR] Collapse Alerting API Helpers Impl (#192216)](#192216) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Tre","email":"wayne.seymour@elastic.co"},"sourceCommit":{"committedDate":"2024-09-16T14:42:06Z","message":"[FTR] Collapse Alerting API Helpers Impl (#192216)\n\n## Summary\r\nResolves: https://github.com/elastic/kibana/issues/192201\r\n\r\n- Expose `TryWithRetriesOptions`\r\n - Tune timeouts to pass ci \r\n- Add attempt count debug info to `retry/retry_for_success.ts`\r\n - Helps with tuning timeout params\r\n- Move exposure of `AlertingApiProvider` from\r\n`x-pack/test_serverless/api_integration/services/index.ts` ->\r\n`x-pack/test_serverless/shared/services/deployment_agnostic_services.ts`\r\n- This exposes the alerting api under Deployment Agnostic Services (DA),\r\nand DA is exposed within\r\n`x-pack/test_serverless/functional/services/index.ts` (Shared Services\r\n[Serverless])\r\n- Collapse helper script functions into just another object literal\r\nstanza within `AlertingApiProvider`\r\n- Update all references\r\n- Refactor alerting api to use `retry` service, instead of p-retry\r\n(following [this pr](https://github.com/elastic/kibana/pull/178660))\r\n\r\n### Additional debug logging \r\n\r\nRun in debug mode (add `-v`):\r\n```\r\nnode scripts/functional_tests \\\r\n --config x-pack/test_serverless/api_integration/test_suites/search/common_configs/config.group1.ts \\\r\n --grep \"Summary actions\" \r\n -v\r\n```\r\n\r\n#### After\r\n```\r\n │ sill retry.tryWithRetries('Alerting API - waitForDocumentInIndex, retryOptions: {\"retryCount\":5,\"retryDelay\":200}', [object AsyncFunction], [object Object])\r\n │ debg --- retry.tryWithRetries error: index_not_found_exception\r\n │ \tRoot causes:\r\n │ \t\tindex_not_found_exception: no such index [alert-action-es-query] - Attempt #: 1\r\n │ sill es.search([object Object])\r\n │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 2\r\n │ sill es.search([object Object])\r\n │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 3\r\n │ sill es.search([object Object])\r\n │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 4\r\n │ sill es.search([object Object])\r\n │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 5\r\n \r\n...\r\n// Msg after all attempts fail:\r\n\r\n │ Error: retry.tryWithRetries reached the limit of attempts waiting for 'Alerting API - waitForDocumentInIndex, retryOptions: {\"retryCount\":5,\"retryDelay\":200}': 5 out of 5\r\n │ ResponseError: index_not_found_exception\r\n │ \tRoot causes:\r\n │ \t\tindex_not_found_exception: no such index [alert-action-es-query]\r\n │ at SniffingTransport._request (node_modules/@elastic/transport/src/Transport.ts:601:17)\r\n │ at processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n │ at /Users/trezworkbox/dev/main.worktrees/cleanup-alerting-api/node_modules/@elastic/transport/src/Transport.ts:704:22\r\n │ at SniffingTransport.request (node_modules/@elastic/transport/src/Transport.ts:701:14)\r\n │ at Proxy.SearchApi (node_modules/@elastic/elasticsearch/src/api/api/search.ts:96:10)\r\n │ at alerting_api.ts:123:28\r\n │ at runAttempt (retry_for_success.ts:30:15)\r\n │ at retryForSuccess (retry_for_success.ts:99:21)\r\n │ at Proxy.tryWithRetries (retry.ts:113:12)\r\n │ at Object.waitForDocumentInIndex (alerting_api.ts:120:14)\r\n │ at Context.<anonymous> (summary_actions.ts:146:20)\r\n │ at Object.apply (wrap_function.js:74:16)\r\n │ at Object.apply (wrap_function.js:74:16)\r\n │ at onFailure (retry_for_success.ts:18:9)\r\n │ at retryForSuccess (retry_for_success.ts:75:7)\r\n │ at Proxy.tryWithRetries (retry.ts:113:12)\r\n │ at Object.waitForDocumentInIndex (alerting_api.ts:120:14)\r\n │ at Context.<anonymous> (summary_actions.ts:146:20)\r\n │ at Object.apply (wrap_function.js:74:16)\r\n │ at Object.apply (wrap_function.js:74:16)\r\n```\r\n### Notes\r\nWas put back in draft to additional scope detailed in issue linked\r\nabove.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"9d22e8c6a8d92449055fd99b67b745d1995b5107","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:QA","release_note:skip","v9.0.0","backport:prev-minor"],"title":"[FTR] Collapse Alerting API Helpers Impl","number":192216,"url":"https://github.com/elastic/kibana/pull/192216","mergeCommit":{"message":"[FTR] Collapse Alerting API Helpers Impl (#192216)\n\n## Summary\r\nResolves: https://github.com/elastic/kibana/issues/192201\r\n\r\n- Expose `TryWithRetriesOptions`\r\n - Tune timeouts to pass ci \r\n- Add attempt count debug info to `retry/retry_for_success.ts`\r\n - Helps with tuning timeout params\r\n- Move exposure of `AlertingApiProvider` from\r\n`x-pack/test_serverless/api_integration/services/index.ts` ->\r\n`x-pack/test_serverless/shared/services/deployment_agnostic_services.ts`\r\n- This exposes the alerting api under Deployment Agnostic Services (DA),\r\nand DA is exposed within\r\n`x-pack/test_serverless/functional/services/index.ts` (Shared Services\r\n[Serverless])\r\n- Collapse helper script functions into just another object literal\r\nstanza within `AlertingApiProvider`\r\n- Update all references\r\n- Refactor alerting api to use `retry` service, instead of p-retry\r\n(following [this pr](https://github.com/elastic/kibana/pull/178660))\r\n\r\n### Additional debug logging \r\n\r\nRun in debug mode (add `-v`):\r\n```\r\nnode scripts/functional_tests \\\r\n --config x-pack/test_serverless/api_integration/test_suites/search/common_configs/config.group1.ts \\\r\n --grep \"Summary actions\" \r\n -v\r\n```\r\n\r\n#### After\r\n```\r\n │ sill retry.tryWithRetries('Alerting API - waitForDocumentInIndex, retryOptions: {\"retryCount\":5,\"retryDelay\":200}', [object AsyncFunction], [object Object])\r\n │ debg --- retry.tryWithRetries error: index_not_found_exception\r\n │ \tRoot causes:\r\n │ \t\tindex_not_found_exception: no such index [alert-action-es-query] - Attempt #: 1\r\n │ sill es.search([object Object])\r\n │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 2\r\n │ sill es.search([object Object])\r\n │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 3\r\n │ sill es.search([object Object])\r\n │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 4\r\n │ sill es.search([object Object])\r\n │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 5\r\n \r\n...\r\n// Msg after all attempts fail:\r\n\r\n │ Error: retry.tryWithRetries reached the limit of attempts waiting for 'Alerting API - waitForDocumentInIndex, retryOptions: {\"retryCount\":5,\"retryDelay\":200}': 5 out of 5\r\n │ ResponseError: index_not_found_exception\r\n │ \tRoot causes:\r\n │ \t\tindex_not_found_exception: no such index [alert-action-es-query]\r\n │ at SniffingTransport._request (node_modules/@elastic/transport/src/Transport.ts:601:17)\r\n │ at processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n │ at /Users/trezworkbox/dev/main.worktrees/cleanup-alerting-api/node_modules/@elastic/transport/src/Transport.ts:704:22\r\n │ at SniffingTransport.request (node_modules/@elastic/transport/src/Transport.ts:701:14)\r\n │ at Proxy.SearchApi (node_modules/@elastic/elasticsearch/src/api/api/search.ts:96:10)\r\n │ at alerting_api.ts:123:28\r\n │ at runAttempt (retry_for_success.ts:30:15)\r\n │ at retryForSuccess (retry_for_success.ts:99:21)\r\n │ at Proxy.tryWithRetries (retry.ts:113:12)\r\n │ at Object.waitForDocumentInIndex (alerting_api.ts:120:14)\r\n │ at Context.<anonymous> (summary_actions.ts:146:20)\r\n │ at Object.apply (wrap_function.js:74:16)\r\n │ at Object.apply (wrap_function.js:74:16)\r\n │ at onFailure (retry_for_success.ts:18:9)\r\n │ at retryForSuccess (retry_for_success.ts:75:7)\r\n │ at Proxy.tryWithRetries (retry.ts:113:12)\r\n │ at Object.waitForDocumentInIndex (alerting_api.ts:120:14)\r\n │ at Context.<anonymous> (summary_actions.ts:146:20)\r\n │ at Object.apply (wrap_function.js:74:16)\r\n │ at Object.apply (wrap_function.js:74:16)\r\n```\r\n### Notes\r\nWas put back in draft to additional scope detailed in issue linked\r\nabove.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"9d22e8c6a8d92449055fd99b67b745d1995b5107"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192216","number":192216,"mergeCommit":{"message":"[FTR] Collapse Alerting API Helpers Impl (#192216)\n\n## Summary\r\nResolves: https://github.com/elastic/kibana/issues/192201\r\n\r\n- Expose `TryWithRetriesOptions`\r\n - Tune timeouts to pass ci \r\n- Add attempt count debug info to `retry/retry_for_success.ts`\r\n - Helps with tuning timeout params\r\n- Move exposure of `AlertingApiProvider` from\r\n`x-pack/test_serverless/api_integration/services/index.ts` ->\r\n`x-pack/test_serverless/shared/services/deployment_agnostic_services.ts`\r\n- This exposes the alerting api under Deployment Agnostic Services (DA),\r\nand DA is exposed within\r\n`x-pack/test_serverless/functional/services/index.ts` (Shared Services\r\n[Serverless])\r\n- Collapse helper script functions into just another object literal\r\nstanza within `AlertingApiProvider`\r\n- Update all references\r\n- Refactor alerting api to use `retry` service, instead of p-retry\r\n(following [this pr](https://github.com/elastic/kibana/pull/178660))\r\n\r\n### Additional debug logging \r\n\r\nRun in debug mode (add `-v`):\r\n```\r\nnode scripts/functional_tests \\\r\n --config x-pack/test_serverless/api_integration/test_suites/search/common_configs/config.group1.ts \\\r\n --grep \"Summary actions\" \r\n -v\r\n```\r\n\r\n#### After\r\n```\r\n │ sill retry.tryWithRetries('Alerting API - waitForDocumentInIndex, retryOptions: {\"retryCount\":5,\"retryDelay\":200}', [object AsyncFunction], [object Object])\r\n │ debg --- retry.tryWithRetries error: index_not_found_exception\r\n │ \tRoot causes:\r\n │ \t\tindex_not_found_exception: no such index [alert-action-es-query] - Attempt #: 1\r\n │ sill es.search([object Object])\r\n │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 2\r\n │ sill es.search([object Object])\r\n │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 3\r\n │ sill es.search([object Object])\r\n │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 4\r\n │ sill es.search([object Object])\r\n │ debg --- retry.tryWithRetries failed again with the same message... - Attempt #: 5\r\n \r\n...\r\n// Msg after all attempts fail:\r\n\r\n │ Error: retry.tryWithRetries reached the limit of attempts waiting for 'Alerting API - waitForDocumentInIndex, retryOptions: {\"retryCount\":5,\"retryDelay\":200}': 5 out of 5\r\n │ ResponseError: index_not_found_exception\r\n │ \tRoot causes:\r\n │ \t\tindex_not_found_exception: no such index [alert-action-es-query]\r\n │ at SniffingTransport._request (node_modules/@elastic/transport/src/Transport.ts:601:17)\r\n │ at processTicksAndRejections (node:internal/process/task_queues:95:5)\r\n │ at /Users/trezworkbox/dev/main.worktrees/cleanup-alerting-api/node_modules/@elastic/transport/src/Transport.ts:704:22\r\n │ at SniffingTransport.request (node_modules/@elastic/transport/src/Transport.ts:701:14)\r\n │ at Proxy.SearchApi (node_modules/@elastic/elasticsearch/src/api/api/search.ts:96:10)\r\n │ at alerting_api.ts:123:28\r\n │ at runAttempt (retry_for_success.ts:30:15)\r\n │ at retryForSuccess (retry_for_success.ts:99:21)\r\n │ at Proxy.tryWithRetries (retry.ts:113:12)\r\n │ at Object.waitForDocumentInIndex (alerting_api.ts:120:14)\r\n │ at Context.<anonymous> (summary_actions.ts:146:20)\r\n │ at Object.apply (wrap_function.js:74:16)\r\n │ at Object.apply (wrap_function.js:74:16)\r\n │ at onFailure (retry_for_success.ts:18:9)\r\n │ at retryForSuccess (retry_for_success.ts:75:7)\r\n │ at Proxy.tryWithRetries (retry.ts:113:12)\r\n │ at Object.waitForDocumentInIndex (alerting_api.ts:120:14)\r\n │ at Context.<anonymous> (summary_actions.ts:146:20)\r\n │ at Object.apply (wrap_function.js:74:16)\r\n │ at Object.apply (wrap_function.js:74:16)\r\n```\r\n### Notes\r\nWas put back in draft to additional scope detailed in issue linked\r\nabove.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"9d22e8c6a8d92449055fd99b67b745d1995b5107"}}]}] BACKPORT--> Co-authored-by: Tre <wayne.seymour@elastic.co>
…x-pack/test/api_integration/deployment_agnostic` (elastic#193975) ## Summary Follow up of [this pr](elastic#192216), per [this discussion](elastic#192216 (comment)). Also, switch from `svlCommonApi` to `samlAuth` for internal headers. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co> (cherry picked from commit 10c3373) # Conflicts: # x-pack/test_serverless/shared/services/alerting_api.ts
Summary
Resolves: #192201
TryWithRetriesOptions
retry/retry_for_success.ts
AlertingApiProvider
fromx-pack/test_serverless/api_integration/services/index.ts
->x-pack/test_serverless/shared/services/deployment_agnostic_services.ts
x-pack/test_serverless/functional/services/index.ts
(Shared Services [Serverless])AlertingApiProvider
retry
service, instead of p-retry (following this pr)Additional debug logging
Run in debug mode (add
-v
):After
Notes
Was put back in draft to additional scope detailed in issue linked above.