Commit Graph

403 Commits

Author SHA1 Message Date
Stephanie Hingtgen 044407d9dc
Provisioning: Allow configurable min interval (#111920) 2025-10-02 09:05:09 +03:00
Stephanie Hingtgen 6f0a8a344a
Provisioning: Fix repos stuck in deletion (#111918) 2025-10-02 09:04:55 +03:00
Ryan McKinley 2f2289f226
Chore: Update authlib (foder as top level argument) (#111800) 2025-10-01 14:40:28 +00:00
Mihai Turdean 7be0c100b6
IAM Folder Reconciler - revert fetching latest folder info from the folder to improve perf (#111779) 2025-09-30 16:59:06 +00:00
Costa Alexoglou 1b766b9c9f
Provisioning finalisers fix 2 (#111679)
* adding some logs to better understand what might be happening

* only focus this PR on improve logging in finalizer handling

* debug log before calling finalizers

* working on finalizers

* removing last todos, adding unit tests

* better use SupportedFinalizers name

* addressing comments

* wip: fix tests and add delete error in status

* chore: codegen

* chore: codegen openapi

* Merge remote-tracking branch 'origin/main' into provisioning-finalisers-fix-2

* update frontend client

* fix: errors in testing

* fix: breaking test

---------

Co-authored-by: Daniele Ferru <daniele.ferru@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-09-29 15:21:12 +02:00
Alexander Zobnin 893523dd7c
grafana-iam: Wire RoleBindings APIs to OSS (#111728)
* Update role binding specs

* Wire role bindings APIs in OSS

* gofmt

* revert modules updates

* update specs

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* update registration

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* fix reader

* fix format

* add role bindings mapper

* remove namespace from subject spec

* fix formatting

* update api specs

* Fix role binding registration

* remove mapper

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2025-09-29 14:28:12 +02:00
Ryan McKinley c4a2bb5540
Search: Include managedBy in DashboardHit result (#111600) 2025-09-29 14:28:26 +03:00
Ivan Ortega Alba 6d2fa6c583
Dashboard: Backend always set `metricEditorMode: 0` regardless `metricQueryType` and `expression` (#111613)
- Fix metricEditorMode logic to match frontend hasOwnProperty behavior
- Fix metricQueryType to only set when property doesn't exist
- Fix statistics processing to handle all types like frontend does
- Fix null statistic handling to match frontend behavior
- Fix object string representation to match JavaScript behavior
- Add comprehensive test coverage for all CloudWatch migration scenarios
- Achieve 100% backend-frontend consistency for v34 migration

* Fix v34 CloudWatch migration backend-frontend inconsistencies

- Fix metricEditorMode logic to match frontend hasOwnProperty behavior
- Fix metricQueryType to only set when property doesn't exist
- Fix statistics processing to handle all types like frontend does
- Fix null statistic handling to match frontend behavior
- Fix object string representation to match JavaScript behavior
- Add comprehensive test coverage for all CloudWatch migration scenarios
- Achieve 100% backend-frontend consistency for v34 migration

* Improve v34 CloudWatch migration test coverage

- Add targeted tests for hasOwnProperty logic coverage
- Add comprehensive getSuffixForStat coverage (all data types)
- Add generateNextRefId double letter generation tests
- Simplify test cases while maintaining full coverage
- Achieve 93%+ coverage on all critical v34 functions
- Remove redundant test cases for better maintainability

* Clean up v34 CloudWatch migration code

- Remove unnecessary comments and documentation
- Simplify function signatures and logic
- Maintain functionality while improving readability
- Keep essential logic intact with cleaner code

* Only remove unnecessary comments
2025-09-29 11:35:58 +02:00
Ryan McKinley 82bcfba64b
Preferences: refactor experimental apiserver and improve tests (#111596) 2025-09-26 19:44:02 +00:00
Andres Martinez Gotor c61a8a16fd
Advisor: Retry before patching objects (#111665) 2025-09-26 15:47:30 +02:00
Yuri Tseretyan b8f23eacd4
Alerting: Migrate to integration schema (#111643)
* update tests to assert against snapshot
* remove channel_config package replaced by schemas from alerting module
* update  references to use new schema
2025-09-26 09:31:50 -04:00
Mihai Turdean 2f5aacdb5d
Update IAM Folder Reconciler local dev environment to include tools for profiling the operator. (#111641)
Update local dev setup to allow for profiling of the operator
2025-09-25 14:34:49 -06:00
Yuri Tseretyan 24c10b4fb9
Alerting: Remove usages of ReceiverType (#111508)
* remove usages of ReceiverType
2025-09-25 16:09:54 -04:00
Costa Alexoglou 31ae013e8d
chore: add validations to test endpoint (#111622)
* chore: add validations to test endpoint

* Validate path

---------

Co-authored-by: Clarity-89 <homes89@ukr.net>
2025-09-25 15:10:13 +00:00
Alexander Akhmetov 89b988ca55
Alerting: Add Assistant enrichment type (#111592) 2025-09-25 14:16:31 +02:00
Charandas 64c700e563
Provisioning: kind name should be singular (#111570) 2025-09-24 15:25:41 -07:00
Costa Alexoglou 0c0554da5e
fix: avoid child paths in repositories (#111573)
* fix: avoid child paths in repositories

* add another unit test; fix linter

* Update pkg/registry/apis/provisioning/register.go

* skip itself

* fix: failing tests

---------

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-09-24 21:35:06 +00:00
Ryan McKinley a4dabc31ed
Folders: let unified storage handle authorization (#110825) 2025-09-24 16:26:47 +03:00
Igor Suleymanov 7aed0da22c
Add a CI step for checking app SDK codegen status (#111528)
* Add a CI step for checking app SDK codegen status

What

This commit adds a CI step for checking the status of code generated
with Grafana App SDK. The step fails if there is a git diff as a result
of the codegen step.

It also updates generated code to make sure we're starting from a
correct state.

Why

This ensures that when the schemas or the SDK version are updated, the
codegen mismatch is caught early at the PR stage.

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

* Format generated code

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

---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
2025-09-24 15:37:57 +03:00
Ivan Ortega Alba a72e02f88a
Fix dashboard migration discrepancies between backend and frontend implementations (use `toEqual`) (#110268)
**Highlights**

* **Single-version migrations**: add `targetVersion` to migrator & model, separate outputs, enforce exact version.
* **Datasource fixes**: include `apiVersion` in tests, empty-string → `{}`, preserve `{}` refs, drop unwanted defaults.
* **Panel defaults & nesting**: only top-level panels get defaults; preserve empty `transformations` context-aware; filter repeated panels.

* **Migration parity**

  * V16: collapsed rows, grid height parsing (`px`).
  * V17: omit `maxPerRow` when `minSpan=1`.
  * V19–V20: cleanup defaults (`targetBlank`, style).
  * V23–V24: template vars + table panel consistency.
  * V28: full singlestat/stat parity, mappings & color.
  * V30–V36: threshold logic, empty refs, nested targets.
* **Save-model cleanup**: replicate frontend defaults/filtering, drop null IDs, metadata, unused props.
* **Testing**: unified suites, dev dashboards (v42), full unit coverage for major migrations.

Co-authored-by: Ivan Ortega [ivanortegaalba@gmail.com](mailto:ivanortegaalba@gmail.com)
Co-authored-by: Dominik Prokop [dominik.prokop@grafana.com](mailto:dominik.prokop@grafana.com)
2025-09-24 12:20:25 +02:00
Yuri Tseretyan 896a56ada8
Migrate Alerting Notifications API to app installer (#109309)
* migrate to new manifest format
* rename app to alerting.notifications to not conflict with rules
* disable custom field selectors as they are not supported in appinstaller
2025-09-23 09:42:40 -04:00
Stephanie Hingtgen 8b1caccc72
Provisioning: Add metrics for repo controller (#111450) 2025-09-22 20:14:03 +00:00
Stephanie Hingtgen bd550d2f06
Provisioning: Wire up prometheus (#111444) 2025-09-22 09:54:50 -05:00
dependabot[bot] a8e900ed9b
Bump github.com/google/wire from 0.6.0 to 0.7.0 (#111281)
* Bump github.com/google/wire from 0.6.0 to 0.7.0

Bumps [github.com/google/wire](https://github.com/google/wire) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/google/wire/releases)
- [Commits](https://github.com/google/wire/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: github.com/google/wire
  dependency-version: 0.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* update wire

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-09-21 15:36:24 +00:00
Stephanie Hingtgen 15ee224da5
Provisioning: Allow disabling of image rendering instance wide (#111359) 2025-09-19 12:40:14 +03:00
Misi c012a95fa1
IAM: Add role to User (#111256)
* codegen fix

* Return user role from the legacy store

* Lint

* Add tests, gen openapi

* make generate

* revert go.mod, go.sum, go.work.sum changes

* Update go.mod and go.sum
2025-09-19 11:12:00 +02:00
Cory Forseth b8f5effd85
Feat/add zanzana apiserver args (#111278)
* initialize permissionstore if ignoring legacy storage

* pass through feature toggles

* extract repeated logic to method

* remove extra TODOs

* workspace
2025-09-18 16:17:05 -05:00
Stephanie Hingtgen cb11bc15fa
Provisioning: Allow disabling of instance sync (#111270)
---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2025-09-18 10:40:02 -05:00
Mihai Turdean aaa8094a53
Add more metrics to the IAM Folder Reconciler (#111275)
* Add more metrics to the operator

* Add namespace when logging metrics

* Skip flaky test
2025-09-18 09:03:32 -06:00
Alexander Zobnin 72d212c5f9
Authlib: Update authz client to use zookies (#111291)
* Authlib: Update authz client to use zookies

* fix zookie return

* fix linter
2025-09-18 16:24:22 +02:00
Haris Rozajac 0aa5dee86a
Dashboard Migrations: Report metrics when migration fails (#111212)
* return migration error when running a conversionFunc

* fix tests
2025-09-18 08:11:15 -06:00
Levente Balogh 9d822646dd
Dashboards: Remove the `showInControlsMenu` prop from the variable models (#111287)
* refactor: remove the `showInControlsMenu` prop from variable models

* fix: remove property from generated openapi
2025-09-18 13:16:30 +00:00
Mihai Doarna 9d9dca3208
IAM: Adds the team creation endpoint in app platform (#111003)
* implement team creation for legacy store

* add generated code

* add basic integration test

* add new fields to get and list teams

* fix sql tests for teams

* register dual writer for team resource

* add generated code

* add more sql tests for team creation

* address feedback

* add integration tests
2025-09-18 14:43:07 +03:00
Kristina a6db37c2b7
Correlations: Create first version of correlations on app platform (#110843)
* WIP

* Generate API

* use different logging, change typing as recommended

* Add feature flag and only add to installer when enabled

* add codeowner

* Lint/fmt

* fix dockerfile

* move from UID to group/name reference

* add generated code

* change from enterprise build

* build workspace

* Remove deprecated field, build api, build for enterprise, build workspace

* Not sure what caused this..

* Rebuild?

* Fix this file

* update sdk

* update sdk

* fix workspace

* fix test build

* add to go.mod

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-09-17 08:07:45 -05:00
Costa Alexoglou 0248a393d7
fix: dashboard upsert with empty ref (#111190)
* fix: dashboard upsert with empty ref

* chore: cleanup

* fix: branches in other git providers and linter
2025-09-17 11:49:15 +02:00
Stephanie Hingtgen c85776614e
App sdk: Update to v0.45.0 (#111222) 2025-09-17 09:03:30 +03:00
Alex Khomenko 571b3226ba
Dashboard search: Return description in search results (#110857)
* DashList: Add description

* Support unified storage

* Support unified storage[2]

* Exclude description from field

* Cleanup

* add description

* Revert dashlist changes

* Update cue

* Fix test

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-09-16 18:17:22 +03:00
Yuri Tseretyan 356521c9b9
Alerting: Annotation CanUse for receiver resource (#110839)
* add origin to receiver
* populate origin of the receiver
* set CanUse to false if origin is not Grafana
* set provenance if origin is imported
* set Grafana origin by default in conversion API
* set canUse annotation
* reject update\delete operations on resources with origin other than Grafana
* fail to create with wrong origin
2025-09-16 09:32:04 -04:00
Jo 321c3f8ec1
Authorization: update OpenFGA (#111094)
update openfga to v1.10
2025-09-16 13:23:46 +02:00
Ryan McKinley 0a79b3bdc5
Chore: Upgrade k8s.io/api v0.34.1 and grafana-app-sdk v0.43.1 (#111009) 2025-09-16 13:35:20 +03:00
Alexander Zobnin 38e5298807
Authz: Skip cache in List request if option provided (#110864)
* Authz: Skip cache in List request if option provided

* return timestamp with list response

* update authlib

* add skipCache option test

* refactor

* fix tests

* update workspaces

* Set zookies depending on cache hit

* update workspaces

* Fix nil pointer
2025-09-16 11:27:07 +02:00
Will Browne b154763d04
Chore: Bump `prometheus/client_golang` to v1.23.2 (#111123)
bump prometheus/client_golang to v1.23.2
2025-09-16 09:26:50 +01:00
Bruno c61624ad3c
Query caching: add request deduplication middleware (#110892)
* secrets: update test to accept []byte(nil) and []byte{} (#110630)

Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>

* Query caching: add request deduplication middleware

* log error if unable to build cache key

* remove TODO

* always use req.PluginContext.DataSourceInstanceSettings.UID

* make update-workspace

---------

Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
2025-09-15 12:07:47 -03:00
Ryan McKinley a5bd313f5a
ShortURL: Implement /goto with a sub-resource (#110972) 2025-09-15 16:56:20 +03:00
Will Browne 2df39fc71a
Plugins: Add metrics for fs + cloud provisioning info (#111030)
* add new metrics for plugin fs + cloud provisioning

* fix test

* update label
2025-09-15 14:54:16 +01:00
Alexander Zobnin 294fd943c0
Chore: Update authlib (#110880)
* Chore: Update authlib

* exclude incompatible version of github.com/grafana/gomemcache

* Update go-jose to v4

* fix jose imports

* remove jose v3 from go.mod

* fix tests

* fix serialize

* fix failing live tests

* add v1 of ES256 testkeys. Port tests to use ES256 instead of HS256

* accept more signature algs for okta and azuread

* azure social graph token sig

* accept more signature algs for oauth refresh and jwt auth

* update workspace

* add a static signer for inproc

* rebase and fix ext_jwt

* fix jwt tests

* apply alex patch on gomemcache

* update linting

* fix ext_jwt panic

* update workspaces

---------

Co-authored-by: Jo Garnier <git@jguer.space>
2025-09-15 12:45:15 +02:00
Ryan McKinley afc08dbbbc
Chore: go.mod updates (#110957) 2025-09-15 09:01:45 +00:00
Moustafa Baiou cb7abbaa0f
Alerting: Rename expression elements of Rules APIs (#110914)
This renames `data` to `expressions` for clarity in the rules apis.

Also makes certain fields that are redundant optional in the case of pure expressions, so that users don't have to specify them when they are not needed (e.g. not datasource queries).
2025-09-12 22:15:55 +00:00
Haris Rozajac de01b3e209
Dashboard Schema V2: Support panel actions (#110842)
* support panel actions

* refactor

* add test; move action transformer to utils

* refactor so v2 headers and queryParams are just a simple record

* update open api

* update actions to be same shape accross all dashboard schemas and add validation on the backend

* cleanup

* update snapshot

* add tests to validation
2025-09-12 11:31:05 -06:00
Daniele Stefano Ferru 1f7afc6b6a
Provisioning: add unit and integration tests for finalizer validation (#111012)
* Add unit testS

* add integration tests
2025-09-12 13:57:31 +02:00