Add ConfigProvider and modify quota.Service to use it (#109395)
* Add config provider and integrate with wire setup * Refactor quota service to use config provider for configuration management * Enhance OSSConfigProvider to include logging and update ProvideService to return an error. Refactor server initialization to handle potential errors from config provider. Remove unnecessary wire binding for OSSConfigProvider. * Update CODEOWNERS to include the configprovider package under the grafana-backend-services-squad. * Refactor quota service initialization to include context in multiple service providers. Update tests and service implementations to ensure proper context handling during service creation.
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/grafana/grafana/pkg/configprovider"
|
||||
"github.com/grafana/grafana/pkg/services/authn"
|
||||
"github.com/grafana/grafana/pkg/services/authn/authntest"
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -43,7 +44,9 @@ func setUpGetOrgUsersDB(t *testing.T, sqlStore db.DB, cfg *setting.Cfg) {
|
||||
cfg.AutoAssignOrg = true
|
||||
cfg.AutoAssignOrgId = int(testOrgID)
|
||||
|
||||
quotaService := quotaimpl.ProvideService(sqlStore, cfg)
|
||||
cfgProvider, err := configprovider.ProvideService(cfg)
|
||||
require.NoError(t, err)
|
||||
quotaService := quotaimpl.ProvideService(context.Background(), sqlStore, cfgProvider)
|
||||
orgService, err := orgimpl.ProvideService(sqlStore, cfg, quotaService)
|
||||
require.NoError(t, err)
|
||||
usrSvc, err := userimpl.ProvideService(
|
||||
|
||||
Reference in New Issue
Block a user