241 Commits

Author SHA1 Message Date
43d0053c80 K8s: Dashboards: Fix transformation between v1 and v2 (#104502) 2025-04-25 05:06:49 -06:00
2e51096eb4 Provisioning: Export dashboards with conversion errors (#104369) 2025-04-24 14:16:25 +01:00
edeff68645 Advisor: Allow to retry checks for a single element (#104279) 2025-04-24 12:00:32 +02:00
faa33e30a9 Schema: Add origin property to AdHocFilterWithLabels (#104320)
* add origin to AdHocFilterWithLabels

* typo

* fix

* use singular for FilterOrigin

* run ./hack/update-codegen.sh

* add canary scenes to verify typechecks

* update dashboard schema json snapshot

* fix

* fix

* update canaries

* fix

* bump scenes version
2025-04-24 11:13:17 +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
17e4a3b386 Playlists: Remove kubernetesPlaylists flag (#104171) 2025-04-22 10:39:40 +02: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
c8f65a0348 Provisionig: Add skipDryRun parameter to the /files/ resource (#104152) 2025-04-21 11:49:06 +03:00
efd9334295 Provisioning: route provisioning storage to the provisioning client (#104082) 2025-04-18 21:47:37 +03:00
c174c855c3 Alerting: Update alerting cue definitions (#104053)
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2025-04-18 15:14:52 +01:00
dc8acf8e05 K8s: Fix kubectl access for apiserver resources (#103958) 2025-04-17 10:30:35 +03:00
af59c4eb3e Chore: bump grafana-plugin-sdk-go from v0.275.0 to v0.277.0 (#103971)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-04-17 00:32:25 +03:00
45092261ab Playlist: Move to generated api client (#103083)
* create playlist api client

* add more api client methods

* integrate new client. TODO: tests, integrate remaining util functions

* add error handling

* fix unit tests

* refactor to remove PlaylistUI type

* cleaner PlaylistStartPage

* handle generateName

* Fix startmodal name

* create generic error handling util

* prettier

* keep migration code for now

* better syntax
2025-04-16 13:27:52 +01:00
71b06e9845 Alerting: Return an empty array for contact points with no integrations (#104063)
Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
2025-04-15 21:52:56 +01:00
f421c71373 Provisioning: Fix flaky test CreatingGitHubRepository (#104068)
Fix flaky CreatingGitHubRepository

Co-authored-by: Marco de Abreu <18629099+marcoabreu@users.noreply.github.com>
2025-04-15 15:44:27 -04:00
4aa7d67edd Server-side expressions: Improve error message (#103968)
This error message is more correct
2025-04-14 21:14:03 +00:00
0283c98e30 K8s/Folders: Use v1beta1 and app-sdk based spec (#103975) 2025-04-14 23:20:10 +03:00
a5288db624 Alerting: Remove the POST endpoint for the internal Grafana Alertmanager config (#103819)
* Remove POST config for Grafana Alertmanager

* Delete auth + test for removed path

* Alerting: Remove check for `alertingApiServer` toggle in UI (#103805)

* Remove check for alertingApiServer in UI

* Update tests to no longer care about alertingApiServer

* Add contact points handlers now that we use alertingApiServer all the time

* Fix test broken from removing camelCase for UIDs

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2025-04-11 17:38:53 -04: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
664e5255fe Provisioning: Use role based access when the target does not yet exist (#103862)
* role based fallback

* disable permissions cache with provisioning

* fallback to role based

* test with editor (not admin)

* test with editor (not admin)

* fix imports

* lint

* editor can create folders
2025-04-11 17:47:26 +03:00
2c3422fc5c Provisioning: return field paths in test error messages (#103850)
* Provisioning: Do not block connect step on error

* Display field errors

* Cleanup

* return field errors

* fix test

* convert errros to an array

* Fix history display

* Add getFormErrors

* metav1 issues

* lint

* Proper field names

* Fix notification

* Remove unused component

---------

Co-authored-by: Clarity-89 <homes89@ukr.net>
2025-04-11 14:26:42 +01:00
f5ad1ef69b K8s: Folders: Add v1 api (#103842) 2025-04-11 13:09:52 +01:00
35e78feffa Dynamic Dashboards: Add repeats for tabs (#103348) 2025-04-11 13:50:44 +03:00
0d20680695 Provisioning: Improve PR feedback (#103537)
* fix ref

* dryRun before save

* reuse code for create vs update

* update comments

* can update PRs

* return useful errors

* update preview links

* lint fix

* update some wording

* update mocks

* fixed

* Update pkg/registry/apis/provisioning/resources/dualwriter.go

Co-authored-by: Roberto Jiménez Sánchez <roberto.jimenez@grafana.com>

* more updates

* fix link

* error string

* dry run

* refactor galore

* with template test

* very basic tests

* more test cases

* remove generator

* more tests

* fix lint

* multiple files now

* merge main

* merge main

* fix snapshots

* fix snapshots

* slugify title

---------

Co-authored-by: Roberto Jiménez Sánchez <roberto.jimenez@grafana.com>
2025-04-11 11:06:16 +01:00
757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02:00
2f60d54648 Dashboard: Schema V2 - Fix annotations losing queries (#102951)
* Fix annotations losing queries when saving v1 with dynamic dashboards enabled

* Add extra options property to the DashboardAnnotationQuerySpec to catch all field datasource-specific properties

* Add options to the v2Alpha1 schema and run make gen-apps

* Add unit test and clean up console.logs

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
2025-04-09 18:51:51 +02:00
3f9e01b371 Provisioning: Use AccessChecker to verify if request has access to the parsed object (#103646) 2025-04-09 15:48:58 +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
6df04f3949 Provisioning: Hold recent jobs in memory (#103678) 2025-04-09 12:46:01 +03:00
410bb1cf74 Provisioning: Fix URL sanitization errors (#103640) 2025-04-09 10:33:55 +03:00
12e3b86ebb Auto-generate cli for advisor.grafana.app (#103465) 2025-04-08 16:38:19 +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
d3e6e308a0 K8s/ManagedBy: Enforce who can CRUD provisioning resources (#103322) 2025-04-08 14:17:33 +03:00
c8c55621fb Dashboards: Fix dashboard UID inconsistency between creation and retrieval in legacy storage (#103568) 2025-04-08 12:25:32 +02:00
18a3913782 Provisioning: Fix updating a PR from the UI (#103571)
Co-authored-by: Clarity-89 <homes89@ukr.net>
2025-04-08 12:51:31 +03:00
1824694c72 Provisioning: Show branch in save form (#103513) 2025-04-07 12:48:32 +03:00
8dbaeac9da Provisioning: Use repository view rather than raw config (#103449) 2025-04-07 09:39:31 +03: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
b329b78ef6 Provisioning: Improve flakey test (#103498)
improve flakey test
2025-04-06 17:51:54 +02:00
10411361e7 Team: Add columns external_uid and is_provisioned to the team table (#103285)
* add columns external_id and is_provisioned to the team table

* generate openapi specs

* rename column to external_uid

* generate open api specs

* increase limit for external_uid to 256
2025-04-04 11:00:14 +03:00
04fb9f534e Dashboards: Only expose LibraryPanels and search on v0 (not v1+v2) (#103335) 2025-04-03 20:24:12 +03:00
c5d76a8bba Provisioning: Require a name in the saved resource (#103309) 2025-04-03 18:58:05 +03:00
a67cb174c7 Investigations: add fieldConfig and queries (#103276)
* Investigations: add `fieldConfig` and `queries`

* fix openAPI
2025-04-02 15:42:32 +02:00
6781612335 Provisioning: Enable search when provisioning is enabled (#103208) 2025-04-02 11:20:28 +03:00
04e152f326 Provisioning: webhook last event timestamp (#103180)
* Record webhook pinged event

* Add TODO for webhook creation updated

* Hack to wire client

* Revert accidental change in controller

* Wire the client

* Use factory method

* Remove omit empty

* Regenerate client

* Fix compilation

* Every 30 seconds if not pinged

* Move lines around

* Use different approach

* Added as part of the controller

* Exponential backoff for waiting for ping

* More stuff

* Revert changes in controller

* Add separate webhook section in overview

* Change order of translations

* Update ping within 1 minute

* Last event update

* Extract translation

* Display last event in frontend

* Refactor the logic around update

* Fix the type to marshal
2025-04-02 10:09:58 +02:00