Chore: Move ReqContext to contexthandler service (#62102)

* Chore: Move ReqContext to contexthandler service

* Rename package to contextmodel

* Generate ngalert files

* Remove unused imports
This commit is contained in:
idafurjes
2023-01-27 08:50:36 +01:00
committed by GitHub
parent 8379a29b53
commit 6c5a573772
180 changed files with 1208 additions and 1182 deletions
+5 -5
View File
@@ -9,9 +9,9 @@ import (
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
models2 "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/accesscontrol"
acMock "github.com/grafana/grafana/pkg/services/accesscontrol/mock"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
"github.com/grafana/grafana/pkg/services/datasources"
fakes "github.com/grafana/grafana/pkg/services/datasources/fakes"
"github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
@@ -24,7 +24,7 @@ import (
func TestRouteTestGrafanaRuleConfig(t *testing.T) {
t.Run("when fine-grained access is enabled", func(t *testing.T) {
rc := &models2.ReqContext{
rc := &contextmodel.ReqContext{
Context: &web.Context{
Req: &http.Request{},
},
@@ -95,7 +95,7 @@ func TestRouteTestGrafanaRuleConfig(t *testing.T) {
})
t.Run("when fine-grained access is disabled", func(t *testing.T) {
rc := &models2.ReqContext{
rc := &contextmodel.ReqContext{
Context: &web.Context{
Req: &http.Request{},
},
@@ -152,7 +152,7 @@ func TestRouteTestGrafanaRuleConfig(t *testing.T) {
func TestRouteEvalQueries(t *testing.T) {
t.Run("when fine-grained access is enabled", func(t *testing.T) {
rc := &models2.ReqContext{
rc := &contextmodel.ReqContext{
Context: &web.Context{
Req: &http.Request{},
},
@@ -222,7 +222,7 @@ func TestRouteEvalQueries(t *testing.T) {
})
t.Run("when fine-grained access is disabled", func(t *testing.T) {
rc := &models2.ReqContext{
rc := &contextmodel.ReqContext{
Context: &web.Context{
Req: &http.Request{},
},