224 Commits

Author SHA1 Message Date
5066aec64d Advisor: Context handler returns a copy of request (#108508) 2025-07-24 10:32:06 +00:00
b1de534092 Refactor iam app cue files (#108542)
A breaking change was introduced by this grafana-app-sdk PR: https://github.com/grafana/grafana-app-sdk/pull/795

This PR refactors the definition of our CUE files (manifest and kinds) to match the new model in the latest version of grafana-app-sdk.
2025-07-24 09:52:52 +01:00
52f6104230 Dependencies: Bump Go to v1.24.5 (#108175) 2025-07-22 17:08:40 +02:00
6222156c7c [Dashboard Schema Codegen] Move dashboard CUE codegen block back up into kind body (#108476)
[Dashboard Schema Codegen] Move dashboard CUE codegen block back up into kind body to make sure new versions have the same settings.
2025-07-22 14:45:06 +00:00
e5d2f92384 K8s: Add App SDK installer (#107773) 2025-07-21 13:32:15 -04:00
7626508842 Table: Update e2e tests to support tableNextGen (#108184)
* Table: Force tableNextGen to be true for Playwright and false for Cypress

* RDG query for body text contains the headers too

* add some simple tests for row height

* dial in the row height test a little more

* more updates

* filters, pagination

* try this on CI

* more updates to the tests

* more tests

* wait for some sort stuff to flush

* replace class selectors for rdg

* target the click to the anchor in the header
2025-07-18 12:27:04 -04:00
3fad863fd1 Query Service: Combine SSE handling in single tenant and multi tenant paths (#108041)
* parse via sse

I need to figure out how to handle the pipeline.execute with our own
client. I think this is important for MT reasons, just like using our
own cache (via legacy) is important.

parsing is done though!

* WIP nonsense

* horrible code but i think it works

* Add support for sql expressions config settings

* Cleanup:
- remove spew from nodes.go
- uncomment out plugin context and use in single tenant flow
- make code more readable and add comments

* Cleanup:
- create separate file for mt ds client builder
- ensure error handling is the same for both expressions and regular queries
- other cleanup

* not working but good thoughts

* WIP, vector not working for non sse

* super hacky but i think vectors work now

* delete delete delete

* Comments for future ref

* break out query handling and start test

* add prom debugger

* clean up: remove comments and commented out bits

* fix query_test

* add prom debugger

* create table-driven tests with testsdata files

* Fix test

* Add test

* go mod??

* idk

* Remove comment

* go enterprise issue maybe

* Fix codeowners

* Delete

* Remove test data

* Clean up

* logger

* Remove go changes hopefully

* idk go man

* sad

* idk i ran go mod tidy and this is what it wants

* Fix readme, with much help from adam

* some linting and testing errors

* lint

* fix lint

* fix lint register.go

* another lint

* address lint in test

* fix dead code and linters for query_test

* Go mod?

* Struggling with go mod

* Fix test

* Fix another test

* Revert headers change

* Its difficult to test this in OSS as it depends on functionality defined in enterprise, let's bring these tests back in some form in enterprise

* Fix codeowners

---------

Co-authored-by: Adam Simpson <adam@adamsimpson.net>
2025-07-17 17:22:55 -04:00
c6a6b9fdd2 IAM: Create and delete user from the legacy store (#107694)
* Add Create for User + DualWriter setup

* Add delete User

* Fix delete + access check

* Add tests for delete user

* Add tests for create user

* Fixes

* Use sqlx session to fix database locked issues

* wip authz checks

* legacyAccessClient

* Update legacyAccessClient, add tests for create user

* Close rows before running other queries

* Use ExecWithReturningId

* Verify deletion in the tests

* Add Validate and Mutate

* Other changes

* Address feedback

* Update tests

---------

Co-authored-by: Gabriel Mabille <gabriel.mabille@grafana.com>
2025-07-17 11:50:40 +02:00
b4738c57e4 Dashboards API: Add v2alpha2 (#108121)
* Dashboards API: Register v2alpha2 API

* Prepare conversion functions

* Fix test

* Move to the bottom the v2aplha2 until is ready

---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2025-07-16 12:22:50 +00:00
b691b3288d Sharing: Export dashboard as image (#104207)
Co-authored-by: AgnesToulet <35176601+AgnesToulet@users.noreply.github.com>
2025-07-15 21:07:39 +00:00
2f8ec01c6c Dashboard Migrations: V29 query variable refresh property and options (#108088)
* Dashboard Migrations: V31 LabelsToFields-Merge Migration

* Dashboard Migrations: V32 No-op migration

* simplify

* Refactor to reduce nesting

* Dashboard Migrations: V30 value mappings and tooltip options

* Do not automigrate since graph is migrated in v27

* Refactor to reduce nesting

* Add test case for invalid mapping

* migrate to v29

---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2025-07-15 17:27:04 +00:00
1200b684c6 Dashboard Migrations: V30 value mappings and tooltip options (#107970)
* Dashboard Migrations: V30 value mappings and tooltip options
2025-07-15 16:44:11 +00:00
14cb6aea92 Dashboard Migrations: V32 no-op migration + V31 LabelsToFields-Merge Migration (#107947)
* Dashboard Migrations: V31 LabelsToFields-Merge Migration

* Dashboard Migrations: V32 No-op migration
2025-07-15 15:28:48 +00:00
015b2f6b0a Chore: Update gocloud.dev dependency to v0.42.0 (#108054)
* update dependency

* make update-workspace

* rerun with ge linked

* add codeowner

* rerun WITHOUT enterprise
2025-07-14 11:11:40 -04:00
8eef17cb37 QueryVariable: Add static options input (#107514)
* static options for query variable

* add toggle

* fix and add tests

* run the hack codegen thing

* more test fixes

* make betterer happier

* also make typecheck happy

* make betterer happier

* fix i18n key

* tranalte static variables sort label

* gen translations

* update snapshot
2025-07-14 16:05:56 +03:00
c9b2126c4a Secrets: Add v1beta1 schema with CUE + grafana-app-sdk (#107972)
* Secrets: Add v1beta1 API using CUE

* Secrets: Generate spec with app-sdk

* Secrets: Generate decrypt proto

* Secrets: Add manual files to help transition
2025-07-11 13:42:46 +02:00
66b79fb221 Internationalisation: Mark up transformations (#107910)
* CalculateFieldTransformerEditor

* more CalculateFieldTransformer

* ConcatenateTransformerEditor

* ConfigFromQueryTransformerEditor

* mark up other transformations

* few things spotted manually
2025-07-11 11:13:35 +01:00
13a89d4ae3 Revert: Future-proofing query and data source model in Dashboard Sche… (#107985)
* Revert: Future-proofing query and data source model in Dashboard Schema v2

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-07-10 18:58:33 +00:00
2b8c5bea1a Revert "Schema V2: Simplify annotations v1<->v2 conversions" (#107984)
Revert "Schema V2: Simplify annotations v1<->v2 conversions (#107390)"

This reverts commit d5a1781fb6149eb443dc3f11de23d6dcc2f6f50e.
2025-07-10 17:29:15 +00:00
e4650d3d8f Advisor: Update app-sdk and regenerate code (#107786) 2025-07-10 09:55:10 +02:00
85a6a7b9c1 iam: add description field to roles (#107888)
* iam: add description field to roles

* Openapi gen

* Revert launch change
2025-07-10 09:24:30 +02:00
20c700dd52 Chore: reduces barrel files part II (#107688)
* Chore: reduce barrel files

* chore: fixes unit test

* Chore: reduces barrel files part II

* chore: fix import sorting
2025-07-09 06:15:33 +02:00
d5a1781fb6 Schema V2: Simplify annotations v1<->v2 conversions (#107390)
* Initial migration pending to test

* Update tests

* apply feedback

* Remove unnecessary types

* Fix types

* Update tests

* fixing tests

* Default DS for transformer

* Update the default DS

* Update the generated sdk files

* Restore commented tests

* Update tests

* Updating snapshots

* fix

* Do not preserve empty datasource in panel spec

* update provisioning v2 sample dashboard

* Fix test

* Prettier

* Fix import e2e

* Prettier

* restore commented tests

* Update to support annotations

* Lint

* Make gen apps

* Make the build pass

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

* Update grafana-app-sdk to 0.39.2

* Workspace update

* make gen-cue

* Runtime error fix

* Update dashboard spec

* Update go workspaces

* Schema V2: Simplify annotations v1<->v2 conversions

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

* Cleanup and some more tests

* test improvement

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

* Update go.sum

* make generate

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

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

* ts

* make gen-apps

* Update response transformers to correctly handle v2->v1 annotations

* Update dashboards openapi snapshot

---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
Co-authored-by: alexandra vargas <alexa1866@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Igor Suleymanov <igor.suleymanov@grafana.com>
Co-authored-by: spinillos <selenepinillos@gmail.com>
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
2025-07-08 14:42:30 +02:00
37c480def4 K8s: Add support for stored subresources in app runner (#105481) 2025-07-07 11:25:23 -04:00
075770070e Future-proofing query and data source model in Dashboard Schema v2 (#104194)
---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
Co-authored-by: alexandra vargas <alexa1866@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Igor Suleymanov <igor.suleymanov@grafana.com>
Co-authored-by: spinillos <selenepinillos@gmail.com>
2025-07-07 15:31:25 +02:00
713f6d1551 IAM: Move resource definitions to apps/iam step 1 (#107389)
* wip

* Use serviceaccount model from /apps/iam

* revert version update

* Add tembinding, userteam, other improvements

* Change serviceaccounttoken spec

* Revert the change of ServiceAccountToken

* Revert the change of UserTeam

* Clean up

* Remove files that are not needed for now

* Lint

* Update sql query's integration tests

* Fix tests

* update openapi spec

* Move LastSeenAt to the annotations

* Updte openapi_snapshots

* Change lastSeenAt annotation name
2025-07-04 11:07:48 +02:00
93c14c52da Migrations: Compare backend and frontend outputs to ensure feature parity (#106851)
* wip: trying to understand how to get the ds info from migrator

* add datasource info provider

* Use DS service to fetch DS data

* add more tests cases to match with migrator cases

* Add snapshots

* Non-existing DS

* Add different DS for snapshots

* fix import

* Fix tests: guard against double initialization

* don't use full datasource package in test

* min version should be 35

* fix test

* fix conversion test

* Dashboards: Support schemaVersion v35 migration in backend

* Dashboards: Support schemaVersion v34 migration in backend

* Dashboards: Support schemaVersion v33 migration in backend

* Apply suggestions from code review

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>

* Apply feedback

* Remove unused parameters

* Refactor to follow Go patterns

* Update logic

* Only write final migration result as output

* Compare backend and frontend results

* Improve snapshots to cover all possible use cases

* Linter

* wip make it consistent v33

* apply feedback

* Return default when the ref cannot be found

* Update apps/dashboard/pkg/migration/schemaversion/v33.go

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>

* apply feedback

* Use same mocks backend/frontend

* restore migrations

* update snapshots

* Adapt migration tests to use min versions

* Ensure v40-v41 works

* Ensure v39-v40 works

* Simplify the naming of the files

* adjust jest to new input convention

* Ensure every migration v36-v41 works

* Improve v38 naming

* Ensure v36 migrates correctly

* Skip v36 refs migrations on rows

* Treat rows as frontend and ensure same results for v36

* Ensure v34 runs with the same logic than the frontend

* Leave empty stadistics as valid option

* ensure v33 is working as the frontend

* Update tests

* Undo frontend changes for legend handling

* Remove filtering by version in the frontend

* linter

* Clean up v33 input JSON

---------

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-07-03 12:23:51 +02:00
2294620b2e Advisor: Include optional more info in failures (#107244) 2025-07-01 10:49:16 +02:00
b1d3155b60 K8s: Library Panels: Add rerouting for get (#107362) 2025-06-30 13:26:24 -05:00
22fbcae11b Dependencies: Bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.3.0 (#107379) 2025-06-30 11:56:31 +02:00
07f5a72842 Dashboard Migrations: V33 Replace string-based datasource by datasource ref (#106848)
---------
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-06-26 19:04:43 +02:00
3d543a336f IAM: Register CoreRole apis (#106924)
* IAM: Register CoreRole apis

* one line store instantiation

* Small refactor for readability

* Add authorizer for CoreRole

* Nit

* Error strings should not end with punctiation

* Account for error

* Switch to use the local resource client

* error should not start with upper casing

* noopStorageErr should have a name starting with err

* Update workspace

* I don't know why I don't have the same output as the CI 🤷

* Dependency xOwnership

* imports

* Import order

* Rename alias to make it clear this is legacy
2025-06-26 10:11:28 +02:00
0356e1302a Advisor: improve code readability (#107175) 2025-06-25 10:48:36 +00:00
c5a6bb5ab1 Advisor: Address error logs (#107125) 2025-06-25 12:08:30 +02:00
4e19bc515e Chore: bump grafana-plugin-sdk-go from v0.277.0 to v0.278.0 (#107165)
Chore: bump grafana-plugin-sdk-go
2025-06-25 10:16:14 +02:00
238cff5e8a Dashboard Migrations: V34 CloudWatch Multi-Statistics Migration (#106656)
* wip: trying to understand how to get the ds info from migrator

* add datasource info provider

* Use DS service to fetch DS data

* add more tests cases to match with migrator cases

* Add snapshots

* Non-existing DS

* Add different DS for snapshots

* fix import

* Fix tests: guard against double initialization

* don't use full datasource package in test

* min version should be 35

* fix test

* fix conversion test

* Dashboards: Support schemaVersion v35 migration in backend

* Dashboards: Support schemaVersion v34 migration in backend

* Apply suggestions from code review

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>

* Apply feedback

* Remove unused parameters

---------

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-06-19 07:03:14 +00:00
a646043066 chore: update grafana/authlib (#106918) 2025-06-18 22:46:27 +02:00
689cafc1fa App Platform Provisioning: Add experimental nanogit mode for Git Sync (#106763)
* Add nanogit package
* Add nanoGit feature flag
* Put logger into nanogit context
* Commit go mod and go sum updates
* Add more stuff around logging
* Nanogit also in extra one
* Add owner to dependency
2025-06-17 19:07:30 +02:00
09bbdfe8ab Dashboard Migrations: V35 ensures X-axis visibility in timeseries (#106633)
* Add datasource info provider

* Dashboards: Support schemaVersion v35 migration in backend

* update go mods

---------

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-06-17 10:38:48 +02:00
d02b62e874 Chore: Update app-sdk to v39 (#106785) 2025-06-16 19:11:30 +02:00
59c2f15433 Dashboard V0->V1 Migration: Schema migration v36 (#100757)
---------

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-06-16 15:53:41 +02:00
ffc16ee072 Schema: Change how origin filters are added to AdHocVariable (#106086)
* refactor origin filters schema

* add canary version

* update schema

* fix failing tests

* refactor

* remove autogenerated import

* tests

* maintain only dashboard originated filters

* refactor

* refactor

* Schema: Persist defaultValue for groupBy in schema (#106542)

* persist defaultValue for groupBy in schema

* fix

* type

* refactor

* refactor

* bump scenes
2025-06-16 11:15:00 +03:00
a3e85d8319 Advisor: Fix issues (#106612) 2025-06-12 15:37:07 +00:00
e73530da09 Advisor: Add a check for pinned instances (#106059) 2025-06-12 10:15:40 +02:00
5c268c1734 Dependencies: Bump Go to v1.24.4 (#106533) 2025-06-11 14:25:48 +02:00
34ef571542 Advisor: Better handling of context cancel (#106470) 2025-06-10 16:53:51 +02:00
6fb0ed9886 Bump tempo to 20250529124718-87c2dc380cec (#106220)
* Bump tempo to 20250529124718-87c2dc380cec

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

* Add owners to pkg/build

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

* update workspace

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

* update pkg/build/go.sum

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

* update pkg/build/go.sum

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

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2025-05-29 23:43:13 -05:00
4ac248a512 Internationalisation: Mark up panel plugins for translations (#106068)
* config for panel plugin translations

* markup

* tweaks

* prettier

* use data-testid

* rename disable rule now it's been moved

* final markup
2025-05-29 18:13:25 +01:00
e2e8de29ba Advisor: Check plugin signature (#106044) 2025-05-29 11:33:19 +02:00
10f2b76156 Chore: Update apps codegen to v0.38.2 (#106111) 2025-05-28 12:35:44 +03:00