52 Commits

Author SHA1 Message Date
761150fcb8 fix: enable dashboard api k8s list tests (#106508)
* fix: separate dashboard api tests

* fix: typo

* refactor: revert file rename

* fix: compilable

* fix: trial

* fix: remove unused func

* Pass the right value for kubernetesDashboardsEnabled flag

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

* Enable mode 3 for remaining tests

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

* Disable integration tests for MySQL and Postgres

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

* Run go work use

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

* Update go.mod

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

* Remove TODO comment

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

* Revert to go 1.24.5

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

* go.mod

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

* Remove duplicated block

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

* Experiment without reusing client

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

* Reenable integration tests on Postgres and MySQL

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

* Revert "Experiment without reusing client"

This reverts commit 0126e321a08dbafc482a623f2593edaf5561ed32.

* Reapply "Experiment without reusing client"

This reverts commit 5368b4c5318f78aef9b1a5c310846f3f5569fe78.

* Refactor how we get an adminClient

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

* Add TODO comments

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

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: Maicon Costa <maiconscosta@gmail.com>
2025-07-25 09:46:02 +02:00
d72a70d246 Dashboards API: v2alpha2 missing pieces (#108293)
* Dashboards API: v2alpha2 missing pieces

* Fix issue with dashboard client scope for alpha versions

As we now have 2 different alpha versions for v2 we need to store the
clients separately.

* Improve debuggability of provisioning export test

- Add a helper function to print the tree structure.
- Be explicit about the expected file names expected in each case.

* Update pkg/registry/apis/dashboard/mutate.go

* Update pkg/services/authz/zanzana/server/server.go

Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com>

* Review

* go lint

---------

Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
Co-authored-by: Igor Suleymanov <radiohead@users.noreply.github.com>
2025-07-22 11:44:05 +02:00
b017f42278 Unistore: Fix dualwriter mode 3 (#108092)
* Unistore: Fix dualwriter mode 3

Fallback to legacy if Unified is the main store and we get an error when
reading from it

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


---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2025-07-15 11:16:26 -03:00
2e568ef672 test: reenable dashboard integration tests and restructure based on dual writer modes (#107941) 2025-07-10 13:52:58 +02:00
d7f7a19c56 Dashboard permissions: Update integration tests to take into account kubernetesDashboards flag value (#107706)
Dashboard permissions: Update integration tests to take into account  flag value
2025-07-09 08:46:27 +02:00
b1d3155b60 K8s: Library Panels: Add rerouting for get (#107362) 2025-06-30 13:26:24 -05:00
63bc65fa4c Dashboards: Fix history list for dashboard uids that end in - (#107073) 2025-06-22 06:56:45 -06:00
0b7e2f5601 K8s/Dashboards: Add mode 1, 2 to dashboard TestIntegrationValidation (#107018)
* Add mode 1 to dashboard TestIntegrationValidation
* Reject update with version conflict also in mode 1
* Add integration testing for mode 2
2025-06-20 13:11:26 +02:00
feeced9618 K8s: Dashboards /apis: Fix library element connections (#106734) 2025-06-13 21:40:39 +02:00
129e8bb1e4 Dashboards: Fix moving to general folder (#104655) 2025-04-30 03:03:57 +03:00
b09d79b21c K8s/Dashboard: Promote from alpha1 to beta1 (#104009) 2025-04-23 20:54:35 +03:00
ee4d59b547 Linter: fix conflict (#104370)
Linter: fix enterprise conflict
2025-04-23 07:00:32 +01:00
b887e8aa05 K8s: Dashboards: Add fine grained access control checks to /apis (#104347)
---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
Co-authored-by: Gabriel MABILLE <gabriel.mabille@grafana.com>
Co-authored-by: Marco de Abreu <marco.deabreu@grafana.com>
Co-authored-by: Georges Chaudy <chaudyg@gmail.com>
2025-04-23 03:29:05 +01:00
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
0283c98e30 K8s/Folders: Use v1beta1 and app-sdk based spec (#103975) 2025-04-14 23:20:10 +03:00
c47ab101d1 Dashboards: Add Dashboard Schema validation (2) (#103844)
* Activate schema validation and align underlying systems

* update to save as v0 if not the right schema version

* Resolve merge conflicts

* Move RequireApiErrorStatus to tests package

* Add mutation tests

* Fix lint

* Only do min version check if dashboard is v1

* Fix lint and disable provisioning test

* Revert provisioning changes

* Revert more tests and add schema test

* Reran gen

* SQL Dashboard save

* Adjust APIVERSION

* Fixed mutation test

* Add logging on downgrade

---------

Co-authored-by: Marco de Abreu <18629099+marcoabreu@users.noreply.github.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-04-11 23:05:41 +02:00
bba85c1128 K8s: Dashboards: Fix error handling (#103929) 2025-04-11 13:31:41 -06:00
95f04c79cd Dashboards: Add Dashboard Schema validation (1) (#103662) 2025-04-11 16:52:46 +00:00
f5ad1ef69b K8s: Folders: Add v1 api (#103842) 2025-04-11 13:09:52 +01:00
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
0c79a8927b Dashboards: Add validation tests for all dual writer modes (#103570)
* Add validation tests for mode 0 and 4

* Add mode 1, 2, 3, 5

---------

Co-authored-by: Marco de Abreu <18629099+marcoabreu@users.noreply.github.com>
2025-04-08 14:37:50 +02:00
c8c55621fb Dashboards: Fix dashboard UID inconsistency between creation and retrieval in legacy storage (#103568) 2025-04-08 12:25:32 +02:00
8cd6f837a5 Dashboards: Prevent saving to a non-existent folder (#103503) 2025-04-07 09:02:20 +03:00
b2f80d4dca Dashboards: Add Dashboard API Validation tests and fix underlying issues (#103502) 2025-04-07 05:44:28 +03:00
bb881f38bb K8s/Dashboards: Remove uid+version from spec (#101992) 2025-03-16 20:46:12 -05:00
5d2ba10113 K8s/Dashboards: Extract Dashboard APIs to an app submodule (#102029)
* Move dashboard k8s APIs to a separate app

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

* Copy dashboard code in Dockerfile

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

* Fix conversion generation

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

* Update OpenAPI snapshot for dashboard/v0alpha1

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

---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
2025-03-13 11:05:01 +02:00
ea89a68028 K8s/Dashboards: Generate Dashboards k8s APIs using Grafana App SDK (#99966)
* Generate Dashboard kinds with `grafana-app-sdk`

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

* Hack together a fix for invalid TS codegen for v0 & v1

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

* Address Go linter issues

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

* Address TS linter issues

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

* Add new app to CODEOWNERS

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

* Fix a couple of issues detected by tests

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

* Update OpenAPI definitions and test files

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

* Remove title from Dashboard v1alpha1 spec

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

* Remove unused CUE schemas

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

* remove unrelated files

* allow any in the generated betterer

* Add a comment explaining why we don't use deepcopy-gen

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

* Default to v2alpha1 if dashboards v2 FF is enabled

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

---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-03-11 13:00:37 +02:00
bd0c645ff0 K8s: Schema v2: Return 406 in /api (#101842) 2025-03-07 18:20:02 -06:00
dc2defd84f K8s/Annotations: Use manager/source annotations rather than repo (#101313)
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-03-05 08:54:20 +02:00
c1b48cc488 Dashboards: Add apiVersion to dashboard table (#100845) 2025-03-04 07:47:45 +03:00
69e4d8468b Dashboard: Add v1alpha1 test coverage (#100149) 2025-02-05 23:01:51 +02:00
7c04247d6f K8s/Dashboard: Set generation from version (#99142) 2025-01-17 13:52:01 +02:00
5ed2a4c624 K8s: Dashboards: Add deletion validation for provisioned dashboards (#98504) 2025-01-08 06:58:21 -06:00
1a46039037 K8s/Dashboards: Pass the legacy internal ID into labels (#98311)
---------

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
2024-12-20 21:33:49 +02:00
b05d60e5b5 k8s: dashboards: remove FT (#97758) 2024-12-10 12:35:36 -06:00
94262fd095 Search: expose search on dashboard apiserver (v0alpha1) (#96907) 2024-11-22 22:26:56 +02:00
29cdfdff87 Storage: Revert using real gRPC for integration tests (#96410)
---------

Co-authored-by: Todd Treece <todd.treece@grafana.com>
2024-11-15 16:50:49 -05:00
66d5c051aa Dashboards: Add v1alpha1 and v2alpha1 conversion (#96415)
---------

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2024-11-15 15:49:45 -05:00
4e1f0dadbd UnifiedStorage: Default to running unified-grpc in integration tests (#93492) 2024-10-31 16:29:32 +03:00
644a16048f K8s: add feature toggle for dashboard backend (#94753) 2024-10-15 14:30:05 -05:00
542105b680 ResourceClient: Exercise resource client in k8s apis tests (#93473) 2024-09-19 17:16:48 +03:00
8d2b8378ed Remove UID on update in dual writer mode 2 (#93032)
* Remove UID on update in dual writer mode 2

* WIP: add dashboard tests

* Add more crud tests for dashboards in each mode

* trigger build

* Fix test
2024-09-10 11:57:28 +02:00
419edef4dc LibraryPanels: Expose library panels in dashboard apiserver (#92213) 2024-08-27 12:12:22 +03:00
9e116d13a5 K8s/Dashboards: Fix dashboard list and add tests (#91523) 2024-08-07 13:43:13 +03:00
f409f8c169 K8s/Dashboards: Implement dashboards as StorageBackend (#90295) 2024-07-17 10:49:23 -07:00
3db4e5a0c6 K8s: remove dashboard summary abstraction (#89761) 2024-06-26 15:00:24 +03:00
4651506319 K8s/Dashboards: Replace multiple calls with a single endpoint (#89639) 2024-06-26 07:27:52 +03:00
ee2f6a7b49 Force interface implementation also on legacy storage (#87414)
* Force interface implementation also on legacy storage

* Add DeleteCollection to folders and dashboards

* Fix integration tests

* Fix tests
2024-05-07 15:02:30 +02:00
d7bcd119c3 K8s: improve openapi generation (#83796) 2024-03-02 00:26:04 +02:00
74115f1f08 Chore: fix apiserver integration tests (#83724)
Co-authored-by: Todd Treece <todd.treece@grafana.com>
2024-02-29 14:58:49 -08:00