[Alerting v2] Lower MIN_SCHEDULE_INTERVAL from 1m to 5s#259836
Merged
darnautov merged 1 commit intoelastic:alerting_v2from Mar 26, 2026
Merged
[Alerting v2] Lower MIN_SCHEDULE_INTERVAL from 1m to 5s#259836darnautov merged 1 commit intoelastic:alerting_v2from
darnautov merged 1 commit intoelastic:alerting_v2from
Conversation
elastic#258526 introduced a 1m minimum for schedule.every which broke the Scout episode_lifecycle tests that use a 5s interval. Lower the floor to 5s so existing tests (and short-interval rules) remain valid. Removes one redundant "cross-unit" test case that no longer applies at the 5s boundary. Made-with: Cursor
cnasikas
approved these changes
Mar 26, 2026
Contributor
ApprovabilityVerdict: Needs human review This PR changes a configuration constant that controls minimum alerting schedule intervals (from 1 minute to 5 seconds), which is a runtime behavior change with potential performance implications. Additionally, all changed files are owned by @elastic/rna-project-team, not the PR author. You can customize Macroscope's approvability policy. Learn more. |
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.
Summary
Fixes a regression introduced by #258526, which added a
MIN_SCHEDULE_INTERVAL = '1m'server-side validation onschedule.every. This broke the Scoutepisode_lifecycletests that create rules with a5sschedule interval — the API now rejects those requests, causing the "should track multiple groups independently" test (and others in the suite) to fail.Fix: Lower
MIN_SCHEDULE_INTERVALfrom'1m'to'5s'inconstants.ts. Update corresponding unit tests to reflect the new boundary.Test removal: Removes one
createRuleDataSchematest case ("rejects schedule.every below 1m via cross-unit (59s)") that was meant to validate cross-unit comparison but wasn't doing that for 1m so was an unnecessary test before and after these PR changes. (if the min value had been 2m, you could test failures at 1m and at 95s, and that's cross-unit testing ... but when the value is 1m and the lowest unit we allow is seconds, there's no cross-unit test possible).A follow-up issue will be created to discuss whether
5sis the right long-term minimum or if this should be configurable per environment.Test plan
rule_data_schema.test.ts— 95 tests passvalidation.test.ts— 48 tests passMade with Cursor