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:
Sofia Papagiannaki
2025-08-12 09:42:10 +03:00
committed by GitHub
parent 101aea9647
commit 402572c580
25 changed files with 196 additions and 73 deletions
+4 -1
View File
@@ -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(