Skip to content

Commit

Permalink
Revert "fix hidden_queries plan bug (#201)" (#204)
Browse files Browse the repository at this point in the history
This reverts commit 8a92fc0.
  • Loading branch information
matthagenbuch authored Jan 17, 2024
1 parent 6227592 commit ef6a13a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.86.1
1.86.2
14 changes: 4 additions & 10 deletions lightstep/resource_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,11 @@ func getQueriesFromUnifiedConditionResourceData(
)
}

hq := make(map[string]string, len(q.HiddenQueries))
for k, v := range q.HiddenQueries {
hq[k] = fmt.Sprintf("%t", v)
}

qs := map[string]interface{}{
"hidden": q.Hidden,
"display": q.Display,
"query_name": q.Name,
"query_string": q.TQLQuery,
"hidden_queries": hq,
"hidden": q.Hidden,
"display": q.Display,
"query_name": q.Name,
"query_string": q.TQLQuery,
}
queries = append(queries, qs)
}
Expand Down
5 changes: 0 additions & 5 deletions lightstep/resource_alert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ resource "lightstep_alert" "test" {
query_name = "a"
hidden = false
query_string = "metric requests | rate 1h, 30s | filter \"project_name\" == \"catlab\" && \"service\" != \"android\" | group_by[\"method\"], mean | reduce 30s, min"
hidden_queries = {
"a" = false
}
}
alerting_rule {
Expand Down Expand Up @@ -124,7 +121,6 @@ resource "lightstep_alert" "test" {
resource.TestCheckResourceAttr(resourceName, "description", "A link to a playbook"),
resource.TestCheckResourceAttr(resourceName, "query.0.query_string", "metric requests | rate 1h, 30s | filter \"project_name\" == \"catlab\" && \"service\" != \"android\" | group_by[\"method\"], mean | reduce 30s, min"),
resource.TestCheckResourceAttr(resourceName, "expression.0.is_no_data", "true"),
resource.TestCheckResourceAttr(resourceName, "query.0.hidden_queries.a", "false"),
),
},
{
Expand All @@ -135,7 +131,6 @@ resource "lightstep_alert" "test" {
resource.TestCheckResourceAttr(resourceName, "description", "A link to a fresh playbook"),
resource.TestCheckResourceAttr(resourceName, "query.0.query_string", "metric requests | rate 1h, 30s | filter \"project_name\" == \"catlab\" && \"service\" != \"iOS\" | group_by[\"method\"], mean | reduce 30s, min"),
resource.TestCheckResourceAttr(resourceName, "expression.0.is_no_data", "false"),
resource.TestCheckNoResourceAttr(resourceName, "query.0.hidden_queries.a"),
),
},
},
Expand Down

0 comments on commit ef6a13a

Please sign in to comment.