Skip to content

Folders: Migrate getFolder API to app platform #107617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4ea5a35
Add /children endpoint
aocenas Jun 18, 2025
fe84c8c
Update folder client
aocenas Jun 19, 2025
a9c2f4c
Add comment
aocenas Jun 19, 2025
d867638
Add feature toggle
aocenas Jun 20, 2025
187e977
Add new version of useFoldersQuery
aocenas Jun 20, 2025
db5b914
Merge branch 'main' into aocenas/folders/migrate-api
Clarity-89 Jun 26, 2025
c70aaff
Error handling
Clarity-89 Jun 26, 2025
8e8ad40
Format
Clarity-89 Jun 26, 2025
2a00788
Rename feature toggle
aocenas Jul 1, 2025
c7f3908
Remove options and move root folder constant
aocenas Jul 1, 2025
eed14cd
Merge remote-tracking branch 'origin/aocenas/folders/migrate-api' int…
aocenas Jul 1, 2025
34bc654
Fix feature toggle merge
aocenas Jul 1, 2025
48af59b
Merge branch 'main' into aocenas/folders/migrate-api
aocenas Jul 1, 2025
d1d959d
Add feature toggle again
aocenas Jul 1, 2025
421958b
Rename useFoldersQuery files
aocenas Jul 1, 2025
d529ed1
Update API spec
aocenas Jul 1, 2025
ea906e8
Fix test
aocenas Jul 1, 2025
634cd2a
Add test
aocenas Jul 2, 2025
b86b98d
Migrate delete folder button
aocenas Jul 3, 2025
845bbe6
useGetFolderQueryFacade
aocenas Jul 3, 2025
a873b99
Merge branch 'main' into aocenas/folders/migrate-api-2
aocenas Jul 3, 2025
e7b4f3e
Use getFolder facade hook
aocenas Jul 4, 2025
06f0baa
Recreate legacy getFolder from the APIs
aocenas Jul 9, 2025
802fa46
Merge branch 'main' into aocenas/folders/migrate-api-2
aocenas Jul 9, 2025
7b30613
Fix imports
aocenas Jul 9, 2025
bd65f06
Add comment
aocenas Jul 9, 2025
2f5b2c9
Merge branch 'main' into aocenas/folders/migrate-api-2
Clarity-89 Jul 10, 2025
c8423b4
Rename function
aocenas Jul 10, 2025
dc229e0
Simulate virtual folders in the API client
aocenas Jul 14, 2025
320f469
Translations
aocenas Jul 14, 2025
7c6dbdd
Merge branch 'main' into aocenas/folders/migrate-api-2
aocenas Jul 14, 2025
9ba694d
Update test
aocenas Jul 14, 2025
18b12c7
Move the hook out of the index file
aocenas Jul 15, 2025
8fdb275
Fix undefined in test
aocenas Jul 16, 2025
24e5b2b
Better status combining
aocenas Jul 16, 2025
152612b
Merge branch 'main' into aocenas/folders/migrate-api-2
aocenas Jul 17, 2025
c8b3dd7
Use real access api for virtual folders
aocenas Jul 18, 2025
641c091
Add basic test for the hook
aocenas Jul 18, 2025
d715ddb
Remove commented import
aocenas Jul 21, 2025
d1b2fb9
Merge branch 'main' into aocenas/folders/migrate-api-2
aocenas Jul 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename feature toggle
  • Loading branch information
aocenas committed Jul 1, 2025
commit 2a00788a308dce2f663d4e7a1c5ba5725d6c8967
4 changes: 2 additions & 2 deletions packages/grafana-data/src/types/featureToggles.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1026,8 +1026,8 @@ export interface FeatureToggles {
*/
alertingImportAlertmanagerAPI?: boolean;
/**
* Enables new API for folders
* Enables use of app platform API for folders
* @default false
*/
foldersNewApi?: boolean;
foldersAppPlatformAPI?: boolean;
}
4 changes: 2 additions & 2 deletions pkg/services/featuremgmt/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -1765,8 +1765,8 @@ var (
Expression: "false",
},
{
Name: "foldersNewApi",
Description: "Enables new API for folders",
Name: "foldersAppPlatformAPI",
Description: "Enables use of app platform API for folders",
Stage: FeatureStageExperimental,
Owner: grafanaFrontendSearchNavOrganise,
HideFromAdminPage: true,
Expand Down
2 changes: 1 addition & 1 deletion pkg/services/featuremgmt/toggles_gen.csv
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,4 @@ restoreDashboards,experimental,@grafana/grafana-frontend-platform,false,false,fa
skipTokenRotationIfRecent,privatePreview,@grafana/identity-access-team,false,false,false
alertEnrichment,experimental,@grafana/alerting-squad,false,false,false
alertingImportAlertmanagerAPI,experimental,@grafana/alerting-squad,false,false,false
foldersNewApi,experimental,@grafana/grafana-search-navigate-organise,false,false,true
foldersAppPlatformAPI,experimental,@grafana/grafana-search-navigate-organise,false,false,true
6 changes: 3 additions & 3 deletions pkg/services/featuremgmt/toggles_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ const (
// Enables the API to import Alertmanager configuration
FlagAlertingImportAlertmanagerAPI = "alertingImportAlertmanagerAPI"

// FlagFoldersNewApi
// Enables new API for folders
FlagFoldersNewApi = "foldersNewApi"
// FlagFoldersAppPlatformAPI
// Enables use of app platform API for folders
FlagFoldersAppPlatformAPI = "foldersAppPlatformAPI"
)
19 changes: 18 additions & 1 deletion pkg/services/featuremgmt/toggles_gen.json
Original file line number Diff line number Diff line change
Expand Up @@ -1391,11 +1391,28 @@
"hideFromDocs": true
}
},
{
"metadata": {
"name": "foldersAppPlatformAPI",
"resourceVersion": "1751375289151",
"creationTimestamp": "2025-07-01T13:08:09Z"
},
"spec": {
"description": "Enables use of app platform API for folders",
"stage": "experimental",
"codeowner": "@grafana/grafana-search-navigate-organise",
"frontend": true,
"hideFromAdminPage": true,
"hideFromDocs": true,
"expression": "false"
}
},
{
"metadata": {
"name": "foldersNewApi",
"resourceVersion": "1750425724072",
"creationTimestamp": "2025-06-20T13:22:04Z"
"creationTimestamp": "2025-06-20T13:22:04Z",
"deletionTimestamp": "2025-07-01T13:08:09Z"
},
"spec": {
"description": "Enables new API for folders",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export function useFoldersQuery(

// Running the hooks themselves don't have any side effects, so we can just conditionally use one or the other
// requestNextPage function from the result
return config.featureToggles.foldersNewApi ? resultv2 : resultv1;
return config.featureToggles.foldersAppPlatformAPI ? resultv2 : resultv1;
}