Commit Graph

266 Commits

Author SHA1 Message Date
Igor Suleymanov a07a8d0ba2 Fix listing and getting dashboard versions across different API versions (#109860)
* Fix listing and getting dashboard versions across different API versions

What

This commit updates dashboard version service to use API version aware
API client. The service now also supports parsing different API version
representation of dashboards.

The API version aware client is also updated to support listing across
versions.

Why

Currently listing or getting specific versions is broken for all v2
versions of the dashboard API, especially if the dashboard being checked
is still saved using v1 APIs.

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

* Remove superfluous tracing spans

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>

---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
2025-09-03 13:51:11 +03:00
Stephanie Hingtgen 6b86277ecf Nested folders: Remove feature flag (#109212) 2025-08-06 10:07:23 +03:00
Stephanie Hingtgen 34019e5ec0 Library Panels: Remove k8s connections feature flag (#108881) 2025-07-30 16:46:19 +00:00
Stephanie Hingtgen 1f025fe1a3 K8s: Remove kubernetesClientDashboardsFolders feature flag (#108626) 2025-07-29 16:52:57 -05:00
Stephanie Hingtgen fe906dfc1e Dashboards: Move to integration tests (#108734) 2025-07-29 09:52:27 +02:00
Serge Zaitsev a95fb3a37c Chore: Omit integration tests if short test flag is passed (#108777)
* omit integration tests if short test flag is passed

* Update pkg/services/ngalert/models/receivers_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/services/ngalert/models/receivers_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/cmd/grafana-cli/commands/datamigrations/to_unified_storage_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/services/ngalert/models/receivers_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* fix the rest

* false positive

---------

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-07-28 13:38:54 +02:00
Stephanie Hingtgen 5ec3a2b758 K8s: Library panels: move to separate ff (#108384) 2025-07-21 12:53:46 +00:00
maicon 2dba473015 Feature/unified storage search dual reader (#108291)
* Add UnifiedStorageSearchDualReaderEnabled feature flag

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

* Refactor UniSearch Dual Reader

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

* Run make gen-feature-toggles

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

* fix: unit tests search_client

Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>

* feat: cancels shadow search requests after 500ms

Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Signed-off-by: Bruno Abrantes <bruno@brunoabrantes.com>
Co-authored-by: Will Assis <william@williamassis.com>
Co-authored-by: Bruno Abrantes <bruno@brunoabrantes.com>
2025-07-18 14:43:56 +02:00
Serge Zaitsev f66a693438 Chore: Rename integration tests to follow the common convention (#105987)
* automatically rename integration tests to follow the common convention

* name tests differently

* alter column type to bigint

* update another column to bigint

* add another alter

* fix subquery for mysql
2025-06-29 16:56:24 +02:00
Stephanie Hingtgen 79fe8a9902 Library Panels: Modify connection api endpoint to be compatible with unified storage (#107088) 2025-06-25 22:21:56 +00:00
Stephanie Hingtgen ab99211b40 Dashboard Provisioning: Reduce db load (#106114) 2025-05-29 09:39:07 +03:00
Stephanie Hingtgen 5c0194955e Dashboards: Fix FindDashboards when kubernetesClientDashboardsFolders is disabled (#105974)
Dashboards: fix legacy FindDashboards
2025-05-24 07:06:30 -06:00
Michael Mandrus 6205e126cc CloudMigrations: Fix issues with snapshot resource limits (#105425)
* fix bulk inserts

* commit progress so cursor doesn't sabotage me

* add more tests

* get everything working

* rename variable

* update comment

* regen mocks, fix k8s list method maybe

* fix bug with duplicate entries

* lint

* Snapshots: Use slices.Chunk for batching inserts

* remove extra linebreak

---------

Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
2025-05-19 11:37:22 -04:00
Jean-Philippe Quéméner 002f46736a refactor(unified-storage): move generated protos to own pkg (#105356) 2025-05-15 21:36:52 +02:00
Ryan McKinley da24ad06bd Provisioning: Hide full path for classic provisioing resources (#105440) 2025-05-15 16:01:12 +00:00
Stephanie Hingtgen 6244b4d501 Dashboards: Fix cleanup job (#104822) 2025-05-01 17:27:13 +03:00
Stephanie Hingtgen 7430a18bd3 Dashboards: Fix missing folder info in /search for dashboards (#104666)
Dashboards: add missing folder info to /search
2025-04-30 05:23:52 +03:00
Stephanie Hingtgen 9968576acf Folders & Dashboards: Cleanup timestamps and error codes (#104665)
K8s: Fix timestamps and error codes
2025-04-30 03:03:21 +03:00
Todd Treece 24caaa7442 Dashboards: Set provisioning concurrency limit (#104507) 2025-04-25 12:43:29 -04:00
Stephanie Hingtgen 72ea92f275 Provisioning: Remove warnings for valid usage (#104555) 2025-04-25 16:50:47 +01:00
Stephanie Hingtgen b5281c923f K8s: Dashboards: Fix provisioned dashboard cleanup (#104504) 2025-04-25 05:55:50 -06:00
Ieva e385237daf Access control: Make sure that user permission cache is cleared after new dashboard and folder creation (#104193)
* make sure that user permission cache is cleared after new dashboard and folder creation

* more test fixes

* Update pkg/services/dashboards/service/dashboard_service.go

* check identity type in SetDefaultPermissionsAfterCreate, set default permissions for service accounts

* set SA permissions for folders as well

* fix tests
2025-04-24 16:02:39 +03:00
Ryan McKinley b09d79b21c K8s/Dashboard: Promote from alpha1 to beta1 (#104009) 2025-04-23 20:54:35 +03:00
Artur Wierzbicki fd99b67205 Dashboards: Preserve schema version in /api (#104213)
---------

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-04-21 10:51:28 -05:00
Marco de Abreu 2a61763703 Dashboards: Don't run cleanup job when backed by legacy storage (#104001)
Don't run dashboard cleanup job when backed by legacy storage

Co-authored-by: Marco de Abreu <18629099+marcoabreu@users.noreply.github.com>
2025-04-15 13:43:05 -07:00
Ryan McKinley 0283c98e30 K8s/Folders: Use v1beta1 and app-sdk based spec (#103975) 2025-04-14 23:20:10 +03:00
Marco de Abreu 95f04c79cd Dashboards: Add Dashboard Schema validation (1) (#103662) 2025-04-11 16:52:46 +00:00
Stephanie Hingtgen f5ad1ef69b K8s: Folders: Add v1 api (#103842) 2025-04-11 13:09:52 +01:00
Mariell Hoversholm 757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02:00
Ryan McKinley af8a70bbab K8s/Permissions: Enable a grant-permissions annotation action to set default permissions (#102527)
* create permissions

* add key

* lint

* structure as a delayed callback

* legacy API hook

* merge main

* wired up

* and folders

* watch repos

* missing return statement

* Set the correct permissions

* add TestAfterCreatePermissionCreator

* do not add perms on folder create

* fix tests

* add annotation on create

* lint

* lint

* ensure we set permissions when the FT is disabled

* remove custom folder_storage

* fix lint

* change default

* lint

* lint

* fix: annotation

* ensure permissions are added on folder legacy

* remove folderstorage again

* fix tests

* add FT

* undo change to folder

* dashboard on create

* remove annotation for folder

* fix tests

* fix prepare after rebase

* fix tests

* fix tests

* fix tests

* lint

* address comments

* add test for prepareObjectForStorage

* add again skipIfMode as per comment

---------

Co-authored-by: Georges Chaudy <chaudyg@gmail.com>
2025-04-09 13:05:37 +02:00
Marco de Abreu b2f80d4dca Dashboards: Add Dashboard API Validation tests and fix underlying issues (#103502) 2025-04-07 05:44:28 +03:00
Todd Treece 427715b070 Dashboards: Add k8s fallback client (#103404) 2025-04-06 16:38:06 -04:00
Stephanie Hingtgen 4918d8720c Dashboard Restore: Remove experimental functionality under feature flag dashboardRestore for now - this will be reworked (#103204) 2025-04-03 02:52:54 -05:00
Ryan McKinley c54496a3f9 Search: Avoid panic with missing title (#103257) 2025-04-02 15:43:08 +03:00
Will Assis 08042ae827 search: add legacy id for all resources in bleve (#103206)
* add legacy id for all resources in bleve
2025-04-02 08:20:23 -04:00
Will Assis 15c5b45724 dashboards: remove unused function from dashboard service (#103104)
remove unused function from dashboard service
2025-03-31 13:54:38 -04:00
Stephanie Hingtgen 19a52ba35e K8s: Dashboards: Fix multi-org quota (#103073) 2025-03-31 14:34:39 +01:00
Hugo Häggmark 18ae5d7f0c i18n: wires up translations for plugins (#102853)
* i18n: consolidate i18n types & runtime services

* Chore: updates after PR feedback

* Chore: updates after feedback

* Chore: updates after feedback

* Chore: adds feature toggle

* Chore: adds locale to backend

* Chore: adds locales to i18n instance

* Chore: fix missing path in CODEOWNERS

* Chore: fix go lint issues

* Chore: fix missing path in CODEOWNERS

* Chore: updates after PR feedback

* Trigger build

* Chore: updates after PR feedback

* Chore: use resolved language for lookup

* Chore: updates after PR feedback

* Update pkg/plugins/plugins.go

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>

* Chore: updates after PR feedback

* Chore: updates after PR feedback

---------

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2025-03-31 06:38:38 +02:00
Stephanie Hingtgen f84654d162 Stats: Optimize getting folder stats (#103033) 2025-03-28 20:17:50 -05:00
Stephanie Hingtgen 12c5b81850 K8s: Dashboards: Reduce db calls to get users on list (#103020) 2025-03-27 22:57:49 +02:00
Stephanie Hingtgen da2743dbef Dashboards: Optimize get shared with me (#103013) 2025-03-27 19:52:31 +02:00
Mariell Hoversholm d0d7078953 App Platform: Remove mutable globals (#102962)
* App Platform: Remove mutable globals

* chore: clarify why this exists

* fix: support multi-tenant mode

* refactor: call builder providers directly

* CI: Force re-build
2025-03-27 15:46:09 +01:00
Stephanie Hingtgen 7c2890384a K8s: Dashboards: Set v1alpha1 as priority (#102729) 2025-03-25 10:32:49 -06:00
Marco de Abreu 543c0bbccb App platform: Add cleanup job for dashboards when going through /apis (kubectl) (#102506)
* Add dashboard cleanup job

Change log message

Adjust logic to account for new head RV logic

Don't update lastResourceVersion due to pagination

Save improvements

* Address review feedback

* Update docs.

* Remove docs

* Rename config

---------

Co-authored-by: Marco de Abreu <18629099+marcoabreu@users.noreply.github.com>
2025-03-22 23:47:27 +01:00
Stephanie Hingtgen c33a53a47a K8s: Remove restore functionality; can be done with list (#102560) 2025-03-20 16:38:32 -05:00
Ryan McKinley b3a529de48 K8s/Dashboard: Use upsert to create or update dashboards (#102536) 2025-03-20 22:50:04 +03:00
Ieva 163546d40f RBAC: Remove dashboard guardians pt 1 (#102314)
* replace the usage of dashboard guardians with calling AC evaluators or checking access in middleware

* linting fixes

* fix test

* more test fixes

* remove a todo comment
2025-03-20 17:38:09 +00:00
Stephanie Hingtgen 6c704484e9 K8s: Add sorting by more than titles (#102403) 2025-03-18 20:23:43 -05:00
owensmallwood ec91ad6db7 Dashboard Provisioning: Dont wait on indexer when nothing deleted (#102390)
* adds debug log

* show dashboard uids as strings

* adds debug log

* don't wait when no deleted dashboards

* adds test
2025-03-18 17:36:10 -06:00
owensmallwood c45a342303 Unified Storage Dashboard Provisioning: Wait for deleted dashboards to be updated in the indexer (#102243)
* wait for deleted dashboards to be updated in the indexer

* updates comment

* adds test

* make function private

* fix failing test - had to add a couple more mock Search calls
2025-03-17 16:46:26 -06:00