-
Notifications
You must be signed in to change notification settings - Fork 34
support nested dashboard-folders for backup-download #287
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
Conversation
internal/service/dashboards.go
Outdated
| searchParams.Limit = tools.PtrOf(limit) | ||
| searchParams.Page = tools.PtrOf(page) | ||
| searchParams.Type = tools.PtrOf(searchTypeDashboard) | ||
| if allTypes == false { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor, but if !allTypes {}
internal/service/dashboards.go
Outdated
| } | ||
| validUid = filterReq.GetFilter(filters.DashFilter) == "" || link.Slug == filterReq.GetFilter(filters.DashFilter) | ||
| if link.FolderID == 0 { | ||
| if link.FolderID == 0 && link.Type == "dash-db" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
common.go has a constant for dash-db, use the const searchTypeDashboard
| @@ -0,0 +1,71 @@ | |||
| package service | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently, all the integration tests are under test, unless you have some package level see if you can just add this to the current test. dashboard_integration_test.go
|
First of all, thank you for the PR, that's always appreciated. I have looked at nested folder when they first were released as a beta feature and it felt very broken still at the time, and ended up closing that out till someone asked for the feature. (Which I suppose you're asking.) A few questions.
Let me take a closer look at the MR, and see how it works a bit closer. I'll try to suggest something that should work for all use cases. |
|
Please link: #171 to your PR as well. |
…Config ...and some minor code-cleanup
|
There's a few things I'd like to add to this, I'm going to pick up on your changes and take it the last hurdle so it lines up a bit better. I also wanted to get integration tests written for the cloud and basic CRUD that uses nested folders. Once I have this cleaned up, I'll ping you on a final pass if you wanted to double check it satisfies your use case. From what I can tell you mainly wanted the ability to fetch nested folders and respect those deeper paths. |
|
Sorry for the late response - was on vacation.
Cool. Thanks for the effort :-)
Yes, that's right. |
|
@Iridias somewhat. Once you enable that flag it affects the inherent behavior of Dashboard CRUD, Folder CRUD and Folder Permissions as well. So it's a bigger change to introduce it. It's still a WIP but I have the rough Impl done just need some clean up and testing and likely removing some duplicate logic that can be consolidated. |
Our use-case:
We use gdg only as a backup-tool (no restore).
The issue:
A while ago, Grafana introduced the feature of nested sub-folders for dashboards.
So far gdg would download those folders, but all on the same level. This has (at least) two major problems:
What changed:
dash-folder) in theListDashboards-searchDownloadDashboardsfunctionality (if enabled at all)filter_overrides to enable this feature/behaviorKnown Issues: