mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
[Folders] Put move and counts behid a feature flag (#98317)
* Put move and counts behid a feature flag * Gen toggles * Generate feature flag * Make feature name more explicit * Remove unused code * Update toggle name
This commit is contained in:
parent
e72ba20ff6
commit
df36e77cd3
@ -230,6 +230,8 @@ Experimental features might be changed or removed without prior notice.
|
||||
| `useV2DashboardsAPI` | Use the v2 kubernetes API in the frontend for dashboards |
|
||||
| `unifiedHistory` | Displays the navigation history so the user can navigate back to previous pages |
|
||||
| `investigationsBackend` | Enable the investigations backend API |
|
||||
| `k8SFolderCounts` | Enable folder's api server counts |
|
||||
| `k8SFolderMove` | Enable folder's api server move |
|
||||
|
||||
## Development feature toggles
|
||||
|
||||
|
@ -248,4 +248,6 @@ export interface FeatureToggles {
|
||||
unifiedHistory?: boolean;
|
||||
lokiLabelNamesQueryApi?: boolean;
|
||||
investigationsBackend?: boolean;
|
||||
k8SFolderCounts?: boolean;
|
||||
k8SFolderMove?: boolean;
|
||||
}
|
||||
|
@ -63,8 +63,16 @@ func (hs *HTTPServer) registerFolderAPI(apiRoute routing.RouteRegister, authoriz
|
||||
folderUidRoute.Put("/", handler.updateFolder)
|
||||
folderUidRoute.Delete("/", handler.deleteFolder)
|
||||
folderUidRoute.Get("/", handler.getFolder)
|
||||
folderUidRoute.Get("/counts", handler.countFolderContent)
|
||||
folderUidRoute.Post("/move", handler.moveFolder)
|
||||
if hs.Features.IsEnabledGlobally(featuremgmt.FlagK8SFolderCounts) {
|
||||
folderUidRoute.Get("/counts", handler.countFolderContent)
|
||||
} else {
|
||||
folderUidRoute.Get("/counts", authorize(accesscontrol.EvalPermission(dashboards.ActionFoldersRead, uidScope)), routing.Wrap(hs.GetFolderDescendantCounts))
|
||||
}
|
||||
if hs.Features.IsEnabledGlobally(featuremgmt.FlagK8SFolderMove) {
|
||||
folderUidRoute.Post("/move", handler.moveFolder)
|
||||
} else {
|
||||
folderUidRoute.Post("/move", authorize(accesscontrol.EvalPermission(dashboards.ActionFoldersWrite, uidScope)), routing.Wrap(hs.MoveFolder))
|
||||
}
|
||||
})
|
||||
} else {
|
||||
folderRoute.Post("/", authorize(accesscontrol.EvalPermission(dashboards.ActionFoldersCreate)), routing.Wrap(hs.CreateFolder))
|
||||
|
@ -1719,6 +1719,20 @@ var (
|
||||
Owner: grafanaAppPlatformSquad,
|
||||
Expression: "false",
|
||||
},
|
||||
{
|
||||
Name: "k8SFolderCounts",
|
||||
Description: "Enable folder's api server counts",
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaSearchAndStorageSquad,
|
||||
Expression: "false",
|
||||
},
|
||||
{
|
||||
Name: "k8SFolderMove",
|
||||
Description: "Enable folder's api server move",
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaSearchAndStorageSquad,
|
||||
Expression: "false",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -229,3 +229,5 @@ elasticsearchCrossClusterSearch,preview,@grafana/aws-datasources,false,false,fal
|
||||
unifiedHistory,experimental,@grafana/grafana-frontend-platform,false,false,true
|
||||
lokiLabelNamesQueryApi,GA,@grafana/observability-logs,false,false,false
|
||||
investigationsBackend,experimental,@grafana/grafana-app-platform-squad,false,false,false
|
||||
k8SFolderCounts,experimental,@grafana/search-and-storage,false,false,false
|
||||
k8SFolderMove,experimental,@grafana/search-and-storage,false,false,false
|
||||
|
|
@ -926,4 +926,12 @@ const (
|
||||
// FlagInvestigationsBackend
|
||||
// Enable the investigations backend API
|
||||
FlagInvestigationsBackend = "investigationsBackend"
|
||||
|
||||
// FlagK8SFolderCounts
|
||||
// Enable folder's api server counts
|
||||
FlagK8SFolderCounts = "k8SFolderCounts"
|
||||
|
||||
// FlagK8SFolderMove
|
||||
// Enable folder's api server move
|
||||
FlagK8SFolderMove = "k8SFolderMove"
|
||||
)
|
||||
|
@ -1586,6 +1586,34 @@
|
||||
"frontend": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "folderCounts",
|
||||
"resourceVersion": "1734702013658",
|
||||
"creationTimestamp": "2024-12-20T13:40:13Z",
|
||||
"deletionTimestamp": "2024-12-27T10:19:54Z"
|
||||
},
|
||||
"spec": {
|
||||
"description": "Enable folder's api server counts",
|
||||
"stage": "experimental",
|
||||
"codeowner": "@grafana/search-and-storage",
|
||||
"expression": "false"
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "folderMove",
|
||||
"resourceVersion": "1734702013658",
|
||||
"creationTimestamp": "2024-12-20T13:40:13Z",
|
||||
"deletionTimestamp": "2024-12-27T10:19:54Z"
|
||||
},
|
||||
"spec": {
|
||||
"description": "Enable folder's api server move",
|
||||
"stage": "experimental",
|
||||
"codeowner": "@grafana/search-and-storage",
|
||||
"expression": "false"
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "formatString",
|
||||
@ -1886,6 +1914,32 @@
|
||||
"hideFromDocs": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "k8SFolderCounts",
|
||||
"resourceVersion": "1735294794086",
|
||||
"creationTimestamp": "2024-12-27T10:19:54Z"
|
||||
},
|
||||
"spec": {
|
||||
"description": "Enable folder's api server counts",
|
||||
"stage": "experimental",
|
||||
"codeowner": "@grafana/search-and-storage",
|
||||
"expression": "false"
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "k8SFolderMove",
|
||||
"resourceVersion": "1735294794086",
|
||||
"creationTimestamp": "2024-12-27T10:19:54Z"
|
||||
},
|
||||
"spec": {
|
||||
"description": "Enable folder's api server move",
|
||||
"stage": "experimental",
|
||||
"codeowner": "@grafana/search-and-storage",
|
||||
"expression": "false"
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "kubernetesAggregator",
|
||||
|
Loading…
Reference in New Issue
Block a user