CI: Bump golangci-lint to 2.0.2 (#103572)

This commit is contained in:
Mariell Hoversholm
2025-04-10 14:42:23 +02:00
committed by GitHub
parent b58b6e828e
commit 757be6365a
291 changed files with 1948 additions and 1835 deletions
+13 -13
View File
@@ -37,7 +37,7 @@ func (hs *HTTPServer) GetAnnotations(c *contextmodel.ReqContext) response.Respon
query := &annotations.ItemQuery{
From: c.QueryInt64("from"),
To: c.QueryInt64("to"),
OrgID: c.SignedInUser.GetOrgID(),
OrgID: c.GetOrgID(),
UserID: c.QueryInt64("userId"),
AlertID: c.QueryInt64("alertId"),
AlertUID: c.Query("alertUID"),
@@ -56,7 +56,7 @@ func (hs *HTTPServer) GetAnnotations(c *contextmodel.ReqContext) response.Respon
// When dashboard UID present in the request, we ignore dashboard ID
if query.DashboardUID != "" {
dq := dashboards.GetDashboardQuery{UID: query.DashboardUID, OrgID: c.SignedInUser.GetOrgID()}
dq := dashboards.GetDashboardQuery{UID: query.DashboardUID, OrgID: c.GetOrgID()}
dqResult, err := hs.DashboardService.GetDashboard(c.Req.Context(), &dq)
if err != nil {
return response.Error(http.StatusBadRequest, "Invalid dashboard UID in annotation request", err)
@@ -81,7 +81,7 @@ func (hs *HTTPServer) GetAnnotations(c *contextmodel.ReqContext) response.Respon
if val, ok := dashboardCache[item.DashboardID]; ok {
item.DashboardUID = val
} else {
query := dashboards.GetDashboardQuery{ID: item.DashboardID, OrgID: c.SignedInUser.GetOrgID()}
query := dashboards.GetDashboardQuery{ID: item.DashboardID, OrgID: c.GetOrgID()}
queryResult, err := hs.DashboardService.GetDashboard(c.Req.Context(), &query)
if err == nil && queryResult != nil {
item.DashboardUID = &queryResult.UID
@@ -124,7 +124,7 @@ func (hs *HTTPServer) PostAnnotation(c *contextmodel.ReqContext) response.Respon
// overwrite dashboardId when dashboardUID is not empty
if cmd.DashboardUID != "" {
query := dashboards.GetDashboardQuery{OrgID: c.SignedInUser.GetOrgID(), UID: cmd.DashboardUID}
query := dashboards.GetDashboardQuery{OrgID: c.GetOrgID(), UID: cmd.DashboardUID}
queryResult, err := hs.DashboardService.GetDashboard(c.Req.Context(), &query)
if err == nil {
cmd.DashboardId = queryResult.ID
@@ -148,7 +148,7 @@ func (hs *HTTPServer) PostAnnotation(c *contextmodel.ReqContext) response.Respon
userID, _ := identity.UserIdentifier(c.GetID())
item := annotations.Item{
OrgID: c.SignedInUser.GetOrgID(),
OrgID: c.GetOrgID(),
UserID: userID,
DashboardID: cmd.DashboardId,
PanelID: cmd.PanelId,
@@ -231,7 +231,7 @@ func (hs *HTTPServer) PostGraphiteAnnotation(c *contextmodel.ReqContext) respons
userID, _ := identity.UserIdentifier(c.GetID())
item := annotations.Item{
OrgID: c.SignedInUser.GetOrgID(),
OrgID: c.GetOrgID(),
UserID: userID,
Epoch: cmd.When * 1000,
Text: text,
@@ -284,7 +284,7 @@ func (hs *HTTPServer) UpdateAnnotation(c *contextmodel.ReqContext) response.Resp
userID, _ := identity.UserIdentifier(c.GetID())
item := annotations.Item{
OrgID: c.SignedInUser.GetOrgID(),
OrgID: c.GetOrgID(),
UserID: userID,
ID: annotationID,
Epoch: cmd.Time,
@@ -342,7 +342,7 @@ func (hs *HTTPServer) PatchAnnotation(c *contextmodel.ReqContext) response.Respo
userID, _ := identity.UserIdentifier(c.GetID())
existing := annotations.Item{
OrgID: c.SignedInUser.GetOrgID(),
OrgID: c.GetOrgID(),
UserID: userID,
ID: annotationID,
Epoch: annotation.Time,
@@ -395,7 +395,7 @@ func (hs *HTTPServer) MassDeleteAnnotations(c *contextmodel.ReqContext) response
}
if cmd.DashboardUID != "" {
query := dashboards.GetDashboardQuery{OrgID: c.SignedInUser.GetOrgID(), UID: cmd.DashboardUID}
query := dashboards.GetDashboardQuery{OrgID: c.GetOrgID(), UID: cmd.DashboardUID}
queryResult, err := hs.DashboardService.GetDashboard(c.Req.Context(), &query)
if err == nil {
cmd.DashboardId = queryResult.ID
@@ -420,13 +420,13 @@ func (hs *HTTPServer) MassDeleteAnnotations(c *contextmodel.ReqContext) response
}
dashboardId = annotation.DashboardID
deleteParams = &annotations.DeleteParams{
OrgID: c.SignedInUser.GetOrgID(),
OrgID: c.GetOrgID(),
ID: cmd.AnnotationId,
}
} else {
dashboardId = cmd.DashboardId
deleteParams = &annotations.DeleteParams{
OrgID: c.SignedInUser.GetOrgID(),
OrgID: c.GetOrgID(),
DashboardID: cmd.DashboardId,
PanelID: cmd.PanelId,
}
@@ -507,7 +507,7 @@ func (hs *HTTPServer) DeleteAnnotationByID(c *contextmodel.ReqContext) response.
}
err = hs.annotationsRepo.Delete(c.Req.Context(), &annotations.DeleteParams{
OrgID: c.SignedInUser.GetOrgID(),
OrgID: c.GetOrgID(),
ID: annotationID,
})
if err != nil {
@@ -561,7 +561,7 @@ func findAnnotationByID(ctx context.Context, repo annotations.Repository, annota
// 500: internalServerError
func (hs *HTTPServer) GetAnnotationTags(c *contextmodel.ReqContext) response.Response {
query := &annotations.TagsQuery{
OrgID: c.SignedInUser.GetOrgID(),
OrgID: c.GetOrgID(),
Tag: c.Query("tag"),
Limit: c.QueryInt64("limit"),
}