[ResponseOps][Cases] Skip the execution of the CAI tasks when the feature is disabled#227860
Conversation
|
Pinging @elastic/response-ops (Team:ResponseOps) |
|
Pinging @elastic/kibana-cases (Feature:Cases) |
| } | ||
|
|
||
| public async run() { | ||
| if (!this.analyticsConfig.index.enabled) { |
There was a problem hiding this comment.
I might need some more context here to understand why we're scheduling a task that will actually never really run, just return early.
There was a problem hiding this comment.
Imagine the user enables the feature. The tasks are scheduled to run. Then the feature is disabled. The task manager, running on a different node than the kibana node, will still run the tasks because they are already scheduled or they got rescheduled due to an error. It can happen. We found it while testing on serverless.
There was a problem hiding this comment.
Gotcha. That means we probably have this issue in most tasks in Kibana that depend on an external flag. Nice catch. I still think it also makes sense, not to schedule the task, on top of this check.
There was a problem hiding this comment.
We already skip scheduling if the feature is disabled here
|
@elasticmachine merge upstream |
…kibana into not_register_cai_when_disabled
| : []), | ||
| '--xpack.ruleRegistry.write.enabled=true', | ||
| '--xpack.ruleRegistry.write.cache.enabled=false', | ||
| '--xpack.cases.analytics.index.enabled=true', |
There was a problem hiding this comment.
question: wouldn't this be true by default (since these aren't deployment agnostic or serverless tests and "traditional" part of the config should apply here)? It doesn't hurt though (just in case you need to make other changes, otherwise it'd not be worth running CI again just for that)
There was a problem hiding this comment.
That's true! I put the config for the tests before adding your suggestion about offeringBasedSchema. Would you like me to remove it?
There was a problem hiding this comment.
We agreed on Slack to keep it as is since it's not worth waiting for another CI run just for this optional improvement.
|
buildkite/docs-build-pr was failing, I've re-run it, let's see if it helps. |
💚 Build Succeeded
Metrics [docs]
History
cc @cnasikas |
|
Starting backport for target branches: 8.19, 9.1 https://github.com/elastic/kibana/actions/runs/16290500014 |
…ture is disabled (elastic#227860) ## Summary This PR skips the execution of the CAI tasks if the feature is disabled. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit be184bb)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…he feature is disabled (#227860) (#227970) # Backport This will backport the following commits from `main` to `9.1`: - [[ResponseOps][Cases] Skip the execution of the CAI tasks when the feature is disabled (#227860)](#227860) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Christos Nasikas","email":"christos.nasikas@elastic.co"},"sourceCommit":{"committedDate":"2025-07-15T10:13:51Z","message":"[ResponseOps][Cases] Skip the execution of the CAI tasks when the feature is disabled (#227860)\n\n## Summary\n\nThis PR skips the execution of the CAI tasks if the feature is disabled.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"be184bb8d86ed2ec932d84c063f7536edc85dc7d","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","Feature:Cases","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[ResponseOps][Cases] Skip the execution of the CAI tasks when the feature is disabled","number":227860,"url":"https://github.com/elastic/kibana/pull/227860","mergeCommit":{"message":"[ResponseOps][Cases] Skip the execution of the CAI tasks when the feature is disabled (#227860)\n\n## Summary\n\nThis PR skips the execution of the CAI tasks if the feature is disabled.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"be184bb8d86ed2ec932d84c063f7536edc85dc7d"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227860","number":227860,"mergeCommit":{"message":"[ResponseOps][Cases] Skip the execution of the CAI tasks when the feature is disabled (#227860)\n\n## Summary\n\nThis PR skips the execution of the CAI tasks if the feature is disabled.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"be184bb8d86ed2ec932d84c063f7536edc85dc7d"}}]}] BACKPORT--> Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…the feature is disabled (#227860) (#228510) # Backport This will backport the following commits from `main` to `8.19`: - [[ResponseOps][Cases] Skip the execution of the CAI tasks when the feature is disabled (#227860)](#227860) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Christos Nasikas","email":"christos.nasikas@elastic.co"},"sourceCommit":{"committedDate":"2025-07-15T10:13:51Z","message":"[ResponseOps][Cases] Skip the execution of the CAI tasks when the feature is disabled (#227860)\n\n## Summary\n\nThis PR skips the execution of the CAI tasks if the feature is disabled.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"be184bb8d86ed2ec932d84c063f7536edc85dc7d","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","Feature:Cases","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[ResponseOps][Cases] Skip the execution of the CAI tasks when the feature is disabled","number":227860,"url":"https://github.com/elastic/kibana/pull/227860","mergeCommit":{"message":"[ResponseOps][Cases] Skip the execution of the CAI tasks when the feature is disabled (#227860)\n\n## Summary\n\nThis PR skips the execution of the CAI tasks if the feature is disabled.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"be184bb8d86ed2ec932d84c063f7536edc85dc7d"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/227970","number":227970,"state":"MERGED","mergeCommit":{"sha":"ad97bf24b022c2aec8dc19431537fe8e3fcd1ca2","message":"[9.1] [ResponseOps][Cases] Skip the execution of the CAI tasks when the feature is disabled (#227860) (#227970)\n\n# Backport\n\nThis will backport the following commits from `main` to `9.1`:\n- [[ResponseOps][Cases] Skip the execution of the CAI tasks when the\nfeature is disabled\n(#227860)](https://github.com/elastic/kibana/pull/227860)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Christos Nasikas <christos.nasikas@elastic.co>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227860","number":227860,"mergeCommit":{"message":"[ResponseOps][Cases] Skip the execution of the CAI tasks when the feature is disabled (#227860)\n\n## Summary\n\nThis PR skips the execution of the CAI tasks if the feature is disabled.\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"be184bb8d86ed2ec932d84c063f7536edc85dc7d"}},{"url":"https://github.com/elastic/kibana/pull/227968","number":227968,"branch":"deploy-fix@1752473612","state":"MERGED","mergeCommit":{"sha":"5f662c1a33358d066b7c7e56af3924ebd3c279d8","message":"[ResponseOps][Cases] Skip the execution of the CAI tasks when the feature is disabled (#227860) (#227968)\n\n## Summary\n\nCherry-picking #227860 for the\nemergency release.\n\nCo-authored-by: Christos Nasikas <christos.nasikas@elastic.co>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>"}}]}] BACKPORT--> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…ture is disabled (elastic#227860) ## Summary This PR skips the execution of the CAI tasks if the feature is disabled. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…ture is disabled (elastic#227860) ## Summary This PR skips the execution of the CAI tasks if the feature is disabled. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
This PR skips the execution of the CAI tasks if the feature is disabled.