FS: Call IndexDataHooks for custom version string (#112670)

* Add enterprise hooks

* wip...

* undo

* update wire gen

* remove old hook thing

* move build info into seperate func

* align fs context middleware with grafana, setting SignedInUser

* Call IndexDataHooks to get modified build info

* update tests

* go workspace

* idk, reset workspace files or whatever

* conditionally mount license

* support loading decoupled plugins from cdn

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
This commit is contained in:
Josh Hunt
2025-10-24 11:04:44 +01:00
committed by GitHub
co-authored by Ashley Harrison
parent 71d10a3fa3
commit bb6d7d02c7
11 changed files with 196 additions and 39 deletions
+7 -2
View File
@@ -26,6 +26,7 @@ import (
"github.com/grafana/grafana/pkg/services/authz"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/frontend"
"github.com/grafana/grafana/pkg/services/hooks"
"github.com/grafana/grafana/pkg/services/licensing"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/storage/unified/resource"
@@ -46,8 +47,9 @@ func NewModule(opts Options,
license licensing.Licensing,
moduleRegisterer ModuleRegisterer,
storageBackend resource.StorageBackend, // Ensures unified storage backend is initialized
hooksService *hooks.HooksService,
) (*ModuleServer, error) {
s, err := newModuleServer(opts, apiOpts, features, cfg, storageMetrics, indexMetrics, reg, promGatherer, license, moduleRegisterer, storageBackend)
s, err := newModuleServer(opts, apiOpts, features, cfg, storageMetrics, indexMetrics, reg, promGatherer, license, moduleRegisterer, storageBackend, hooksService)
if err != nil {
return nil, err
}
@@ -70,6 +72,7 @@ func newModuleServer(opts Options,
license licensing.Licensing,
moduleRegisterer ModuleRegisterer,
storageBackend resource.StorageBackend,
hooksService *hooks.HooksService,
) (*ModuleServer, error) {
rootCtx, shutdownFn := context.WithCancel(context.Background())
@@ -93,6 +96,7 @@ func newModuleServer(opts Options,
license: license,
moduleRegisterer: moduleRegisterer,
storageBackend: storageBackend,
hooksService: hooksService,
}
return s, nil
@@ -134,6 +138,7 @@ type ModuleServer struct {
// moduleRegisterer allows registration of modules provided by other builds (e.g. enterprise).
moduleRegisterer ModuleRegisterer
hooksService *hooks.HooksService
}
// init initializes the server and its services.
@@ -205,7 +210,7 @@ func (s *ModuleServer) Run() error {
})
m.RegisterModule(modules.FrontendServer, func() (services.Service, error) {
return frontend.ProvideFrontendService(s.cfg, s.features, s.promGatherer, s.registerer, s.license)
return frontend.ProvideFrontendService(s.cfg, s.features, s.promGatherer, s.registerer, s.license, s.hooksService)
})
m.RegisterModule(modules.OperatorServer, s.initOperatorServer)