mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 02:52:16 +08: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:
@ -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 |
|
| `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 |
|
| `unifiedHistory` | Displays the navigation history so the user can navigate back to previous pages |
|
||||||
| `investigationsBackend` | Enable the investigations backend API |
|
| `investigationsBackend` | Enable the investigations backend API |
|
||||||
|
| `k8SFolderCounts` | Enable folder's api server counts |
|
||||||
|
| `k8SFolderMove` | Enable folder's api server move |
|
||||||
|
|
||||||
## Development feature toggles
|
## Development feature toggles
|
||||||
|
|
||||||
|
@ -248,4 +248,6 @@ export interface FeatureToggles {
|
|||||||
unifiedHistory?: boolean;
|
unifiedHistory?: boolean;
|
||||||
lokiLabelNamesQueryApi?: boolean;
|
lokiLabelNamesQueryApi?: boolean;
|
||||||
investigationsBackend?: boolean;
|
investigationsBackend?: boolean;
|
||||||
|
k8SFolderCounts?: boolean;
|
||||||
|
k8SFolderMove?: boolean;
|
||||||
}
|
}
|
||||||
|
@ -63,8 +63,16 @@ func (hs *HTTPServer) registerFolderAPI(apiRoute routing.RouteRegister, authoriz
|
|||||||
folderUidRoute.Put("/", handler.updateFolder)
|
folderUidRoute.Put("/", handler.updateFolder)
|
||||||
folderUidRoute.Delete("/", handler.deleteFolder)
|
folderUidRoute.Delete("/", handler.deleteFolder)
|
||||||
folderUidRoute.Get("/", handler.getFolder)
|
folderUidRoute.Get("/", handler.getFolder)
|
||||||
folderUidRoute.Get("/counts", handler.countFolderContent)
|
if hs.Features.IsEnabledGlobally(featuremgmt.FlagK8SFolderCounts) {
|
||||||
folderUidRoute.Post("/move", handler.moveFolder)
|
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 {
|
} else {
|
||||||
folderRoute.Post("/", authorize(accesscontrol.EvalPermission(dashboards.ActionFoldersCreate)), routing.Wrap(hs.CreateFolder))
|
folderRoute.Post("/", authorize(accesscontrol.EvalPermission(dashboards.ActionFoldersCreate)), routing.Wrap(hs.CreateFolder))
|
||||||
|
@ -1719,6 +1719,20 @@ var (
|
|||||||
Owner: grafanaAppPlatformSquad,
|
Owner: grafanaAppPlatformSquad,
|
||||||
Expression: "false",
|
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
|
unifiedHistory,experimental,@grafana/grafana-frontend-platform,false,false,true
|
||||||
lokiLabelNamesQueryApi,GA,@grafana/observability-logs,false,false,false
|
lokiLabelNamesQueryApi,GA,@grafana/observability-logs,false,false,false
|
||||||
investigationsBackend,experimental,@grafana/grafana-app-platform-squad,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
|
// FlagInvestigationsBackend
|
||||||
// Enable the investigations backend API
|
// Enable the investigations backend API
|
||||||
FlagInvestigationsBackend = "investigationsBackend"
|
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
|
"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": {
|
"metadata": {
|
||||||
"name": "formatString",
|
"name": "formatString",
|
||||||
@ -1886,6 +1914,32 @@
|
|||||||
"hideFromDocs": true
|
"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": {
|
"metadata": {
|
||||||
"name": "kubernetesAggregator",
|
"name": "kubernetesAggregator",
|
||||||
|
Reference in New Issue
Block a user