[8.19] [ResponseOps][Alerting] Create a task to regenerate maintenance window events (#219261)#224773
Merged
cnasikas merged 1 commit intoelastic:8.19from Jun 23, 2025
Merged
Conversation
…w events (elastic#219261) ## Summary Resolves elastic#211534 This PR adds a recurring task which will - run once every day - collect maintenance windows which have expiration date within 1 week - updates expiration date to +1 year if it is recurring - generate events for the next 1 year - adds new events to maintenance window ### 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 ### How to test - Set expiration date to less than 1 week before creating maintenance windows: update line 70 `expirationDate = moment().utc().add(1, 'year').toISOString();` to `expirationDate = moment().utc().add(5, 'days').toISOString();` in the file `x-pack/platform/plugins/shared/alerting/server/application/maintenance_window/methods/create/create_maintenance_window.ts` - Create maintenance windows with different scenarios (recurring, non recurring, etc.) - Update task schedule to run every five minutes to test: set `{ interval: '1d' }` to `{ interval: '5m' }` in file `x-pack/platform/plugins/shared/alerting/server/maintenance_window_events/task.ts` - Verify the task ran successfully - Verify maintenance windows are updated properly with new expiration date and new events ### Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8358 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit eaa9c1c) # Conflicts: # x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/maintenance_window/events_generation.ts
1 task
Contributor
js-jankisalvi
approved these changes
Jun 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.19:Questions ?
Please refer to the Backport tool documentation