* Chore: Remove global bus variable (#50765)
* Chore: Remove global bus variable
* fix bus in tests
(cherry picked from commit 0b55c41d05)
* fix the imports
* Algorithm to fix up receivers
* Extract for tests
* Add tests, fix bug
* Add test which demonstrates how it fixes up broken groups
* Fix package prefix
(cherry picked from commit 9bbfeedadf)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
* use etag header for previews
* use unix millis rather than tz-dependant string
(cherry picked from commit 644503f5e6)
Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
* backend/api: refactor PlaylistId to PlaylistUid
* Add org_id to Get and Update playlist functions
Fix migration - no longer pad the uid; fix mysql syntax
The relevant tests are passing using postgres, mysql and the default sqllite backends, but there are a number of other failing tests when using postgres and myself so I'm not entirely confident with those results.
* fix bad query in GetPlaylistItem and add a test that would have caught the mistake in the first place. Reverted the playlist_uid column addition in playlist_item; it became unnecessary after this PR.
Added default value to the new UID column based on PR feedback.
* break this PRs migration into its own function
* Playlists: Update UI to use the updated API
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
(cherry picked from commit a33a023629)
Co-authored-by: Kristin Laemmert <mildwonkey@users.noreply.github.com>
* Make inheritance permission migration more robust
* Better fix
* Add more tests to the migration
* Add removed test case
* Add test case for empty role in empty org
* Handling the role.ID 0 case with a log
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
(cherry picked from commit 307a0d4538)
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* AzureMonitor: tweak experimental-ui after UX discussions.
- move metrics up to resource row
- allow resources field to take an inlineField prop and a labelWidth prop. Eventually once the feature toggle is removed
the inlineField prop will be the only code branch in Field.tsx.
* AzureMonitor: remove devmode req for azureMonitorExperimentalUI flag
* refactor: consolidate logic branch for inline Field
(cherry picked from commit 5df694b924)
Co-authored-by: Adam Simpson <adam@adamsimpson.net>
* Alerting: Schedule Alert rules metric tracking
Change the record of metrics from one place to two as an attempt to have a semi-accurate record.
(cherry picked from commit c59938b235)
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* Alerting: decapitalize log lines and use "err" as the key for errors
Found using (logger|log).(Warn|Debug|Info|Error)\([A-Z] and (logger|log).(Warn|Debug|Info|Error)\(.+"error"
(cherry picked from commit 0cde283505)
* Alerting: Add RBAC actions and role for provisioning API routes (#50459)
* add alert provisioning actions and role
* linter
(cherry picked from commit 54fa04263b)
* Fix cherry-pick conflict in rbac-fixed-basic-role-definitions.md
Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
* Updates to all except alert rules
* Return 400 when rules fail to validate, add testinfra
* More sane package aliases
* More package alias renames
* One more bug in contact point validation
* remove unused function
Co-authored-by: Jean-Philippe Quémémer <jeanphilippe.quemener@grafana.com>
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
(cherry picked from commit 7dd78fee2c)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
After migrating to unified alerting, users must explicitly allow rolling
back to legacy alerting by setting force_migration = true in config.
This updates the panic message to clarify why that's required and what
the consequences of rolling back will be.
Fixes#50469
(cherry picked from commit 30f035ca34)
Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
The ng_alert_notification email template did not include templating for
linked or embedded images. This change updates that.
Additionally, this change supports embedding an image for each alert in
an email batch.
Fixes#50315
(cherry picked from commit ecf080825e)
This PR renames the configuration key enabled to capture. This is needed as we already have a configuration key with the name enabled.
Fixes#50328
(cherry picked from commit fd664e4beb)
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
* Alerting: remove feature toggle for provisioning API
* remove missed code parts
* remove unused import
* remove empty line
* mark routes as stable
(cherry picked from commit 4b8a4449ed)
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
* Add migration
* Migrator: Extend support to rename columns
* Fix getting current key
* Fix column name in migration
* Fix deks reencryption
* Fix caching
* Add back separate caches for byName and byPrefix
* Do not concatenate prefix with uid
* Rename DataKey struc fields
* SQLStore: Add deprecation comments for breaking migrations
* Add comment
* Minor corrections
Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
(cherry picked from commit 4f8111e24e)
Co-authored-by: Tania <yalyna.ts@gmail.com>
* Alerting: only delete mute time if not used by route
* add a testcase
* import package only once
* replace apimodels with definitions
(cherry picked from commit 8de4ffe61f)
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>