Build: Stricter linting should break the build (#23606)
This commit is contained in:
@@ -127,7 +127,7 @@ func (c *QueryCondition) executeQuery(context *alerting.EvalContext, timeRange *
|
||||
}
|
||||
|
||||
type queryDto struct {
|
||||
RefId string `json:"refId"`
|
||||
RefID string `json:"refId"`
|
||||
Model *simplejson.Json `json:"model"`
|
||||
Datasource *simplejson.Json `json:"datasource"`
|
||||
MaxDataPoints int64 `json:"maxDataPoints"`
|
||||
@@ -137,7 +137,7 @@ func (c *QueryCondition) executeQuery(context *alerting.EvalContext, timeRange *
|
||||
queries := []*queryDto{}
|
||||
for _, q := range req.Queries {
|
||||
queries = append(queries, &queryDto{
|
||||
RefId: q.RefId,
|
||||
RefID: q.RefId,
|
||||
Model: q.Model,
|
||||
Datasource: simplejson.NewFromAny(map[string]interface{}{
|
||||
"id": q.DataSource.Id,
|
||||
|
||||
@@ -2,12 +2,13 @@ package notifiers
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/grafana/grafana/pkg/bus"
|
||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/services/alerting"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestOpsGenieNotifier(t *testing.T) {
|
||||
@@ -83,9 +84,9 @@ func TestOpsGenieNotifier(t *testing.T) {
|
||||
|
||||
receivedTags := make([]string, 0)
|
||||
bus.AddHandlerCtx("alerting", func(ctx context.Context, cmd *models.SendWebhookSync) error {
|
||||
bodyJson, err := simplejson.NewJson([]byte(cmd.Body))
|
||||
bodyJSON, err := simplejson.NewJson([]byte(cmd.Body))
|
||||
if err == nil {
|
||||
receivedTags = bodyJson.Get("tags").MustStringArray([]string{})
|
||||
receivedTags = bodyJSON.Get("tags").MustStringArray([]string{})
|
||||
}
|
||||
return err
|
||||
})
|
||||
|
||||
@@ -173,16 +173,16 @@ func NewRuleFromDBAlert(ruleDef *models.Alert) (*Rule, error) {
|
||||
}
|
||||
|
||||
func translateNotificationIDToUID(id int64, orgID int64) (string, error) {
|
||||
notificationUid, err := getAlertNotificationUidByIDAndOrgID(id, orgID)
|
||||
notificationUID, err := getAlertNotificationUIDByIDAndOrgID(id, orgID)
|
||||
if err != nil {
|
||||
logger.Debug("Failed to translate Notification Id to Uid", "orgID", orgID, "Id", id)
|
||||
return "", err
|
||||
}
|
||||
|
||||
return notificationUid, nil
|
||||
return notificationUID, nil
|
||||
}
|
||||
|
||||
func getAlertNotificationUidByIDAndOrgID(notificationID int64, orgID int64) (string, error) {
|
||||
func getAlertNotificationUIDByIDAndOrgID(notificationID int64, orgID int64) (string, error) {
|
||||
query := &models.GetAlertNotificationUidQuery{
|
||||
OrgId: orgID,
|
||||
Id: notificationID,
|
||||
|
||||
Reference in New Issue
Block a user