diff --git a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md index 63ebab39687..4b9a5b41780 100644 --- a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md +++ b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md @@ -74,7 +74,6 @@ Most [generally available](https://grafana.com/docs/release-life-cycle/#general- | `alertingQueryAndExpressionsStepMode` | Enables step mode for alerting queries and expressions | Yes | | `useSessionStorageForRedirection` | Use session storage for handling the redirection after login | Yes | | `pluginsSriChecks` | Enables SRI checks for plugin assets | | -| `userStorageAPI` | Enables the user storage API | Yes | | `azureMonitorDisableLogLimit` | Disables the log limit restriction for Azure Monitor when true. The limit is enabled by default. | | | `preinstallAutoUpdate` | Enables automatic updates for pre-installed plugins | Yes | | `reportingUseRawTimeRange` | Uses the original report or dashboard time range instead of making an absolute transformation | Yes | diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index 7fd50cb68e7..cbaefc28634 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -839,11 +839,6 @@ export interface FeatureToggles { */ prometheusUsesCombobox?: boolean; /** - * Enables the user storage API - * @default true - */ - userStorageAPI?: boolean; - /** * Disables the log limit restriction for Azure Monitor when true. The limit is enabled by default. * @default false */ diff --git a/packages/grafana-runtime/src/utils/userStorage.test.tsx b/packages/grafana-runtime/src/utils/userStorage.test.tsx index 4f28ffae6ff..46999241686 100644 --- a/packages/grafana-runtime/src/utils/userStorage.test.tsx +++ b/packages/grafana-runtime/src/utils/userStorage.test.tsx @@ -30,7 +30,6 @@ describe('userStorage', () => { const originalConfig = cloneDeep(config); beforeEach(() => { - config.featureToggles.userStorageAPI = true; config.bootData.user.isSignedIn = true; config.bootData.user.uid = 'abc'; request.mockReset(); @@ -46,13 +45,6 @@ describe('userStorage', () => { }); describe('UserStorageAPI.getItem', () => { - it('use localStorage if the feature flag is disabled', async () => { - config.featureToggles.userStorageAPI = false; - const storage = usePluginUserStorage(); - storage.getItem('key'); - expect(localStorage.getItem).toHaveBeenCalled(); - }); - it('use localStorage if the user is not logged in', async () => { config.bootData.user.isSignedIn = false; const storage = usePluginUserStorage(); @@ -78,13 +70,6 @@ describe('userStorage', () => { }); describe('setItem', () => { - it('use localStorage if the feature flag is disabled', async () => { - config.featureToggles.userStorageAPI = false; - const storage = usePluginUserStorage(); - storage.setItem('key', 'value'); - expect(localStorage.setItem).toHaveBeenCalled(); - }); - it('use localStorage if the user is not logged in', async () => { config.bootData.user.isSignedIn = false; const storage = usePluginUserStorage(); diff --git a/packages/grafana-runtime/src/utils/userStorage.tsx b/packages/grafana-runtime/src/utils/userStorage.tsx index ccdab4f4534..57ed8354404 100644 --- a/packages/grafana-runtime/src/utils/userStorage.tsx +++ b/packages/grafana-runtime/src/utils/userStorage.tsx @@ -50,7 +50,7 @@ class UserStorage { this.service = service; this.userUID = config.bootData.user.uid === '' ? config.bootData.user.id.toString() : config.bootData.user.uid; this.resourceName = `${service}:${this.userUID}`; - this.canUseUserStorage = config.featureToggles.userStorageAPI === true && config.bootData.user.isSignedIn; + this.canUseUserStorage = config.bootData.user.isSignedIn; } private async init() { @@ -81,7 +81,7 @@ class UserStorage { // Ensure this.storageSpec is initialized await this.init(); if (!this.storageSpec) { - // Also, fallback to localStorage for backward compatibility once userStorageAPI is enabled + // Also, fallback to localStorage for backward compatibility return localStorage.getItem(this.resourceName); } return this.storageSpec.data[key]; diff --git a/pkg/registry/apis/userstorage/register.go b/pkg/registry/apis/userstorage/register.go index b9e01681649..5da9b7c7da5 100644 --- a/pkg/registry/apis/userstorage/register.go +++ b/pkg/registry/apis/userstorage/register.go @@ -25,10 +25,6 @@ type UserStorageAPIBuilder struct { } func RegisterAPIService(features featuremgmt.FeatureToggles, apiregistration builder.APIRegistrar, registerer prometheus.Registerer) *UserStorageAPIBuilder { - if !features.IsEnabledGlobally(featuremgmt.FlagUserStorageAPI) { - return nil - } - builder := &UserStorageAPIBuilder{ registerer: registerer, } diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index 07d9fb64ea1..33f7c06337e 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -1437,13 +1437,6 @@ var ( Stage: FeatureStageExperimental, Owner: grafanaOSSBigTent, }, - { - Name: "userStorageAPI", - Description: "Enables the user storage API", - Stage: FeatureStageGeneralAvailability, - Owner: grafanaPluginsPlatformSquad, - Expression: "true", // enabled by default - }, { Name: "azureMonitorDisableLogLimit", Description: "Disables the log limit restriction for Azure Monitor when true. The limit is enabled by default.", diff --git a/pkg/services/featuremgmt/toggles_gen.csv b/pkg/services/featuremgmt/toggles_gen.csv index ea98d5d8e31..b1ec0b3eddf 100644 --- a/pkg/services/featuremgmt/toggles_gen.csv +++ b/pkg/services/featuremgmt/toggles_gen.csv @@ -189,7 +189,6 @@ pluginsSriChecks,GA,@grafana/plugins-platform-backend,false,false,false unifiedStorageBigObjectsSupport,experimental,@grafana/search-and-storage,false,false,false timeRangeProvider,experimental,@grafana/grafana-frontend-platform,false,false,false prometheusUsesCombobox,experimental,@grafana/oss-big-tent,false,false,false -userStorageAPI,GA,@grafana/plugins-platform-backend,false,false,false azureMonitorDisableLogLimit,GA,@grafana/partner-datasources,false,false,false preinstallAutoUpdate,GA,@grafana/plugins-platform-backend,false,false,false playlistsReconciler,experimental,@grafana/grafana-app-platform-squad,false,true,false diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index 5097882bed4..1845d8704be 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -767,10 +767,6 @@ const ( // Use new combobox component for Prometheus query editor FlagPrometheusUsesCombobox = "prometheusUsesCombobox" - // FlagUserStorageAPI - // Enables the user storage API - FlagUserStorageAPI = "userStorageAPI" - // FlagAzureMonitorDisableLogLimit // Disables the log limit restriction for Azure Monitor when true. The limit is enabled by default. FlagAzureMonitorDisableLogLimit = "azureMonitorDisableLogLimit" diff --git a/pkg/services/featuremgmt/toggles_gen.json b/pkg/services/featuremgmt/toggles_gen.json index be2b6310e54..8484fd2c274 100644 --- a/pkg/services/featuremgmt/toggles_gen.json +++ b/pkg/services/featuremgmt/toggles_gen.json @@ -4385,6 +4385,7 @@ "name": "userStorageAPI", "resourceVersion": "1736438999910", "creationTimestamp": "2024-11-12T11:56:41Z", + "deletionTimestamp": "2025-03-26T14:33:40Z", "annotations": { "grafana.app/updatedTimestamp": "2025-01-09 16:09:59.910083 +0000 UTC" }