grafana/pkg/tests
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
..
api Alerting: Fix simplified routes '...' groupBy creating invalid routes (#86006) 2024-04-16 12:14:39 -04:00
apis Chore: Replace sqlstore with db interface (#85366) 2024-04-04 15:04:47 +02:00
testinfra Chore: Replace sqlstore with db interface (#85366) 2024-04-04 15:04:47 +02:00
testsuite Chore: Update test database initialization (#81673) 2024-02-09 09:35:39 -05:00
web Session: set authID and authenticatedBy (#85806) 2024-04-11 10:25:29 +02:00
README.md Chore: Add CloudWatch HTTP API tests (#29691) 2021-01-07 11:36:13 +01:00
utils.go Chore: Replace sqlstore with db interface (#85366) 2024-04-04 15:04:47 +02:00

Integration tests

This directory contains Grafana server integration tests.