Commit Graph

231 Commits

Author SHA1 Message Date
Stephanie Hingtgen b296a51d0d [release-12.0.3] Dashboard: Fix history retrieval for uids that end in - (#107081) 2025-06-24 15:47:12 +03:00
Matheus Macabu b1a4e09102 [release-12.0.1] Dependencies: Unpin and bump github.com/getkin/kin-openapi from v0.126.0 to v0.132.0 (#105249)
* Dependencies: Unpin and bump github.com/getkin/kin-openapi from v0.126.0 to v0.132.0

* Chore: Update schemas and remove examples

* Chore: Update schemas and remove examples2
2025-05-13 12:23:12 +03:00
Stephanie Hingtgen 18a9cd3636 [release-12.0.1] Dashboards: Fix moving to general folder (#104719)
Dashboards: Fix moving to general folder
2025-04-29 22:14:00 +03:00
Stephanie Hingtgen 549833e40d [release-12.0.1] K8s: Dashboards: Fix transformation between v1 and v2 (#104502) (#104527)
K8s: Dashboards: Fix transformation between v1 and v2 (#104502)
2025-04-25 17:02:35 +01:00
Stephanie Hingtgen ed408985fa [release-12.0.1] K8s: Dashboards: Mark as v1beta1 (#104422)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-04-23 19:21:59 +01:00
Stephanie Hingtgen b0d42f432a [release-12.0.1] K8s: Dashboards: Add fine grained access control checks to /apis (#104419)
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 18:28:10 +01:00
Stephanie Hingtgen 2e878c4fdc [release 12.0.1] Dashboards: Preserve schema version in /api (#104213) (#104249)
Dashboards: Preserve schema version in /api (#104213)


---------

Co-authored-by: Artur Wierzbicki <artur.wierzbicki@grafana.com>
2025-04-21 18:40:34 -05:00
Sam Jewell 4aa7d67edd Server-side expressions: Improve error message (#103968)
This error message is more correct
2025-04-14 21:14:03 +00:00
Ryan McKinley 0283c98e30 K8s/Folders: Use v1beta1 and app-sdk based spec (#103975) 2025-04-14 23:20:10 +03:00
William Wernert 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
Marco de Abreu 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
Stephanie Hingtgen bba85c1128 K8s: Dashboards: Fix error handling (#103929) 2025-04-11 13:31:41 -06:00
Marco de Abreu 95f04c79cd Dashboards: Add Dashboard Schema validation (1) (#103662) 2025-04-11 16:52:46 +00:00
Ryan McKinley 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
Ryan McKinley 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
Stephanie Hingtgen f5ad1ef69b K8s: Folders: Add v1 api (#103842) 2025-04-11 13:09:52 +01:00
Bogdan Matei 35e78feffa Dynamic Dashboards: Add repeats for tabs (#103348) 2025-04-11 13:50:44 +03:00
Ryan McKinley 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
Mariell Hoversholm 757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02:00
Alexa V 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
Ryan McKinley 3f9e01b371 Provisioning: Use AccessChecker to verify if request has access to the parsed object (#103646) 2025-04-09 15:48:58 +01: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
Ryan McKinley 6df04f3949 Provisioning: Hold recent jobs in memory (#103678) 2025-04-09 12:46:01 +03:00
Ryan McKinley 410bb1cf74 Provisioning: Fix URL sanitization errors (#103640) 2025-04-09 10:33:55 +03:00
Andres Martinez Gotor 12e3b86ebb Auto-generate cli for advisor.grafana.app (#103465) 2025-04-08 16:38:19 +02:00
Marco de Abreu 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
Ryan McKinley d3e6e308a0 K8s/ManagedBy: Enforce who can CRUD provisioning resources (#103322) 2025-04-08 14:17:33 +03:00
Marco de Abreu c8c55621fb Dashboards: Fix dashboard UID inconsistency between creation and retrieval in legacy storage (#103568) 2025-04-08 12:25:32 +02:00
Ryan McKinley 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
Ryan McKinley 1824694c72 Provisioning: Show branch in save form (#103513) 2025-04-07 12:48:32 +03:00
Ryan McKinley 8dbaeac9da Provisioning: Use repository view rather than raw config (#103449) 2025-04-07 09:39:31 +03:00
Stephanie Hingtgen 8cd6f837a5 Dashboards: Prevent saving to a non-existent folder (#103503) 2025-04-07 09:02:20 +03:00
Marco de Abreu b2f80d4dca Dashboards: Add Dashboard API Validation tests and fix underlying issues (#103502) 2025-04-07 05:44:28 +03:00
Ryan McKinley b329b78ef6 Provisioning: Improve flakey test (#103498)
improve flakey test
2025-04-06 17:51:54 +02:00
Mihai Doarna 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
Ryan McKinley 04fb9f534e Dashboards: Only expose LibraryPanels and search on v0 (not v1+v2) (#103335) 2025-04-03 20:24:12 +03:00
Ryan McKinley c5d76a8bba Provisioning: Require a name in the saved resource (#103309) 2025-04-03 18:58:05 +03:00
Sven Grossmann a67cb174c7 Investigations: add fieldConfig and queries (#103276)
* Investigations: add `fieldConfig` and `queries`

* fix openAPI
2025-04-02 15:42:32 +02:00
Ryan McKinley 6781612335 Provisioning: Enable search when provisioning is enabled (#103208) 2025-04-02 11:20:28 +03:00
Roberto Jiménez Sánchez 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
Ryan McKinley f087d5f61b Provisioning: validate files we read (#103197) 2025-04-01 17:49:08 +03:00
Ryan McKinley 6754781d7b Provisioning: Remove unnecessary flags from tests and instructinos (#103165) 2025-04-01 13:43:00 +03:00
Ryan McKinley ca35a89916 Provisioning: Manage repo jobs as single sub-resource (#103090) 2025-04-01 13:22:47 +03:00
Ryan McKinley 1ead18d856 Chore: Update git dependencies (#103159) 2025-04-01 13:10:50 +03:00
Roberto Jiménez Sánchez bb344fcd83 Remote provisioning: consolidate resource operations (#102972)
* Move to new repository

* Rename it to dual writer

* Rename the function

* Rename the methods

* Rename to exportResource

* Clean up logic in migrate and add TODOs

* Add TODOs

* Use generic client for unprovisioned

* ForEachResource

* More consolidation

* Refactor more around client

* Consolidate constants

* ForEachFolder

* More use of constants

* Add FIXME notes

* Use more constant

* Remove Dashboard

* Pass tree to folder manager

* Replicate tree

* Reduce export complexity

* More refactoring

* Use the ForEach for loading users

* Limit in-memory folders

* Isolate the object

* Improve the export function

* Move resources to resources package

* Move delete operation

* Move more logic

* More consolidation

* More renaming

* Fix more issues

* Ensure path exists when created a resource

* Simply append error

* Fix receiver lint issue

* Fix cyclomatic complexity

* Fix linting

* Remove folder path creation
2025-03-31 14:27:46 +02:00
Mariell Hoversholm 69803300f1 Provisioning: Complete rename of jobs (#102979)
Fixes: https://github.com/grafana/git-ui-sync-project/issues/164
2025-03-27 17:06:44 +01: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
Mariell Hoversholm e1e1d3fd9f Fix: Prints should always include new lines (#102795)
* CI: Allow Bench conversion to fail

We shouldn't mark PRs and commits as X if they fail to convert logs with Bench.

* Fix: Prints should always include new lines

* fix: remove unused import
2025-03-27 12:27:53 +01:00
Peter Štibraný 5b5f433a26 spanner: Disable running alerting integration tests when using spanner. (#102730)
* Disable running alerting integration tests when using spanner.

* Disable tests for templategroup.
2025-03-26 10:57:55 +01:00
Stephanie Hingtgen 9e10a7f9ce Tests: Fix failing integration test (#102847) 2025-03-25 21:17:56 -05:00