grafana/pkg/tests/api/alerting
Matthew Jacobson 533bed6d94
Alerting: Fix simplified routes '...' groupBy creating invalid routes (#86006)
* Alerting: Fix simplified routes '...' groupBy creating invalid routes

There were a few ways to go about this fix:
1. Modifying our copy of upstream validation to allow this
2. Modify our notification settings validation to prevent this
3. Normalize group by on save
4. Normalized group by on generate

Option 4. was chosen as the others have a mix of the following cons:
- Generated routes risk being incompatible with upstream/remote AM
- Awkward FE UX when using '...'
- Rule definition changing after save and potential pitfalls with TF

With option 4. generated routes stay compatible with external/remote AMs, FE
doesn't need to change as we allow mixed '...' and custom label groupBys, and
settings we save to db are the same ones requested.

In addition, it has the slight benefit of allowing us to hide the internal
implementation details of `alertname, grafana_folder` from the user in the
future, since we don't need to send them with every FE or TF request.

* Safer use of DefaultNotificationSettingsGroupBy

* Fix missed API tests
2024-04-16 12:14:39 -04:00
..
test-data Alerting: Fix simplified routes '...' groupBy creating invalid routes (#86006) 2024-04-16 12:14:39 -04:00
api_admin_configuration_test.go Chore: Replace sqlstore with db interface (#85366) 2024-04-04 15:04:47 +02:00
api_alertmanager_configuration_test.go Chore: Replace sqlstore with db interface (#85366) 2024-04-04 15:04:47 +02:00
api_alertmanager_test.go Alerting: Update grafana/alerting and use Upsert for creating silences (#85676) 2024-04-08 11:46:14 +02:00
api_available_channel_test.go Chore: Replace sqlstore with db interface (#85366) 2024-04-04 15:04:47 +02:00
api_backtesting_data.json
api_backtesting_test.go Chore: Replace sqlstore with db interface (#85366) 2024-04-04 15:04:47 +02:00
api_notification_channel_test.go Chore: Replace sqlstore with db interface (#85366) 2024-04-04 15:04:47 +02:00
api_notifications_time_interval_test.go Chore: Replace sqlstore with db interface (#85366) 2024-04-04 15:04:47 +02:00
api_prometheus_test.go Chore: Replace sqlstore with db interface (#85366) 2024-04-04 15:04:47 +02:00
api_provisioning_test.go Chore: Replace sqlstore with db interface (#85366) 2024-04-04 15:04:47 +02:00
api_ruler_test.go Alerting: Fix simplified routes '...' groupBy creating invalid routes (#86006) 2024-04-16 12:14:39 -04:00
api_testing_test.go Chore: Replace sqlstore with db interface (#85366) 2024-04-04 15:04:47 +02:00
testing.go Alerting: Support for simplified notification settings in rule API (#81011) 2024-02-15 09:45:10 -05:00