-
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
[Response Ops] Remove ephemeral tasks from action and alerting plugins #197421
[Response Ops] Remove ephemeral tasks from action and alerting plugins #197421
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
A documentation preview will be available soon. Request a new doc build by commenting
If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here. |
@@ -127,84 +127,6 @@ describe('health check', () => { | |||
); | |||
}); | |||
|
|||
test('renders warning if encryption key is ephemeral', async () => { |
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 think we probably want to keep this test? i don't think it's related to ephemeral tasks
cacheInterval: schema.number({ defaultValue: DEFAULT_CACHE_INTERVAL_MS }), | ||
}), | ||
}, | ||
{ unknowns: 'allow' } |
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: Preventing unknowns adds the benefit of users knowing when they have typos and such. Perhaps if we change maxEphemeralActionsPerAlert
to a schema.maybe(schema.number())
, we won't see it anywhere else (it'll be empty by default now)
Im wondering if we can just remove the cleanup function here: https://github.com/JiaweiWu/kibana/blob/main/x-pack/plugins/actions/server/lib/task_runner_factory.ts#L212 Since the |
I believe so, ephemeral tasks are not persisted so once users upgrade to the version containing this change, the task runners will only run normal tasks. |
Also, let me know if we want to keep these deprecation messages: What's a good way to test that the ephemeral tasks have been removed without affect other code paths? (Aside from existing unit/E2E tests passing) |
Given we're switching to becoming a no-op, perhaps we can change the message. Something like
Hmm, I wonder if turning on all the settings that we have as no-op and creating some rules that fire actions. If we see the actions still working, that would be one way to manually verify the changes are working. Thoughts? |
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.
Changes LGTM, I would also update the deprecation message as we discussed in #197421 (comment).
const bulkScheduleRequest: EnqueueExecutionOptions[] = []; | ||
|
||
for (const result of allActionsToScheduleResult) { | ||
await this.runActionAsEphemeralOrAddToBulkScheduleRequest({ | ||
enqueueOptions: result.actionToEnqueue, | ||
bulkScheduleRequest, | ||
}); | ||
bulkScheduleRequest.push(result.actionToEnqueue); |
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:
We can remove bulkScheduleRequest
and use allActionsToScheduleResult
variable directly now.
deprecated:[8.8.0] | ||
Sets the number of actions that will run ephemerally. To use this, enable | ||
ephemeral tasks in task manager first with | ||
<<task-manager-settings,`xpack.task_manager.ephemeral_tasks.enabled`>> |
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.
We'll probably need a cloud PR to remove them from the allow-list: https://github.com/elastic/cloud/pull/84878
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.
hmmm ... not sure. I know the allow-list must be used when creating / updating the Kibana yml in the clould admin panels, but when else would it be used? If it gets used at some other time (cluster restart), then potentially it could prevent the restart because of invalid config?
It's fine if it's only used while creating / updating the Kibana yml in the cloud admin panel - presumably the config wouldn't be saveable next time a customer edited it, till they removed the config setting.
Have we done this in the past? I feel like we must have ...
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 guess that's true. I guess we're just ignoring it now if it's set so it doesn't matter if it's still there
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.
Perhaps we should create a PR to label these in comments as deprecated, if we're not sure? Breadcrumbs for future cleanups?
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.
From https://github.com/elastic/cloud/pull/133738#discussion_r1828211350, we can set a max
value as we have to keep it around for deployments running 8.x for a long time.
@@ -362,104 +334,6 @@ describe('Task Runner', () => { | |||
).toHaveBeenCalled(); | |||
}); | |||
|
|||
test.each(ephemeralTestParams)( | |||
'actionsPlugin.execute is called per alert alert that is scheduled %s', |
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 think we want to keep all of these tests, just not the iteration over the different bulk enqueue execution functions. We want to keep testing that actionsClient.bulkEnqueueExecution
is called in these scenarios.
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.
ya, seems that way ...
Code LGTM, but have the same issues as Ying. Will review once the tests have been re-instated ... |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
|
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
elastic#197421) ## Summary Issue: elastic#151461 Removes all reference to ephemeral tasks in the alerting and actions plugin. As well as unit and E2E tests while maintaining backwards compatibility for `xpack.alerting.maxEphemeralActionsPerAlert` flag. ### Checklist - [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 --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
elastic#197421) ## Summary Issue: elastic#151461 Removes all reference to ephemeral tasks in the alerting and actions plugin. As well as unit and E2E tests while maintaining backwards compatibility for `xpack.alerting.maxEphemeralActionsPerAlert` flag. ### Checklist - [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 --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
elastic#197421) ## Summary Issue: elastic#151461 Removes all reference to ephemeral tasks in the alerting and actions plugin. As well as unit and E2E tests while maintaining backwards compatibility for `xpack.alerting.maxEphemeralActionsPerAlert` flag. ### Checklist - [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 --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
## Summary Resolves: #151463 Removes all reference to ephemeral tasks from the task manager plugin. As well as unit and E2E tests while maintaining backwards compatibility for `xpack.task_manager.ephemeral_tasks` flag to no-op if set. This PR has some dependencies from the PR to remove ephemeral task support from the alerting and actions plugin (#197421). So it should be merged after the other PR. Deprecates the following configuration settings: - xpack.task_manager.ephemeral_tasks.enabled - xpack.task_manager.ephemeral_tasks.request_capacity The user doesn't have to change anything on their end if they don't wish to. This deprecation is made so if the above settings are defined, kibana will simply do nothing. ### Checklist - [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
Summary
Issue: #151461
Removes all reference to ephemeral tasks in the alerting and actions plugin. As well as unit and E2E tests while maintaining backwards compatibility for
xpack.alerting.maxEphemeralActionsPerAlert
flag.Deprecates the following configuration settings:
xpack.alerting.maxEphemeralActionsPerAlert
No action is required on the user's end as this deprecation is made so if the above settings are defined, kibana will simply do nothing. However their settings will no longer have any effect as ephemeral tasks are now removed.
Checklist