fix: never include enterprise imports (#124044)

* fix: never include enterprise imports

The imports only need to exist for tooling's sake. It doesn't actually help the binary at all: the code that actually needs it will import it already, and thus bring it into the binary. This means we can persist all the import usage locations' build tags and similar by simply never using the actual imports files in OSS.

* fix: include Grafana imports as well

In some cases, Grafana Enterprise depends on code from apps in Grafana.
This means we need to keep imports from Grafana as well, otherwise go.mod will be inconsistent depending on whether you
have Enterprise linked.
This commit is contained in:
Mariell Hoversholm 2026-05-04 14:54:38 +02:00 committed by GitHub
parent c0707c8ba1
commit 076456d80e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 498 additions and 23 deletions

View file

@ -1,5 +1,5 @@
//go:build enterprise || pro
// +build enterprise pro
//go:build never
// +build never
// Code generated by scripts/ci/generate-enterprise-imports; DO NOT EDIT.
@ -100,6 +100,460 @@ import (
_ "github.com/grafana/grafana-plugin-sdk-go/data/utils/jsoniter"
_ "github.com/grafana/grafana-plugin-sdk-go/experimental/apis/datasource/v0alpha1"
_ "github.com/grafana/grafana-plugin-sdk-go/genproto/pluginv2"
_ "github.com/grafana/grafana/apps/advisor/pkg/apis/advisor/v0alpha1"
_ "github.com/grafana/grafana/apps/advisor/pkg/app"
_ "github.com/grafana/grafana/apps/advisor/pkg/app/checkregistry"
_ "github.com/grafana/grafana/apps/advisor/pkg/app/checks"
_ "github.com/grafana/grafana/apps/advisor/pkg/app/checks/datasourcecheck"
_ "github.com/grafana/grafana/apps/advisor/pkg/app/checks/plugincheck"
_ "github.com/grafana/grafana/apps/alerting/alertenrichment/pkg/apis/alertenrichment/v1beta1"
_ "github.com/grafana/grafana/apps/alerting/historian/pkg/app/config"
_ "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1"
_ "github.com/grafana/grafana/apps/dashboard/pkg/migration/schemaversion"
_ "github.com/grafana/grafana/apps/folder/pkg/apis/folder/v1beta1"
_ "github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1"
_ "github.com/grafana/grafana/apps/plugins/pkg/apis/plugins/v0alpha1"
_ "github.com/grafana/grafana/apps/plugins/pkg/app"
_ "github.com/grafana/grafana/apps/plugins/pkg/app/meta"
_ "github.com/grafana/grafana/apps/plugins/pkg/app/metrics"
_ "github.com/grafana/grafana/apps/provisioning/pkg/apis/provisioning/v0alpha1"
_ "github.com/grafana/grafana/apps/provisioning/pkg/connection"
_ "github.com/grafana/grafana/apps/provisioning/pkg/connection/github"
_ "github.com/grafana/grafana/apps/provisioning/pkg/quotas"
_ "github.com/grafana/grafana/apps/provisioning/pkg/repository"
_ "github.com/grafana/grafana/apps/provisioning/pkg/repository/git"
_ "github.com/grafana/grafana/apps/provisioning/pkg/repository/github"
_ "github.com/grafana/grafana/apps/provisioning/pkg/repository/local"
_ "github.com/grafana/grafana/apps/scope/pkg/apis/scope/v0alpha1"
_ "github.com/grafana/grafana/apps/secret/consolidate/v1beta1"
_ "github.com/grafana/grafana/apps/secret/decrypt/v1beta1"
_ "github.com/grafana/grafana/apps/secret/inline/v1beta1"
_ "github.com/grafana/grafana/apps/secret/pkg/apis/secret/v1beta1"
_ "github.com/grafana/grafana/apps/secret/pkg/decrypt"
_ "github.com/grafana/grafana/pkg/api"
_ "github.com/grafana/grafana/pkg/api/avatar"
_ "github.com/grafana/grafana/pkg/api/datasource"
_ "github.com/grafana/grafana/pkg/api/dtos"
_ "github.com/grafana/grafana/pkg/api/response"
_ "github.com/grafana/grafana/pkg/api/routing"
_ "github.com/grafana/grafana/pkg/apimachinery/apis/common/v0alpha1"
_ "github.com/grafana/grafana/pkg/apimachinery/errutil"
_ "github.com/grafana/grafana/pkg/apimachinery/identity"
_ "github.com/grafana/grafana/pkg/apimachinery/utils"
_ "github.com/grafana/grafana/pkg/apis/datasource/v0alpha1"
_ "github.com/grafana/grafana/pkg/apis/service/v0alpha1"
_ "github.com/grafana/grafana/pkg/apiserver/auditing"
_ "github.com/grafana/grafana/pkg/apiserver/endpoints/filters"
_ "github.com/grafana/grafana/pkg/apiserver/endpoints/responsewriter"
_ "github.com/grafana/grafana/pkg/apiserver/registry/generic"
_ "github.com/grafana/grafana/pkg/apiserver/rest"
_ "github.com/grafana/grafana/pkg/bus"
_ "github.com/grafana/grafana/pkg/clientauth"
_ "github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
_ "github.com/grafana/grafana/pkg/components/loki/logproto"
_ "github.com/grafana/grafana/pkg/components/loki/lokigrpc"
_ "github.com/grafana/grafana/pkg/components/loki/lokihttp"
_ "github.com/grafana/grafana/pkg/components/simplejson"
_ "github.com/grafana/grafana/pkg/configprovider"
_ "github.com/grafana/grafana/pkg/events"
_ "github.com/grafana/grafana/pkg/expr"
_ "github.com/grafana/grafana/pkg/extensions"
_ "github.com/grafana/grafana/pkg/generated/applyconfiguration/service/v0alpha1"
_ "github.com/grafana/grafana/pkg/generated/clientset/versioned"
_ "github.com/grafana/grafana/pkg/generated/informers/externalversions"
_ "github.com/grafana/grafana/pkg/generated/informers/externalversions/service/v0alpha1"
_ "github.com/grafana/grafana/pkg/generated/listers/service/v0alpha1"
_ "github.com/grafana/grafana/pkg/infra/db"
_ "github.com/grafana/grafana/pkg/infra/features"
_ "github.com/grafana/grafana/pkg/infra/filestorage"
_ "github.com/grafana/grafana/pkg/infra/fs"
_ "github.com/grafana/grafana/pkg/infra/httpclient"
_ "github.com/grafana/grafana/pkg/infra/httpclient/httpclientprovider"
_ "github.com/grafana/grafana/pkg/infra/kvstore"
_ "github.com/grafana/grafana/pkg/infra/leaderelection"
_ "github.com/grafana/grafana/pkg/infra/localcache"
_ "github.com/grafana/grafana/pkg/infra/log"
_ "github.com/grafana/grafana/pkg/infra/log/slogadapter"
_ "github.com/grafana/grafana/pkg/infra/metrics"
_ "github.com/grafana/grafana/pkg/infra/metrics/metricutil"
_ "github.com/grafana/grafana/pkg/infra/process"
_ "github.com/grafana/grafana/pkg/infra/remotecache"
_ "github.com/grafana/grafana/pkg/infra/serverlock"
_ "github.com/grafana/grafana/pkg/infra/slugify"
_ "github.com/grafana/grafana/pkg/infra/tracing"
_ "github.com/grafana/grafana/pkg/infra/usagestats"
_ "github.com/grafana/grafana/pkg/infra/usagestats/service"
_ "github.com/grafana/grafana/pkg/infra/usagestats/statscollector"
_ "github.com/grafana/grafana/pkg/infra/usagestats/validator"
_ "github.com/grafana/grafana/pkg/login/social"
_ "github.com/grafana/grafana/pkg/login/social/connectors"
_ "github.com/grafana/grafana/pkg/login/social/socialimpl"
_ "github.com/grafana/grafana/pkg/middleware"
_ "github.com/grafana/grafana/pkg/middleware/cookies"
_ "github.com/grafana/grafana/pkg/middleware/csrf"
_ "github.com/grafana/grafana/pkg/middleware/loggermw"
_ "github.com/grafana/grafana/pkg/middleware/requestmeta"
_ "github.com/grafana/grafana/pkg/models"
_ "github.com/grafana/grafana/pkg/modules"
_ "github.com/grafana/grafana/pkg/operators/provisioning"
_ "github.com/grafana/grafana/pkg/plugins"
_ "github.com/grafana/grafana/pkg/plugins/auth"
_ "github.com/grafana/grafana/pkg/plugins/backendplugin"
_ "github.com/grafana/grafana/pkg/plugins/backendplugin/grpcplugin"
_ "github.com/grafana/grafana/pkg/plugins/backendplugin/provider"
_ "github.com/grafana/grafana/pkg/plugins/config"
_ "github.com/grafana/grafana/pkg/plugins/log"
_ "github.com/grafana/grafana/pkg/plugins/manager"
_ "github.com/grafana/grafana/pkg/plugins/manager/client"
_ "github.com/grafana/grafana/pkg/plugins/manager/filestore"
_ "github.com/grafana/grafana/pkg/plugins/manager/loader"
_ "github.com/grafana/grafana/pkg/plugins/manager/pipeline/bootstrap"
_ "github.com/grafana/grafana/pkg/plugins/manager/pipeline/discovery"
_ "github.com/grafana/grafana/pkg/plugins/manager/pipeline/initialization"
_ "github.com/grafana/grafana/pkg/plugins/manager/pipeline/termination"
_ "github.com/grafana/grafana/pkg/plugins/manager/pipeline/validation"
_ "github.com/grafana/grafana/pkg/plugins/manager/process"
_ "github.com/grafana/grafana/pkg/plugins/manager/registry"
_ "github.com/grafana/grafana/pkg/plugins/manager/signature"
_ "github.com/grafana/grafana/pkg/plugins/manager/sources"
_ "github.com/grafana/grafana/pkg/plugins/pluginassets"
_ "github.com/grafana/grafana/pkg/plugins/pluginerrs"
_ "github.com/grafana/grafana/pkg/plugins/pluginscdn"
_ "github.com/grafana/grafana/pkg/plugins/repo"
_ "github.com/grafana/grafana/pkg/plugins/storage"
_ "github.com/grafana/grafana/pkg/registry"
_ "github.com/grafana/grafana/pkg/registry/apis"
_ "github.com/grafana/grafana/pkg/registry/apis/appplugin"
_ "github.com/grafana/grafana/pkg/registry/apis/collections"
_ "github.com/grafana/grafana/pkg/registry/apis/collections/legacy"
_ "github.com/grafana/grafana/pkg/registry/apis/dashboard"
_ "github.com/grafana/grafana/pkg/registry/apis/dashboard/legacy"
_ "github.com/grafana/grafana/pkg/registry/apis/dashboard/migrator"
_ "github.com/grafana/grafana/pkg/registry/apis/datasource"
_ "github.com/grafana/grafana/pkg/registry/apis/datasource/converter"
_ "github.com/grafana/grafana/pkg/registry/apis/datasource/migrator"
_ "github.com/grafana/grafana/pkg/registry/apis/folders"
_ "github.com/grafana/grafana/pkg/registry/apis/iam"
_ "github.com/grafana/grafana/pkg/registry/apis/iam/authorizer"
_ "github.com/grafana/grafana/pkg/registry/apis/iam/common"
_ "github.com/grafana/grafana/pkg/registry/apis/iam/datasourcek8s"
_ "github.com/grafana/grafana/pkg/registry/apis/iam/externalgroupmapping"
_ "github.com/grafana/grafana/pkg/registry/apis/iam/globalrole/inmemory"
_ "github.com/grafana/grafana/pkg/registry/apis/iam/legacy"
_ "github.com/grafana/grafana/pkg/registry/apis/iam/noopstorage"
_ "github.com/grafana/grafana/pkg/registry/apis/iam/resourcepermission"
_ "github.com/grafana/grafana/pkg/registry/apis/iam/roleeffective"
_ "github.com/grafana/grafana/pkg/registry/apis/ofrep"
_ "github.com/grafana/grafana/pkg/registry/apis/preferences"
_ "github.com/grafana/grafana/pkg/registry/apis/provisioning"
_ "github.com/grafana/grafana/pkg/registry/apis/provisioning/extras"
_ "github.com/grafana/grafana/pkg/registry/apis/provisioning/jobs"
_ "github.com/grafana/grafana/pkg/registry/apis/provisioning/resources"
_ "github.com/grafana/grafana/pkg/registry/apis/provisioning/webhooks"
_ "github.com/grafana/grafana/pkg/registry/apis/provisioning/webhooks/pullrequest"
_ "github.com/grafana/grafana/pkg/registry/apis/query"
_ "github.com/grafana/grafana/pkg/registry/apis/query/clientapi"
_ "github.com/grafana/grafana/pkg/registry/apis/secret"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/clock"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/contracts"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/decrypt"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/encryption"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/encryption/cipher"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/encryption/cipher/service"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/encryption/kmsproviders"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/encryption/manager"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/garbagecollectionworker"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/inline"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/mutator"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/secretkeeper"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/service"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/validator"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/xkube"
_ "github.com/grafana/grafana/pkg/registry/apis/service"
_ "github.com/grafana/grafana/pkg/registry/apis/userstorage"
_ "github.com/grafana/grafana/pkg/registry/apps"
_ "github.com/grafana/grafana/pkg/registry/apps/advisor"
_ "github.com/grafana/grafana/pkg/registry/apps/alerting/historian"
_ "github.com/grafana/grafana/pkg/registry/apps/alerting/notifications"
_ "github.com/grafana/grafana/pkg/registry/apps/alerting/rules"
_ "github.com/grafana/grafana/pkg/registry/apps/annotation"
_ "github.com/grafana/grafana/pkg/registry/apps/correlations"
_ "github.com/grafana/grafana/pkg/registry/apps/dashvalidator"
_ "github.com/grafana/grafana/pkg/registry/apps/example"
_ "github.com/grafana/grafana/pkg/registry/apps/live"
_ "github.com/grafana/grafana/pkg/registry/apps/logsdrilldown"
_ "github.com/grafana/grafana/pkg/registry/apps/playlist"
_ "github.com/grafana/grafana/pkg/registry/apps/playlist/migrator"
_ "github.com/grafana/grafana/pkg/registry/apps/plugins"
_ "github.com/grafana/grafana/pkg/registry/apps/querycaching"
_ "github.com/grafana/grafana/pkg/registry/apps/querycaching/migrator"
_ "github.com/grafana/grafana/pkg/registry/apps/quotas"
_ "github.com/grafana/grafana/pkg/registry/apps/shorturl"
_ "github.com/grafana/grafana/pkg/registry/apps/shorturl/migrator"
_ "github.com/grafana/grafana/pkg/registry/backgroundsvcs"
_ "github.com/grafana/grafana/pkg/registry/fieldselectors"
_ "github.com/grafana/grafana/pkg/registry/usagestatssvcs"
_ "github.com/grafana/grafana/pkg/semconv"
_ "github.com/grafana/grafana/pkg/services/accesscontrol"
_ "github.com/grafana/grafana/pkg/services/accesscontrol/acimpl"
_ "github.com/grafana/grafana/pkg/services/accesscontrol/actest"
_ "github.com/grafana/grafana/pkg/services/accesscontrol/api"
_ "github.com/grafana/grafana/pkg/services/accesscontrol/database"
_ "github.com/grafana/grafana/pkg/services/accesscontrol/dualwrite"
_ "github.com/grafana/grafana/pkg/services/accesscontrol/migrator"
_ "github.com/grafana/grafana/pkg/services/accesscontrol/ossaccesscontrol"
_ "github.com/grafana/grafana/pkg/services/accesscontrol/permreg"
_ "github.com/grafana/grafana/pkg/services/accesscontrol/pluginutils"
_ "github.com/grafana/grafana/pkg/services/accesscontrol/resourcepermissions"
_ "github.com/grafana/grafana/pkg/services/accesscontrol/seeding"
_ "github.com/grafana/grafana/pkg/services/annotations"
_ "github.com/grafana/grafana/pkg/services/annotations/annotationsimpl"
_ "github.com/grafana/grafana/pkg/services/anonymous"
_ "github.com/grafana/grafana/pkg/services/anonymous/anonimpl"
_ "github.com/grafana/grafana/pkg/services/anonymous/anonimpl/anonstore"
_ "github.com/grafana/grafana/pkg/services/anonymous/validator"
_ "github.com/grafana/grafana/pkg/services/apikey/apikeyimpl"
_ "github.com/grafana/grafana/pkg/services/apiserver"
_ "github.com/grafana/grafana/pkg/services/apiserver/aggregatorrunner"
_ "github.com/grafana/grafana/pkg/services/apiserver/appinstaller"
_ "github.com/grafana/grafana/pkg/services/apiserver/auth/authorizer"
_ "github.com/grafana/grafana/pkg/services/apiserver/auth/authorizer/storewrapper"
_ "github.com/grafana/grafana/pkg/services/apiserver/builder"
_ "github.com/grafana/grafana/pkg/services/apiserver/client"
_ "github.com/grafana/grafana/pkg/services/apiserver/endpoints/request"
_ "github.com/grafana/grafana/pkg/services/apiserver/options"
_ "github.com/grafana/grafana/pkg/services/apiserver/standalone"
_ "github.com/grafana/grafana/pkg/services/apiserver/utils"
_ "github.com/grafana/grafana/pkg/services/auth"
_ "github.com/grafana/grafana/pkg/services/auth/authimpl"
_ "github.com/grafana/grafana/pkg/services/auth/authtest"
_ "github.com/grafana/grafana/pkg/services/auth/idimpl"
_ "github.com/grafana/grafana/pkg/services/auth/jwt"
_ "github.com/grafana/grafana/pkg/services/authn"
_ "github.com/grafana/grafana/pkg/services/authn/authnimpl"
_ "github.com/grafana/grafana/pkg/services/authn/authnserver"
_ "github.com/grafana/grafana/pkg/services/authn/clients"
_ "github.com/grafana/grafana/pkg/services/authn/grpcutils"
_ "github.com/grafana/grafana/pkg/services/authz"
_ "github.com/grafana/grafana/pkg/services/authz/proto/v1"
_ "github.com/grafana/grafana/pkg/services/authz/rbac"
_ "github.com/grafana/grafana/pkg/services/authz/zanzana"
_ "github.com/grafana/grafana/pkg/services/authz/zanzana/common"
_ "github.com/grafana/grafana/pkg/services/authz/zanzana/server/reconciler"
_ "github.com/grafana/grafana/pkg/services/authz/zanzana/store"
_ "github.com/grafana/grafana/pkg/services/caching"
_ "github.com/grafana/grafana/pkg/services/cleanup"
_ "github.com/grafana/grafana/pkg/services/cloudmigration"
_ "github.com/grafana/grafana/pkg/services/cloudmigration/cloudmigrationimpl"
_ "github.com/grafana/grafana/pkg/services/contexthandler"
_ "github.com/grafana/grafana/pkg/services/contexthandler/model"
_ "github.com/grafana/grafana/pkg/services/correlations"
_ "github.com/grafana/grafana/pkg/services/dashboardimport"
_ "github.com/grafana/grafana/pkg/services/dashboardimport/service"
_ "github.com/grafana/grafana/pkg/services/dashboards"
_ "github.com/grafana/grafana/pkg/services/dashboards/dashboardaccess"
_ "github.com/grafana/grafana/pkg/services/dashboards/service"
_ "github.com/grafana/grafana/pkg/services/dashboards/service/client"
_ "github.com/grafana/grafana/pkg/services/dashboardsnapshots"
_ "github.com/grafana/grafana/pkg/services/dashboardsnapshots/database"
_ "github.com/grafana/grafana/pkg/services/dashboardsnapshots/service"
_ "github.com/grafana/grafana/pkg/services/dashboardversion/dashverimpl"
_ "github.com/grafana/grafana/pkg/services/datasourceproxy"
_ "github.com/grafana/grafana/pkg/services/datasources"
_ "github.com/grafana/grafana/pkg/services/datasources/guardian"
_ "github.com/grafana/grafana/pkg/services/datasources/service"
_ "github.com/grafana/grafana/pkg/services/dsquerierclient"
_ "github.com/grafana/grafana/pkg/services/encryption"
_ "github.com/grafana/grafana/pkg/services/encryption/provider"
_ "github.com/grafana/grafana/pkg/services/encryption/service"
_ "github.com/grafana/grafana/pkg/services/extsvcauth"
_ "github.com/grafana/grafana/pkg/services/extsvcauth/registry"
_ "github.com/grafana/grafana/pkg/services/featuremgmt"
_ "github.com/grafana/grafana/pkg/services/folder"
_ "github.com/grafana/grafana/pkg/services/folder/folderimpl"
_ "github.com/grafana/grafana/pkg/services/grpcserver"
_ "github.com/grafana/grafana/pkg/services/grpcserver/context"
_ "github.com/grafana/grafana/pkg/services/grpcserver/interceptors"
_ "github.com/grafana/grafana/pkg/services/hooks"
_ "github.com/grafana/grafana/pkg/services/kmsproviders"
_ "github.com/grafana/grafana/pkg/services/kmsproviders/osskmsproviders"
_ "github.com/grafana/grafana/pkg/services/ldap"
_ "github.com/grafana/grafana/pkg/services/ldap/api"
_ "github.com/grafana/grafana/pkg/services/ldap/service"
_ "github.com/grafana/grafana/pkg/services/libraryelements"
_ "github.com/grafana/grafana/pkg/services/libraryelements/model"
_ "github.com/grafana/grafana/pkg/services/librarypanels"
_ "github.com/grafana/grafana/pkg/services/licensing"
_ "github.com/grafana/grafana/pkg/services/live"
_ "github.com/grafana/grafana/pkg/services/live/pushhttp"
_ "github.com/grafana/grafana/pkg/services/login"
_ "github.com/grafana/grafana/pkg/services/login/authinfoimpl"
_ "github.com/grafana/grafana/pkg/services/loginattempt"
_ "github.com/grafana/grafana/pkg/services/loginattempt/loginattemptimpl"
_ "github.com/grafana/grafana/pkg/services/navtree"
_ "github.com/grafana/grafana/pkg/services/navtree/navtreeimpl"
_ "github.com/grafana/grafana/pkg/services/ngalert"
_ "github.com/grafana/grafana/pkg/services/ngalert/accesscontrol"
_ "github.com/grafana/grafana/pkg/services/ngalert/api"
_ "github.com/grafana/grafana/pkg/services/ngalert/api/prometheus"
_ "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
_ "github.com/grafana/grafana/pkg/services/ngalert/eval"
_ "github.com/grafana/grafana/pkg/services/ngalert/image"
_ "github.com/grafana/grafana/pkg/services/ngalert/metrics"
_ "github.com/grafana/grafana/pkg/services/ngalert/models"
_ "github.com/grafana/grafana/pkg/services/ngalert/provisioning/validation"
_ "github.com/grafana/grafana/pkg/services/ngalert/schedule"
_ "github.com/grafana/grafana/pkg/services/ngalert/state/historian"
_ "github.com/grafana/grafana/pkg/services/ngalert/store"
_ "github.com/grafana/grafana/pkg/services/ngalert/writer"
_ "github.com/grafana/grafana/pkg/services/notifications"
_ "github.com/grafana/grafana/pkg/services/oauthtoken"
_ "github.com/grafana/grafana/pkg/services/oauthtoken/oauthtokentest"
_ "github.com/grafana/grafana/pkg/services/org"
_ "github.com/grafana/grafana/pkg/services/org/orgimpl"
_ "github.com/grafana/grafana/pkg/services/plugindashboards"
_ "github.com/grafana/grafana/pkg/services/plugindashboards/service"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/adapters"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/advisor"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/angulardetectorsprovider"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/angularinspector"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/angularpatternsstore"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/clientmiddleware"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/coreplugin"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/dashboards"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/installsync"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/keyretriever"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/keyretriever/dynamic"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/keystore"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/licensing"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/loader"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/managedplugins"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/pipeline"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginaccesscontrol"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginassets"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginchecker"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginconfig"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/plugincontext"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginexternal"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/plugininstaller"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings/service"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsources"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsso"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/provisionedplugins"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/sandbox"
_ "github.com/grafana/grafana/pkg/services/pluginsintegration/serviceregistration"
_ "github.com/grafana/grafana/pkg/services/preference"
_ "github.com/grafana/grafana/pkg/services/preference/prefimpl"
_ "github.com/grafana/grafana/pkg/services/promtypemigration"
_ "github.com/grafana/grafana/pkg/services/provisioning"
_ "github.com/grafana/grafana/pkg/services/publicdashboards"
_ "github.com/grafana/grafana/pkg/services/publicdashboards/api"
_ "github.com/grafana/grafana/pkg/services/publicdashboards/database"
_ "github.com/grafana/grafana/pkg/services/publicdashboards/metric"
_ "github.com/grafana/grafana/pkg/services/publicdashboards/models"
_ "github.com/grafana/grafana/pkg/services/publicdashboards/service"
_ "github.com/grafana/grafana/pkg/services/publicdashboards/validation"
_ "github.com/grafana/grafana/pkg/services/query"
_ "github.com/grafana/grafana/pkg/services/queryhistory"
_ "github.com/grafana/grafana/pkg/services/quota"
_ "github.com/grafana/grafana/pkg/services/quota/quotaimpl"
_ "github.com/grafana/grafana/pkg/services/quota/quotatest"
_ "github.com/grafana/grafana/pkg/services/rendering"
_ "github.com/grafana/grafana/pkg/services/screenshot"
_ "github.com/grafana/grafana/pkg/services/search"
_ "github.com/grafana/grafana/pkg/services/search/model"
_ "github.com/grafana/grafana/pkg/services/search/sort"
_ "github.com/grafana/grafana/pkg/services/searchusers"
_ "github.com/grafana/grafana/pkg/services/searchusers/filters"
_ "github.com/grafana/grafana/pkg/services/secrets"
_ "github.com/grafana/grafana/pkg/services/secrets/database"
_ "github.com/grafana/grafana/pkg/services/secrets/kvstore"
_ "github.com/grafana/grafana/pkg/services/secrets/kvstore/migrations"
_ "github.com/grafana/grafana/pkg/services/secrets/manager"
_ "github.com/grafana/grafana/pkg/services/secrets/migrator"
_ "github.com/grafana/grafana/pkg/services/serviceaccounts"
_ "github.com/grafana/grafana/pkg/services/serviceaccounts/extsvcaccounts"
_ "github.com/grafana/grafana/pkg/services/serviceaccounts/manager"
_ "github.com/grafana/grafana/pkg/services/serviceaccounts/proxy"
_ "github.com/grafana/grafana/pkg/services/serviceaccounts/retriever"
_ "github.com/grafana/grafana/pkg/services/setting"
_ "github.com/grafana/grafana/pkg/services/shorturls"
_ "github.com/grafana/grafana/pkg/services/shorturls/shorturlimpl"
_ "github.com/grafana/grafana/pkg/services/signingkeys"
_ "github.com/grafana/grafana/pkg/services/signingkeys/signingkeysimpl"
_ "github.com/grafana/grafana/pkg/services/sqlstore"
_ "github.com/grafana/grafana/pkg/services/sqlstore/migrations"
_ "github.com/grafana/grafana/pkg/services/sqlstore/migrations/accesscontrol"
_ "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
_ "github.com/grafana/grafana/pkg/services/sqlstore/session"
_ "github.com/grafana/grafana/pkg/services/sqlstore/sqlutil"
_ "github.com/grafana/grafana/pkg/services/ssosettings"
_ "github.com/grafana/grafana/pkg/services/ssosettings/models"
_ "github.com/grafana/grafana/pkg/services/ssosettings/ssosettingsimpl"
_ "github.com/grafana/grafana/pkg/services/star"
_ "github.com/grafana/grafana/pkg/services/star/api"
_ "github.com/grafana/grafana/pkg/services/star/starimpl"
_ "github.com/grafana/grafana/pkg/services/stats/statsimpl"
_ "github.com/grafana/grafana/pkg/services/store"
_ "github.com/grafana/grafana/pkg/services/supportbundles"
_ "github.com/grafana/grafana/pkg/services/supportbundles/bundleregistry"
_ "github.com/grafana/grafana/pkg/services/supportbundles/supportbundlesimpl"
_ "github.com/grafana/grafana/pkg/services/supportbundles/supportbundlestest"
_ "github.com/grafana/grafana/pkg/services/tag"
_ "github.com/grafana/grafana/pkg/services/tag/tagimpl"
_ "github.com/grafana/grafana/pkg/services/team"
_ "github.com/grafana/grafana/pkg/services/team/teamapi"
_ "github.com/grafana/grafana/pkg/services/team/teamimpl"
_ "github.com/grafana/grafana/pkg/services/temp_user"
_ "github.com/grafana/grafana/pkg/services/temp_user/tempuserimpl"
_ "github.com/grafana/grafana/pkg/services/updatemanager"
_ "github.com/grafana/grafana/pkg/services/user"
_ "github.com/grafana/grafana/pkg/services/user/userimpl"
_ "github.com/grafana/grafana/pkg/services/validations"
_ "github.com/grafana/grafana/pkg/setting"
_ "github.com/grafana/grafana/pkg/storage/legacysql"
_ "github.com/grafana/grafana/pkg/storage/legacysql/dualwrite"
_ "github.com/grafana/grafana/pkg/storage/secret/database"
_ "github.com/grafana/grafana/pkg/storage/secret/encryption"
_ "github.com/grafana/grafana/pkg/storage/secret/metadata"
_ "github.com/grafana/grafana/pkg/storage/secret/migrator"
_ "github.com/grafana/grafana/pkg/storage/unified"
_ "github.com/grafana/grafana/pkg/storage/unified/apistore"
_ "github.com/grafana/grafana/pkg/storage/unified/migrations"
_ "github.com/grafana/grafana/pkg/storage/unified/resource"
_ "github.com/grafana/grafana/pkg/storage/unified/resource/kv"
_ "github.com/grafana/grafana/pkg/storage/unified/resourcepb"
_ "github.com/grafana/grafana/pkg/storage/unified/search"
_ "github.com/grafana/grafana/pkg/storage/unified/search/builders"
_ "github.com/grafana/grafana/pkg/storage/unified/search/vector"
_ "github.com/grafana/grafana/pkg/storage/unified/sql/sqltemplate"
_ "github.com/grafana/grafana/pkg/tests/apis"
_ "github.com/grafana/grafana/pkg/tsdb/azuremonitor"
_ "github.com/grafana/grafana/pkg/tsdb/cloud-monitoring"
_ "github.com/grafana/grafana/pkg/tsdb/cloudwatch"
_ "github.com/grafana/grafana/pkg/tsdb/grafana-postgresql-datasource"
_ "github.com/grafana/grafana/pkg/tsdb/grafana-pyroscope-datasource"
_ "github.com/grafana/grafana/pkg/tsdb/grafana-testdata-datasource"
_ "github.com/grafana/grafana/pkg/tsdb/grafanads"
_ "github.com/grafana/grafana/pkg/tsdb/graphite"
_ "github.com/grafana/grafana/pkg/tsdb/influxdb"
_ "github.com/grafana/grafana/pkg/tsdb/jaeger"
_ "github.com/grafana/grafana/pkg/tsdb/loki"
_ "github.com/grafana/grafana/pkg/tsdb/mssql"
_ "github.com/grafana/grafana/pkg/tsdb/mysql"
_ "github.com/grafana/grafana/pkg/tsdb/opentsdb"
_ "github.com/grafana/grafana/pkg/tsdb/parca"
_ "github.com/grafana/grafana/pkg/tsdb/prometheus"
_ "github.com/grafana/grafana/pkg/tsdb/tempo"
_ "github.com/grafana/grafana/pkg/tsdb/zipkin"
_ "github.com/grafana/grafana/pkg/util"
_ "github.com/grafana/grafana/pkg/util/errhttp"
_ "github.com/grafana/grafana/pkg/util/retryer"
_ "github.com/grafana/grafana/pkg/util/xorm"
_ "github.com/grafana/grafana/pkg/web"
_ "github.com/grafana/pyroscope-go/godeltaprof/http/pprof"
_ "github.com/grafana/schemads"
_ "github.com/grafana/schemads/tables"

View file

@ -1,6 +1,9 @@
//go:build never
// +build never
// Code generated by scripts/ci/generate-enterprise-imports; DO NOT EDIT.
package extensions_test
package extensions
import (
_ "github.com/alicebob/miniredis/v2"
@ -10,6 +13,37 @@ import (
_ "github.com/grafana/grafana-azure-sdk-go/v2/azsettings"
_ "github.com/grafana/grafana-plugin-sdk-go/backend/handlertest"
_ "github.com/grafana/grafana-plugin-sdk-go/backend/proxy"
_ "github.com/grafana/grafana/pkg/infra/db/dbtest"
_ "github.com/grafana/grafana/pkg/infra/log/logtest"
_ "github.com/grafana/grafana/pkg/models/usertoken"
_ "github.com/grafana/grafana/pkg/plugins/manager/loader/angular/angularinspector"
_ "github.com/grafana/grafana/pkg/plugins/manager/pluginfakes"
_ "github.com/grafana/grafana/pkg/registry/apis/secret/testutils"
_ "github.com/grafana/grafana/pkg/services/accesscontrol/mock"
_ "github.com/grafana/grafana/pkg/services/anonymous/anontest"
_ "github.com/grafana/grafana/pkg/services/authn/authntest"
_ "github.com/grafana/grafana/pkg/services/authz/zanzana/server"
_ "github.com/grafana/grafana/pkg/services/contexthandler/ctxkey"
_ "github.com/grafana/grafana/pkg/services/datasources/fakes"
_ "github.com/grafana/grafana/pkg/services/ldap/multildap"
_ "github.com/grafana/grafana/pkg/services/licensing/licensingtest"
_ "github.com/grafana/grafana/pkg/services/login/authinfotest"
_ "github.com/grafana/grafana/pkg/services/ngalert/accesscontrol/fakes"
_ "github.com/grafana/grafana/pkg/services/ngalert/tests/fakes"
_ "github.com/grafana/grafana/pkg/services/org/orgtest"
_ "github.com/grafana/grafana/pkg/services/preference/preftest"
_ "github.com/grafana/grafana/pkg/services/secrets/fakes"
_ "github.com/grafana/grafana/pkg/services/ssosettings/api"
_ "github.com/grafana/grafana/pkg/services/ssosettings/ssosettingstests"
_ "github.com/grafana/grafana/pkg/services/ssosettings/strategies"
_ "github.com/grafana/grafana/pkg/services/team/teamtest"
_ "github.com/grafana/grafana/pkg/services/user/usertest"
_ "github.com/grafana/grafana/pkg/storage/unified/sql/sqltemplate/mocks"
_ "github.com/grafana/grafana/pkg/storage/unified/testing"
_ "github.com/grafana/grafana/pkg/tests/testinfra"
_ "github.com/grafana/grafana/pkg/tests/testsuite"
_ "github.com/grafana/grafana/pkg/util/testutil"
_ "github.com/grafana/grafana/pkg/web/webtest"
_ "github.com/open-feature/go-sdk/openfeature/testing"
_ "github.com/openfga/openfga/pkg/server/test"
_ "github.com/openfga/openfga/pkg/storage/test"

View file

@ -28,8 +28,8 @@ func main() {
}
}
var mainFileTemplate = template.Must(template.New("main").Parse(`//go:build enterprise || pro
// +build enterprise pro
var fileTemplate = template.Must(template.New("main").Parse(`//go:build never
// +build never
// Code generated by scripts/ci/generate-enterprise-imports; DO NOT EDIT.
@ -44,19 +44,6 @@ import (
{{- end}}
`))
var testFileTemplate = template.Must(template.New("test").Parse(`// Code generated by scripts/ci/generate-enterprise-imports; DO NOT EDIT.
package extensions_test
{{- if .}}
import (
{{- range .}}
_ "{{.}}"
{{- end}}
)
{{- end}}
`))
func run() error {
srcDir := filepath.Join(*enterprisePath, "src")
@ -98,9 +85,9 @@ func run() error {
continue
}
// Skip grafana internal packages
if strings.HasPrefix(importPath, "github.com/grafana/grafana/") ||
strings.HasPrefix(importPath, "github.com/grafana/grafana-enterprise/") {
// Skip grafana-enterprise internal packages
if strings.HasPrefix(importPath, "github.com/grafana/grafana-enterprise/") ||
strings.HasPrefix(importPath, "github.com/grafana/grafana/pkg/extensions/") {
continue
}
@ -121,10 +108,10 @@ func run() error {
delete(testImports, imp)
}
if err := writeFile(filepath.Join(*outputPath, "enterprise_imports.go"), mainFileTemplate, sortedSlice(regularImports)); err != nil {
if err := writeFile(filepath.Join(*outputPath, "enterprise_imports.go"), fileTemplate, sortedSlice(regularImports)); err != nil {
return err
}
if err := writeFile(filepath.Join(*outputPath, "enterprise_imports_test.go"), testFileTemplate, sortedSlice(testImports)); err != nil {
if err := writeFile(filepath.Join(*outputPath, "enterprise_imports_test.go"), fileTemplate, sortedSlice(testImports)); err != nil {
return err
}