Filewalkwithme/unistore refactor folder service to hit folder apiserver (#98409)

Refactor folder service to use Unified Storage

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
This commit is contained in:
maicon
2025-01-13 18:15:35 -03:00
committed by GitHub
co-authored by Stephanie Hingtgen
parent 009d7f42b3
commit 766d645d82
38 changed files with 1900 additions and 73 deletions
-12
View File
@@ -925,7 +925,6 @@ func TestFoldersCreateAPIEndpointK8S(t *testing.T) {
}
folderWithoutParentInput := "{ \"uid\": \"uid\", \"title\": \"Folder\"}"
folderWithoutUID := "{ \"title\": \"Folder without UID\"}"
folderWithTitleEmpty := "{ \"title\": \"\"}"
folderWithInvalidUid := "{ \"uid\": \"::::::::::::\", \"title\": \"Another folder\"}"
folderWithUIDTooLong := "{ \"uid\": \"asdfghjklqwertyuiopzxcvbnmasdfghjklqwertyuiopzxcvbnmasdfghjklqwertyuiopzxcvbnm\", \"title\": \"Third folder\"}"
@@ -964,17 +963,6 @@ func TestFoldersCreateAPIEndpointK8S(t *testing.T) {
expectedMessage: dashboards.ErrFolderAccessDenied.Error(),
permissions: []resourcepermissions.SetResourcePermissionCommand{},
},
{
// #TODO This test case doesn't set up the conditions it describes. We should have created a folder with the same UID before
// creating a second one and failing to do so successfully.
description: "folder creation fails given folder service error %s",
input: folderWithoutUID,
expectedCode: http.StatusConflict,
// expectedMessage: dashboards.ErrFolderWithSameUIDExists.Error(),
expectedFolderSvcError: dashboards.ErrFolderWithSameUIDExists,
createSecondRecord: true,
permissions: folderCreatePermission,
},
{
description: "folder creation fails given folder service error %s",
input: folderWithTitleEmpty,