Plugins: Remove userStorageAPI feature toggle (#102915)

This commit is contained in:
Hugo Kiyodi Oshiro
2025-03-27 13:40:00 +01:00
committed by GitHub
parent 684b37556f
commit 69d8419109
9 changed files with 3 additions and 39 deletions
@@ -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 |
@@ -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
*/
@@ -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();
@@ -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];
@@ -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,
}
-7
View File
@@ -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.",
-1
View File
@@ -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
1 Name Stage Owner requiresDevMode RequiresRestart FrontendOnly
189 unifiedStorageBigObjectsSupport experimental @grafana/search-and-storage false false false
190 timeRangeProvider experimental @grafana/grafana-frontend-platform false false false
191 prometheusUsesCombobox experimental @grafana/oss-big-tent false false false
userStorageAPI GA @grafana/plugins-platform-backend false false false
192 azureMonitorDisableLogLimit GA @grafana/partner-datasources false false false
193 preinstallAutoUpdate GA @grafana/plugins-platform-backend false false false
194 playlistsReconciler experimental @grafana/grafana-app-platform-squad false true false
-4
View File
@@ -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"
@@ -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"
}