mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
unhide alert rule's data sources during migraiton (#48559)
This commit is contained in:
parent
7b4bc3eda6
commit
f85e758972
@ -160,6 +160,8 @@ func migrateAlertRuleQueries(data []alertQuery) ([]alertQuery, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// remove hidden tag from the query (if exists)
|
||||
delete(fixedData, "hide")
|
||||
fixedData = fixGraphiteReferencedSubQueries(fixedData)
|
||||
updatedModel, err := json.Marshal(fixedData)
|
||||
if err != nil {
|
||||
|
@ -25,6 +25,11 @@ func TestMigrateAlertRuleQueries(t *testing.T) {
|
||||
input: simplejson.NewFromAny(map[string]interface{}{"target": "ahalfquery"}),
|
||||
expected: `{"target":"ahalfquery"}`,
|
||||
},
|
||||
{
|
||||
name: "when query was hidden, it removes the flag",
|
||||
input: simplejson.NewFromAny(map[string]interface{}{"hide": true}),
|
||||
expected: `{}`,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tc {
|
||||
|
Loading…
Reference in New Issue
Block a user