39 Commits

Author SHA1 Message Date
45dabd2862 ApiServerClient: Avoid special characters in generateName (#107331) 2025-06-27 16:24:13 +00:00
f9fb9d268f Restore dashboards: Add API client endpoints (#106435)
* Dashboards: Add restore endpoints to the API

* Fix unified api

* Fix resource version

* Add tests

* Update api

* Update type guards

* Update comments

* Add missing type

* Cleanup

* Move spec checking logic to v1 client

* Handle mixed versions in deleted dbs list

* Update tests

* comment

* type
2025-06-12 15:49:55 +03:00
15c903fa5c Provisioning: Refactor createOnCacheEntryAdded (#105228)
* Provisioning: Refactor createOnCacheEntryAdded

* Use custom list resource type

* add generated types and transformers

* Switch to type guards

* Do not create new array
2025-05-19 13:23:23 +03:00
da24ad06bd Provisioning: Hide full path for classic provisioing resources (#105440) 2025-05-15 16:01:12 +00:00
242cb8edbd Dashboards: Use string for AnnoKeyDashboardIsSnapshot (#105306) 2025-05-13 10:09:34 +03:00
a9b6d098e9 Chore: Add eslint no-restricted-globals rule (#104519)
* Chore: Add no-restricted-globals eslint rule

* Fix eslint warnings

* Revert some changes

* Update

* Feedback
2025-05-12 12:38:26 +03:00
719b5fe9cc Dashboards: Remove numeric folder id from annotation metadata (#105225) 2025-05-12 10:11:55 +03: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
c1cadc7d6f K8s/Client: Ignore validation from dashboards frontend v1 (#103641) 2025-04-09 11:08:33 +03:00
1a00801e6a Provisioning: Merge watch support into live (#102618) 2025-03-21 16:45:25 +02:00
fd4e08e318 K8s/Dashboards: Remove slug annotation (#102270) 2025-03-17 19:01:29 +02:00
5980c8efbb Dashboards: Show provisioned badge from annotations (#101625) 2025-03-05 20:08:20 +03:00
ff1b22297c Dashboard Schema V2: Delete dashboard (#100929)
* working version wip

* add TODO

* support alert success for k8s
2025-02-19 10:35:00 -07:00
0dab384826 K8s/Frontend: Update watch support (#100631)
use watch from gitsync
2025-02-13 18:55:36 +03:00
f5d8f42635 Dashboard Scene: Fix unnecessary diffing (#100158)
* Fix unnecessary diffing

* use a diferent approach; update legacyId type

* fix test
2025-02-07 10:47:07 -07:00
8f60308e73 Chore: centralise getK8sNamespace (#99767)
* create new public/app/api folder, expose getK8sNamespace

* rename to getAPINamespace
2025-01-29 17:29:16 +00:00
30c8ac7108 Dashboard: Schema V2 - Remove Dashboard id from spec (#99590)
* Dashboard: Schema V2 - Remove Dashboard id from spec

* Fix issue with dashboard id used in examples and serializers for schema v2

* Fix snapshot test
2025-01-29 10:13:56 +01:00
ae62b3817b Dashboards: Change the way dashboard not found error is handled (#98950)
* Get rid of _dashboardLoadFailed

* Get rid of dashboardNotFound meta

* Update public dashboards tests

* Fix DashboardPage tests

* DashboardPageProxy tests

* DashboardScenePageStateManager test fix

* Beterer

* Fix merge

* Nits

* Fix test

* remove debugger

* Update get folder to throw

* translate error title

* Update public/app/features/apiserver/types.ts

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>

* Update public/app/features/dashboard/services/DashboardLoaderSrv.ts

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>

* Update public/app/features/dashboard/services/DashboardLoaderSrv.ts

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>

* Update public/app/features/dashboard/services/DashboardLoaderSrv.ts

Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>

* Betterer

* Update test cases

* More test updates

* More translations

---------

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
2025-01-27 15:54:10 +01:00
8f3fd8f91d Schema v2: Write Path Implement saveDashboard in v2 client API (#98263)
Create new function for save dashboards written in schema v2 and using the v2 api from k8s
2025-01-27 14:14:19 +01:00
8e078315f0 Schema v2: Reason about new dashboard based on UID (#98879)
* Schema v2: Reason about new dashboard based on UID

* Fix test

* Alerting: respect isNew dashboard for legacy and new arch

* Translate untranslated strings

* Unify is new checks

* PanelInspectDrawer update

* typo fix

* on close test for panel inspect drawer

* Update public/app/features/alerting/unified/PanelAlertTabContent.tsx
2025-01-27 11:18:06 +01:00
7c04247d6f K8s/Dashboard: Set generation from version (#99142) 2025-01-17 13:52:01 +02:00
d95484fba6 K8s/Client: Add watch support (#99060)
* add watch client

* add watch client

* add support for selectors

* parse labels

* always send watch

* reuse decoder

* Update public/app/features/apiserver/client.ts

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* Update public/app/features/apiserver/client.ts

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* Update public/app/features/apiserver/client.ts

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

---------

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2025-01-16 17:41:52 +03:00
99e1780527 Revert "Schema v2: Reason about new dashboard based on UID (#98800)" (#98877)
This reverts commit 72846e34313838d31d27bceb314d4f842e6fe78b.
2025-01-13 13:07:45 +01:00
72846e3431 Schema v2: Reason about new dashboard based on UID (#98800)
* Schema v2: Reason about new dashboard based on UID

* Fix test
2025-01-13 12:16:35 +01:00
6b03adbbb0 Dashboard V2: Snapshot variables and read snapshot (#98463)
* Introduce DashboardScenePageStateManagerLike interface

* Implement dash loader for handling v2 api

* Transformation improvements

* Update response transformer test

* v2 schema: Remove defaultOptionEnabled from ds variable schema

* v2 schema: Make annotations filter optional

* WIP render dashboard from v2 schema

* Force dashbaord scene for v2 api

* V2 schema -> scene meta transformation

* v2 api: Handle home dashboard

* Use correct api client in DashboardScenePage

* Correctly use v2 dashboard scene serializer

* Remove unnecesary type assertions

* Handle v2 dashboard not found

* Fix type

* Fix test

* Some more tests fix

* snapshot

* Add dashboard id annotation

* Nits

* Nits

* Rename v2 api

* Enable snapshot variables

* Support getSnapshotUrl() for v2 serializer

* fix

* Make metadata available in the serializer

* Test

* Decouple meta info

* State Manager: Extract snapshot loading into loadSnapshot

* Fix tests

* Add test for snapshot url

* Don't expose dashboardLoaderSrvV2

* Remove TODO

* Bubble up loading snapshot error to error boundary

* Fix test

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2025-01-09 08:14:41 -07:00
322c7d9548 K8s/Typescript: Support generic status for ScopedResourceClient (#98509) 2025-01-07 09:26:00 +03:00
51d9b577d5 DashboardV2: Add support for revision and gnetId in schema and response transformers (#98477) 2025-01-03 13:17:27 +01:00
e974cb87d8 Schema v2: Read API integration (#97953)
* Introduce DashboardScenePageStateManagerLike interface

* Implement dash loader for handling v2 api

* Transformation improvements

* Update response transformer test

* v2 schema: Remove defaultOptionEnabled from ds variable schema

* v2 schema: Make annotations filter optional

* WIP render dashboard from v2 schema

* Force dashbaord scene for v2 api

* V2 schema -> scene meta transformation

* v2 api: Handle home dashboard

* Use correct api client in DashboardScenePage

* Correctly use v2 dashboard scene serializer

* Remove unnecesary type assertions

* Handle v2 dashboard not found

* Fix type

* Fix test

* Some more tests fix

* snapshot

* Add dashboard id annotation

* Nits

* Nits

* Rename v2 api

* Update public/app/features/dashboard-scene/serialization/transformSaveModelSchemaV2ToScene.ts

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>

* add getDashboardsApiVersion test for forcing scenes through URL

* add links to ResponseTransformers

* Update public/app/features/dashboard/api/ResponseTransformers.test.ts

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>

* Nit rename test case

* Add tests for DashboardScenePageStateManagerV2

* Update test

* Typecheck

* Add console error for debugging

* Fix typo

---------

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
2025-01-02 12:23:58 +01:00
bc96da3a95 Schema v2: Express isNew dashboard through client annotations (#98408)
* Schema v2: Express isNew dashboard through client annotations

* Betterer update

* Revert "Betterer update"

This reverts commit e9d1fe3c4edb6c8a1ca89729158d69ccac05f317.
2024-12-31 11:56:42 +01:00
070f0e4457 Dashboard API versions handling (#96666)
* structure apic

* API versioning proposal

* Make api service independent from version

* Update v2

* Fix public dashboards page test

* Uncomment reload dashboard feature code

* Revert

* Betterer

* Fix imports

* useV2DashboardsAPI feature toggle

* POC/v2 schema: Add v1<-> v2 transformers (#97058)

* Make dshboard access interface more precise

* Add first pass for schema v1<->v2 transformers

* Update response transformer test

* Import fixes

* Manage dashboards validation: Handle v2 schema

* Handle new dashboard with v2

* Fix tests

* Move dashboard is folder error handling to legacy API implementation

* Add tests for dashboard api client

* betterer

* Use dashboard DTO when capturing dashbaord impression

* prettier

* Dashboard API: resolve folder metadata

* Add tests for resolving folder metadata

* Fix DashboardPicker

* Renames and nits

* POC Alternative Suggestion for  Dashboard API versions handling (#97789)

* Add transitional_dashboard_api, reset components that are not ready for v2 schema, and start working on migrating
DashboardPicker to use v2 schema

* reset DashboardScenePageStateManager

* Improve logic in transitional api, also remove isDashboardResource checks from components

* REmove transitional_dashboard_api and apply PR feedback

* Apply PR feedback, use 'v2' as a parameter and remove unnecesary if

* Fix tests

* Adding missing comments from original PR and also changing order to improve diffing in github :)

* update betterer

* fix prettier

* Add tests for DashboardPicker

* Do not use unified alerting mocks

* Fix unused type in dashboard test

* Improve comments in DahboardPicker

* Update folder validation fn

* Validation update

* Update legacy api test

* Lint

---------

Co-authored-by: alexandra vargas <alexa1866@gmail.com>
Co-authored-by: Alexa V <239999+axelavargas@users.noreply.github.com>
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2024-12-17 22:17:09 +01:00
cc6d057a18 Provisioning: Rename k8s origin metadata to repo (#96524) 2024-11-15 17:26:14 +03:00
61b95783d5 UpdateDatasource: Add apiVersion if enabled (#90038) 2024-07-08 13:02:48 +02:00
529d4e1169 Dashboards: Use dashboard_api k8s wrapper for save options also (#89598) 2024-06-26 13:35:04 +03:00
579bfa477e K8s: improve frontend resource client (#89621) 2024-06-24 18:25:04 +03:00
41e0430f83 K8s/Dashboards: Add frontend api to switch between implementations (#88632) 2024-06-05 17:34:23 +03:00
e8b7b6aa66 ResourceClient: Add generateName (eg UID) helper (#88037) 2024-05-20 12:18:53 +03:00
6127dfd322 Scopes: Adapt for new API (#87841)
* Implement changes for new Scopes API

* Update from linkID to linkId

* Fixes

* Fix tests

* prom/scopes: change query model to recieve []ScopeSpec

* Move to basic backend service

---------

Co-authored-by: Kyle Brandt <kyle@grafana.com>
2024-05-15 16:28:09 +03:00
d379e319d6 Implement API server client in Scopes (#85266) 2024-04-15 13:43:42 +03:00
45d1766524 K8s/Frontend: Add generic resource server and use it for playlists (#83339)
Co-authored-by: Bogdan Matei <bogdan.matei@grafana.com>
2024-03-28 14:01:24 +03:00