Alerting: Support for active time intervals in notification policies (#104252)

* add active_time_intervals to route model

* update k8s compat layer

* update notification policies service to validate active time intervals

* update integration tests

* update openapi

* add active time interval to model

* update route generator to include active time interval

* Update storage list and rename methods to handle active intervals

* update api model

* update provisioning and export models

* update ui to allow active timing config

* update i18n

* fix snapshots for ui tests

* run prettier

* Alerting: Active time intervals UI naming (#104402)

* update naming in UI

* update naming in the edit page title

* update translations

* update alerting module

---------

Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>
Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
This commit is contained in:
Yuri Tseretyan
2025-05-07 19:19:33 -04:00
committed by GitHub
co-authored by Sonia Aguilar Sonia Aguilar
parent a8dee54aa4
commit 3e2296acd3
61 changed files with 631 additions and 338 deletions
@@ -538,13 +538,14 @@ func TestIntegrationDataConsistency(t *testing.T) {
ensureMatcher(t, labels.MatchRegexp, "o", "1"),
ensureMatcher(t, labels.MatchNotRegexp, "p", "1"),
},
Receiver: receiver,
GroupByStr: []string{"test-789"},
GroupWait: util.Pointer(model.Duration(2 * time.Minute)),
GroupInterval: util.Pointer(model.Duration(5 * time.Minute)),
RepeatInterval: util.Pointer(model.Duration(30 * time.Hour)),
MuteTimeIntervals: []string{timeInterval},
Continue: true,
Receiver: receiver,
GroupByStr: []string{"test-789"},
GroupWait: util.Pointer(model.Duration(2 * time.Minute)),
GroupInterval: util.Pointer(model.Duration(5 * time.Minute)),
RepeatInterval: util.Pointer(model.Duration(30 * time.Hour)),
MuteTimeIntervals: []string{timeInterval},
ActiveTimeIntervals: []string{timeInterval},
Continue: true,
},
},
}
@@ -562,13 +563,14 @@ func TestIntegrationDataConsistency(t *testing.T) {
}, tree.Spec.Defaults)
assert.Len(t, tree.Spec.Routes, 1)
assert.Equal(t, v0alpha1.Route{
Continue: true,
Receiver: util.Pointer(receiver),
GroupBy: []string{"test-789"},
GroupWait: util.Pointer("2m"),
GroupInterval: util.Pointer("5m"),
RepeatInterval: util.Pointer("1d6h"),
MuteTimeIntervals: []string{timeInterval},
Continue: true,
Receiver: util.Pointer(receiver),
GroupBy: []string{"test-789"},
GroupWait: util.Pointer("2m"),
GroupInterval: util.Pointer("5m"),
RepeatInterval: util.Pointer("1d6h"),
MuteTimeIntervals: []string{timeInterval},
ActiveTimeIntervals: []string{timeInterval},
Matchers: []v0alpha1.Matcher{
{
Label: "m",