535 Commits

Author SHA1 Message Date
3e3fa18118 Revert "fix(folders): only return continue token if more results" (#106700)
Revert "fix(folders): only return continue token if more results (#106667)"

This reverts commit 3fd8ad8476077b69c44172159852162fdf4dc605.
2025-06-13 12:07:27 +02:00
3fd8ad8476 fix(folders): only return continue token if more results (#106667) 2025-06-13 09:55:30 +02:00
de28231f2f SecretsManager: Add outbox store (#106613)
SecretsManager: add outbox store

Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-06-12 13:31:48 +01:00
1be9e60667 SQL Expressions: Exclude CTEs from required Tables (#106479)
Fixes #105030

---------

Co-authored-by: Sam Jewell <2903904+samjewell@users.noreply.github.com>
2025-06-11 10:36:28 -04:00
d7a4f497bc Folders: Correctly resolve nested folder breadcrumbs (#106344)
correctly use UID scope instead of ID based scope
2025-06-05 10:02:07 +01:00
729f0a6ba5 ds-querier: handle downstream 500s (#105890)
* ds-querier: add new metric for the total request

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* fix logger and trace

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* ds-querier: rewrite downstream 500s to 400

---------

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
2025-05-29 17:30:45 -04:00
020780f5ac DS-querier: define func to fetch instance config settings (#106172)
DS-querier: define func to fetch instance config settings to be passed into executing query
2025-05-29 11:07:40 -04:00
ab99211b40 Dashboard Provisioning: Reduce db load (#106114) 2025-05-29 09:39:07 +03:00
b4cd51810b SecretsManager: Various utils for usage insights, outbox and secretkeeper (#106010)
* SecretsManager: utils for usage insights on ST mode

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

* SecretsManager: add assert

Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>

* SecretsManager: Remove encryption scope option

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

* SecretsManager: add fake keeper

Co-authored-by: Dana Axinte <53751979+dana-axinte@users.noreply.github.com>
Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

---------

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>
2025-05-28 12:46:54 +01:00
5401175562 SecretsManager: Conditionally lock DB before migrations using config setting (#106003)
Secrets: Conditionally lock DB before migrations using config setting (#105949)

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-05-26 18:28:53 +01:00
5c0194955e Dashboards: Fix FindDashboards when kubernetesClientDashboardsFolders is disabled (#105974)
Dashboards: fix legacy FindDashboards
2025-05-24 07:06:30 -06:00
04d39cbbc6 unistore: split ListIterator and ListHistory in StorageBackend (#105654)
split listIterator from ListHistory
2025-05-23 15:00:18 +02:00
ec3f467666 ds-querier: small renames (#105701) 2025-05-22 09:04:02 -04:00
6e5e133f7d SecretsManager: Introduce db migrator with keeper table (#105538)
Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>
Co-authored-by: Leandro Deveikis <leandro.deveikis@gmail.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-05-21 15:02:51 +01:00
a1e71fc85f SecretsManager: Update decrypt authorization with service identity (#105668)
(cherry picked from commit 9aea342be1764c33033aa1717242829970d5f5be)
2025-05-20 16:24:51 +02:00
b1c1d080e2 Internationalisation: Mark up MSSQL (#105532)
* scaffolding

* markup

* fix typos + extract translations

* update crowdin.yml

* uppercase Grafana
2025-05-20 14:39:41 +01:00
38de0cac3a Chore: Replace usages of golang.org/x/net/context with stdlib context package (#105676) 2025-05-20 14:59:40 +02:00
a7922912fe SecretsManager: Introduce secrets database wrapper (#105472)
SecretsManager: Introduce secret database wrapper

Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>
Co-authored-by: Leandro Deveikis <leandro.deveikis@gmail.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-05-20 11:48:47 +01:00
feaaf96269 RBAC: Remove folder guardians part 2 (#104645)
* replace usage of folder guardians with access control evaluators

* remove NewByFolderUID guardian

* bring up to date

* fix test

* more test fixes, and don't fetch the folder before evaluating lib element access

* change what error is returned

* fix alerting test

* try to fix linter errors

* replace the use of newByFolder guardian with direct access control evaluator checks

* remove newByFolder guardian

* remove unintentional changes

* remove unintentional changes

* undo unwanted change
2025-05-17 00:25:07 +03:00
4eadb0fec8 ds-querier: handle execute errors better (#105496)
* ds-querier: handle execute errors better

* fix: change how GetResponseCode works to return 418 if rsp is nil

418 is a bit of an easter egg which in this case works since we don't
have an rsp but we do know something went wrong, so a 200 won't work.

Also changed this to return the code in the frame, not sure why we
weren't.

* tests: fix GetResponseCode tests

* log no rsp case

* bring back og error log
2025-05-16 21:41:32 +03:00
d896f31c43 Dashboards: report valid folder count (#105484) 2025-05-16 14:51:04 +03:00
002f46736a refactor(unified-storage): move generated protos to own pkg (#105356) 2025-05-15 21:36:52 +02:00
581d153604 SecretsManager: Introduce DecryptAuthorizer (#105459)
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-05-15 17:52:14 +01:00
da24ad06bd Provisioning: Hide full path for classic provisioing resources (#105440) 2025-05-15 16:01:12 +00:00
61ceaec0d6 SecretsManager: Move actor/auth filtering layer to rest storage (#105414)
Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-05-15 09:48:16 +01:00
db828d0f00 DS-Querier: Add additional logs (#104841) 2025-05-14 15:07:08 -04:00
8c64078965 SecretsManager: Keeper and secure value contracts, secretkeeper changes (#105379)
Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-05-14 15:24:25 +01:00
4da4482ec5 Provisioning: Avoid writing 1970 date (#104912) 2025-05-14 13:24:15 +03:00
5158dce936 SecretsManager: Changes to specs as ref, description, system keeper (#105319)
* SecretsManager: Changes to specs as ref, description, system keeper

Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>
Co-authored-by: Dana Axinte <53751979+dana-axinte@users.noreply.github.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* SecretsManager: Changes to rest storage for spec ref, description, system keeper

Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>
Co-authored-by: Dana Axinte <53751979+dana-axinte@users.noreply.github.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* SecretsManager: Changes to rest storage for spec description

Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>
Co-authored-by: Dana Axinte <53751979+dana-axinte@users.noreply.github.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* SecretsManager: Changes to rest storage for spec description

Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>
Co-authored-by: Dana Axinte <53751979+dana-axinte@users.noreply.github.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

---------

Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>
Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-05-13 16:40:17 +01:00
8866f2cfc1 Provisioning: Split progress on \r (#105268) 2025-05-13 10:59:08 +03:00
047499a363 Provisioning: introduce concept of provisioning extras (#104981)
* Spike: Extras

* Attempt to wire it up

* Hack

* Fix issue with jobs

* Wire more things up

* Fix more wiring stuff

* Remove webhook secret key from main registration

* Move secret encryption also outside register

* Add TODOs in code

* Add more explanations

* Move connectors to different package

* Move pull request job into webhooks

* Separate registration

* Remove duplicate files

* Fix missing function

* Extract webhook repository logic out of the core github repository

* Use status patcher in webhook connector

* Fix change in go mod

* Change hooks signature

* Remove TODOs

* Remove Webhook methos from go-git

* Remove leftover

* Fix mistake in OpenAPI spec

* Fix some tests

* Fix some issues

* Fix linting
2025-05-13 09:50:43 +02:00
8f79e4882f Replace usage of http.DefaultClient and http.DefaultTransport (#104135)
Remove usage of http.DefaultClient and http.DefaultTransport

Part of grafana/data-sources#484
2025-05-09 13:26:39 -04:00
c90e2e8e5e SecretsManager: Add (en/de)cryption packages (#104923)
Merging the code as-is from the feature branch: secret-service/feature-branch

Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>
Co-authored-by: Dana Axinte <53751979+dana-axinte@users.noreply.github.com>
Co-authored-by: Leandro Deveikis <leandro.deveikis@gmail.com>
Co-authored-by: Mariell Hoversholm <mariell.hoversholm@grafana.com>
Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
2025-05-05 15:26:52 +02:00
2df2b169cc Provisioning: Require author name (#104789) 2025-04-30 19:33:21 +03:00
85344e30c0 Alerting: Migrate notifications API to app-platform SDK application (#104424)
* introduce alerting notification app
* move code as is and remove from old registry
* update api server registration
* update make file and remove unnecessary args, copy some useful make commands from dashboards
* update codeowners

* move constants inside module and remove dependency from grafana
* add support for selectors to the app builder
2025-04-30 10:23:56 -04:00
3b3c2e225c Provisioning: cover most cases in go-git clone (#104513)
* Add some clone tests

* Add case to create ref if it doesn't not exist

* Add unit tests for context cancellation

* Bare repository not needed

* Make tests work without git command
2025-04-30 14:05:19 +02:00
9edf2f6356 Folders and Dashboards: Version check fixes (#104663)
Folders: Fix version mismatch errors
2025-04-30 03:04:30 +03:00
129e8bb1e4 Dashboards: Fix moving to general folder (#104655) 2025-04-30 03:03:57 +03:00
9968576acf Folders & Dashboards: Cleanup timestamps and error codes (#104665)
K8s: Fix timestamps and error codes
2025-04-30 03:03:21 +03:00
b5281c923f K8s: Dashboards: Fix provisioned dashboard cleanup (#104504) 2025-04-25 05:55:50 -06:00
2e51096eb4 Provisioning: Export dashboards with conversion errors (#104369) 2025-04-24 14:16:25 +01:00
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
b09d79b21c K8s/Dashboard: Promote from alpha1 to beta1 (#104009) 2025-04-23 20:54:35 +03:00
9e9e971ab3 Provisioning: unit test and bug fixes go-git repository (#104390)
* Add unit test for unimplemented methods

* Add unit test for GoGitRepo_Read

* Add tests for Delete

* Add more tests

* Add unit test for GoGitRepo_Push

* Add unit test for ReadTree
2025-04-23 15:59:03 +03:00
c8981d91c7 Provisioning: remaining unit test coverage github repository (#104382)
* Add test for GitHubRepository_LatestRef

* Add test for GitHubRepository_LatestRef

* Add test for GitHubRepository_CommentPullRequest

* Add remaining tests for GitHubRepository

* Add remaining tests for GitHubRepository

* Fix linting
2025-04-23 13:29:21 +01:00
3923538ba4 Provisioning: Delete from repository, not the resource client on rename (#104291)
Co-authored-by: Roberto Jimenez Sanchez <roberto.jimenez@grafana.com>
2025-04-23 12:30:30 +02: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
2eab7cb63b ds-querier: improve instant vector support (#103954) 2025-04-22 15:20:45 -04:00
a438b192d3 Provisioning: unit test repository/github package (#104310)
* Add unit tests IsAuthenticated

* Add unit tests RepoExists

* Add unit tests GetContents

* Add initial unit tests GetTree

* Add unit tests for CreateFile

* Add unit test UpdateFile

* Add unit tests DeleteFile

* Add unit tests for Commits

* Add unit tests for helpers

* Add unit test CompareCommits

* Add GetBranch tests

* Add unit tests BranchExists and CreateBranch

* Add unit tests Webhooks

* Remove unused code

* Add unit tests CommentPullRequest

* Add more cases for GetTree

* Complete coverage

* Fix linting
2025-04-22 18:20:29 +01:00
cd0ba68002 Provisioning: Update driver logic (#104233) 2025-04-22 16:42:33 +02:00