fix(monitors): apply schema migrations for custom_schedule and warning_recovery#619
Merged
Merged
Conversation
riyazsh
force-pushed
the
riyaz/HAMR-392-monitor-schema-migrations
branch
from
July 9, 2026 15:44
b17a085 to
f5615d5
Compare
riyazsh
force-pushed
the
riyaz/HAMR-392-monitor-schema-migrations
branch
2 times, most recently
from
July 9, 2026 15:49
1a28981 to
45856d3
Compare
…g_recovery - Inject options.on_missing_data="default" when options.scheduling_options.custom_schedule is set and options.on_missing_data is absent. - Drop options.thresholds.warning_recovery when options.thresholds.warning is absent (orphan field has no threshold to recover from). Both run in pre_resource_action_hook so they apply on create + update. Null-safe on options and thresholds. Existing service-check groupby guard is unchanged. Adds 8 unit tests covering injection, preservation, orphan drop, and null-safety.
riyazsh
force-pushed
the
riyaz/HAMR-392-monitor-schema-migrations
branch
from
July 9, 2026 15:57
45856d3 to
06ac81f
Compare
nathantournant
approved these changes
Jul 9, 2026
heyronhay
approved these changes
Jul 9, 2026
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
Two monitor payload rejections observed when replaying monitors from an older API
version to a stricter destination. Both are schema drift; the fixes make the
payload valid without changing semantics.
custom_schedulerequireson_missing_data— inject"default"(thedocumented default) when
custom_scheduleis set andon_missing_datais absent.warning_recoveryorphan — drop it whenwarningis not set; a recoverythreshold with no warning threshold has nothing to recover from.
Both migrations live in
pre_resource_action_hookso they apply on both create and update.Null-safe on
optionsandthresholds. Existing service-checkgroupbyguard is unchanged.Test plan
tests/unit/test_monitors.py::TestMonitorsSchemaMigrations:injection, preservation of explicit values, orphan drop, and null-safety.
tests/unit/suite: 818 passed, 0 regressions.