Commit graph

70 commits

Author SHA1 Message Date
Austin Pond
3ed58adf59
[chore] Update go to v1.26.0, and the golangci-lint action to v9 (#118436)
* [chore] Update go to v1.26.0, and the golangci-lint action to v9.

* Use golangci-lint v2.9.0

* Use golang:1.26.0-alpine instead of 1.25.7-alpine

* chore: more go version upgrades

* chore: more updates

* chore: generate apis

* fix: golint issues prealloc etc

* fix: million tiny golint issues

---------

Co-authored-by: konsalex <konstantinos.alexoglou@grafana.com>
2026-02-19 15:04:35 +01:00
Matheus Macabu
b0a78233c8
CloudMigrations: Fix flaky test query status with sync (#118236) 2026-02-17 09:18:50 +01:00
Matheus Macabu
0c965a9cb1
CloudMigrations: Remove feature toggle and introduce config setting to disable it (#114223) 2025-11-24 14:15:23 +01:00
Matheus Macabu
7dbacddb18
CloudMigrations: Check contact point permissions before fetching it (#113159) 2025-10-29 15:08:43 +01:00
Matheus Macabu
6158167163
CloudMigrations: Increase timeout of eventual checks and add debug message (#112714) 2025-10-21 12:58:29 +02:00
Matheus Macabu
601f7cda34
CloudMigrations: Increase timeout of eventual checks and add debug message in flaky test (#112042)
* CloudMigrations: Remove unused param in test setup

* CloudMigrations: Increase timeout of eventual checks and add debug message
2025-10-06 10:31:30 +02:00
Lucy Chen
be9ce8a5ff
CloudMigration: Fix flakey test (#111126)
* fix flakey test

* remove skip

* change require
2025-09-16 12:39:14 +00:00
Bruno
3b8ea08ad7
skip Test_GetSnapshotStatusFromGMS (#111122) 2025-09-15 16:45:46 +00:00
lean.dev
c52eedbf23
CloudMigration: fix flacky test (#111046) 2025-09-12 19:46:11 +00:00
lean.dev
b1a059ac4e
CloudMigrations: wrap assert in EventuallyWithTf in case async sync hasnt finished (#110777)
* CloudMigrations: wrap assert in EventuallyWithTf in case async sync hasnt finished

* fix

* fix
2025-09-09 12:05:10 +01:00
Stephanie Hingtgen
1f025fe1a3
K8s: Remove kubernetesClientDashboardsFolders feature flag (#108626) 2025-07-29 16:52:57 -05:00
Bruno
b1592b5e36
Cloud migrations: store snapshots in the database (#108551)
* Cloud migrations: store snapshots in the database

* update github.com/grafana/grafana-cloud-migration-snapshot to v1.9.0

* make update-workspace

* use new field name in test

* return error after call to fmt.Errorf

* create methods for readability / fix session deletiong not deleting snapshots

* remove debugging changes

* update sample.ini

* update tests to include OrgID in ListSnapshotsQuery

* lint

* lint

* Update pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt.go

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

* remove TODO

* Update pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt.go

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

* remove one of the debug logs

---------

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-07-25 11:41:21 -03:00
Alexander Akhmetov
e92baba748
Alerting: Support PDC in Grafana-managed recording rules (#106677) 2025-06-17 11:46:34 +02:00
Matheus Macabu
90c4868c8c
CloudMigrations: Add test case for invalid permissions to fetch contact points (#106143) 2025-06-09 09:49:46 +02:00
Stephanie Hingtgen
4918d8720c
Dashboard Restore: Remove experimental functionality under feature flag dashboardRestore for now - this will be reworked (#103204) 2025-04-03 02:52:54 -05:00
Michael Mandrus
88e51d549c
CloudMigrations: Add sorting and error filtering to Snapshot Results backend (#102753)
* implement sorting

* swagger gen

* minor fixes

* clean up param reading

* add todo

* add errors only prop

* codegen stuff

* fix copy paste error

* forgot the api gen

* cleanup

* remove tests that are obe

* fix test
2025-03-30 10:42:45 -04:00
Matheus Macabu
9c0c9359a0
CloudMigrations: Refactor folder name resolution when fetching migration json data (#102604)
* CloudMigrations: Refactor folder name resolution when fetching migration json data

* Update pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt.go

---------

Co-authored-by: Michael Mandrus <41969079+mmandrus@users.noreply.github.com>
2025-03-24 08:17:11 +01:00
Matheus Macabu
5917ed8227
Hackaton: Add more unit tests, take 4 (#101704)
* cloudmigration/cloudmigrationimpl: run integration tests in parallel

* tsdb/mysql: run tests with actual service and instance manager

* pluginsintegration/angulardetectorsprovider: reduce job interval in test

* util: extract test that should only be ran with -race enabled and unskip it
2025-03-07 14:06:47 +01:00
Matheus Macabu
fde475e3d9
CloudMigrations: save snapshot of alert rule groups (#100109) 2025-02-06 12:35:59 +01:00
Yuri Tseretyan
d71904cb27
Alerting: Expose updated_by in rules GET APIs (#99525)
---------

Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2025-01-27 14:31:40 -05:00
Michael Mandrus
c9d22f06c3
CloudMigrations: Bulk update local resources (#96002)
* wip

* make tests pass

* get all tests passing

* fixes

* some small cleanup

* fix test

* convert delimiter keys to struct keys

* dont execute empty sql statement

* remove printlns

* fix unit test

* a bit more cleanup

* whoops
2025-01-10 14:42:18 -05:00
Matheus Macabu
3958fb9e0a
CloudMigrations: Introduce RBAC role for migration assistant (#98588)
* CloudMigrations: delete unused code

* CloudMigrations: add access control and protect API + navtree with action

* CloudMigrations: register access control roles

* CloudMigrations: gate frontend based with access control

* CloudMigrations: fix api tests

* CloudMigrations: add docs on new actions and roles

* CloudMigrations: dont interpolate vars to make it more greppable

* CloudMigrations: run prettier
2025-01-09 06:03:42 +02:00
Stephanie Hingtgen
69adb3d25b
Tests: Fix dashboard mock (#98647) 2025-01-08 00:20:35 +02:00
Stephanie Hingtgen
58ed8a9ec2
Cloud migration: Refactor get by org ID to dashboard svc (#98646) 2025-01-07 23:33:45 +02:00
Dana Axinte
1699dfa307
CloudMigrations: Add support for migration of plugin resources (#95612)
* start plugins migration

* more plugin work

* add warning

* fakepluginsettings test

* tests get plugins

* lint

* load logos

* go lint

* get all plugins once

* locales

* josh suggestion to inject query in rtk

* more plugin filters

* remove datasource warning

* access control for plugins

* remove unused method

* lint

* use gcom list
2025-01-06 10:37:15 +00:00
Matheus Macabu
c824f5b9bf
CloudMigrations: Add config for alert rules state behavior and remove experimental feature toggle on alerts migration (#97254)
* CloudMigrations: add config for controlling alert rules state behavior

* CloudMigrations: remove experimental 'onPremToCloudMigrationsAlerts' feature toggle
2024-12-17 12:56:18 +01:00
Matheus Macabu
1bf35c97e5
CloudMigrations: fix flaky test on snapshot status (#96827)
* cloudmigration: uncomment flaky test

* cloudmigration: refactor test snapshot status
2024-11-25 09:28:00 +01:00
Roberto Jiménez Sánchez
7bfaf2a7bf
[Cloud Migrations] Fix panic in unit tests (#96389)
* Fix panic in unit test

* Reset mock to new one between tests
2024-11-13 16:06:32 +02:00
Matheus Macabu
29ee90bc26
CloudMigrations: add parent folder name to alert rule resource (#96366) 2024-11-13 12:20:56 +01:00
Dana Axinte
924b0d0863
CloudMigration: Add user uid to on prem event collection (#94804)
* add useruid to report events

* test
2024-11-13 11:07:00 +00:00
lean.dev
750a0bed71
MigrationAssistant: Restrict dashboards, folders and datasources by the org id of the signed in user (#96339)
apply security patch: main/206-202410241510.patch
2024-11-12 13:03:16 -06:00
Roberto Jiménez Sánchez
7f99e943a6
Do not use the span recorder in test (#96324) 2024-11-12 17:55:53 +01:00
Roberto Jiménez Sánchez
fde9ddfc8c
[Cloud Migration] Skip flaky cloud migration unit test (#96256)
Skip Flaky Cloud Migration test
2024-11-12 11:08:35 +01:00
Roberto Jiménez Sánchez
477326b9c3
[CloudMigrations] Fetch cloud migration status asynchronously (#96084)
* Single go-routine without touching too many lines.
* Fix unit tests
* Use require for Eventually
* Use a 10 second internal to poll for new results.
2024-11-11 19:26:30 +01:00
Fayzal Ghantiwala
1fdc48faba
Alerting: Make context deadline on AlertNG service startup configurable (#96053)
* Make alerting context deadline configurable

* Remove debug logs

* Change default timeout

* Update tests
2024-11-07 18:23:55 +00:00
Zoltán Bedi
85c696c4ad
SQL: Add macro support in select case (#88514)
* Feat: timeGroup macro handling in VQB

* Add tests

* Add functions to SQL ds

* Fix lint errors

* Add feature toggle

* Add rendering based on object

* Fix lint

* Fix CI failures

* Fix tests

* Address review comments

* Add docs

* Fix JSX runtime warnings

* Remove docs part that mentions suggest more macros

* Update docs/sources/shared/datasources/sql-query-builder-macros.md

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>

* Add smoke test for this feature

* lint

* Add supported macros to influx

* Add setupTests.ts to include in tsconfig.json

* Import jest-dom instead of setupTests.ts

---------

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2024-11-04 17:13:35 +01:00
Matheus Macabu
b2de69d741
CloudMigrations: create snapshot for Alert Rules (#95404)
* CloudMigrations: create snapshot for Alert Rules

* CloudMigrations: display Alert Rules in resource list summary
2024-10-25 17:20:05 +02:00
Matheus Macabu
47115c714a
CloudMigrations: create snapshot for Contact Points (#94719)
* CloudMigrations: create snapshot for Contact Points

* CloudMigrations: add contact point copies and components in frontend

* CloudMigrations: temporarily use bell for all alerts resources
2024-10-15 16:27:28 +02:00
Matheus Macabu
016dea1143
CloudMigrations: create snapshot for Notification Templates (#94676)
* CloudMigrations: create snapshot for Notification Templates

* CloudMigrations: add notification templates resource to frontend
2024-10-15 12:55:33 +02:00
Matheus Macabu
081ec57443
CloudMigrations: create snapshot for Mute Timings (#94668)
* CloudMigrations: Create snapshot for Mute Timings

* CloudMigrations: add mute timings icon and copies to frontend
2024-10-15 09:44:41 +02:00
William Wernert
19a9a79467
Alerting: Publish event when one or more rules are created or changed (#93637)
* Publish event when one or more rules are changed

* Publish affected rules

* Use a fake bus to test publish event without listening

* Wire alerting store into provisioning service
2024-10-11 12:19:52 -04:00
Matheus Macabu
96384b5181
CloudMigrations: cover cases where library panel has no folder (#94405) 2024-10-08 15:14:23 +02:00
Matheus Macabu
6bd2f9f3ea
CloudMigrations: remove duplicated import on test (#94322) 2024-10-07 15:32:52 +03:00
Matheus Macabu
e89aef57cb
CloudMigrations: wire ngalert to cloud migration service and add slicesext.Map helper (#94254)
* CloudMigrations: add slicesext.Map function to simplify dto creation

* CloudMigrations: wire ngalert to cloud migration service
2024-10-07 12:53:14 +02:00
Dana Axinte
d88be2819d
CloudMigrations: Store parent folder name in cloud_migration_resource table (#94009)
* use name in fe

* store parent folder name in local db

* clean up

* tiny test

* trial react

* rename to parent name

* go lint

* generate api and ts

* go tests

* rearrange

* clean

* update with suggestions from josh

* make library elements work

* updates from comments

* global migration types

* parent name for alter table
2024-10-07 11:35:08 +01:00
Roberto Jiménez Sánchez
19c77eaae1
CloudMigrations: Fix traceability & HTTP Client initialisation (#94141)
* Add traceability to Migration Assistant feature

* Fix some compilation errors

* Fix lint issues

* Use async context

* Add trace for LibraryElements
2024-10-07 11:31:45 +02:00
Matheus Macabu
1635a3cd67
CloudMigrations: Add support for migration of Library Elements (Panels) resources (#93898)
* CloudMigrations: create snapshots of Library Elements

* CloudMigrations: render library element resource in resources table

* CloudMigrations: create newtype with necessary fields for library element creation
2024-10-03 11:54:54 +02:00
Michael Mandrus
1c648fd010
Chore: Fix flaky cloud migration test (#94035)
* attempt to fix flaky test

* remove skip from test
2024-10-01 03:24:47 +01:00
Bruno
6f92fd64ce
Cloud migrations: add more context to errors (#93814)
* Cloud migrations: add more context to errors

* calls to assert.ErrorIs was passing arguments in the wrong order
2024-09-30 09:57:25 -03:00
Bruno
1b7cd4c684
Cloud migrations: store resource name in the cloud_migration_resource table (#93612)
* Cloud migrations: store resource name in the cloud_migration_resource table

* remove unused function: convertMigrateDataResponseToDTO

* make swagger-clean && make openapi3-gen

* use DB_Text for cloud_migration_resource.name instead of DB_Varchar
2024-09-26 11:16:52 -03:00