grafana/pkg/services/ngalert/api
Alexander Weaver b198559225
Alerting: Extend PUT rule-group route to write the entire rule group rather than top-level fields only (#53078)
* Wire up to full alert rule struct

* Extract group change detection logic to dedicated file

* GroupDiff -> GroupDelta for consistency

* Calculate deltas and handle backwards compatible requests

* Separate changes and insert/update/delete as needed

* Regenerate files

* Don't touch the DB if there are no changes

* Quota checking, delete unused file

* Mark modified records as provisioned

* Validation + a couple API layer tests

* Address linter errors

* Fix issue with UID assignment and rule creation

* Propagate top level group fields to all rules

* Tests for repeated updates and versioning

* Tests for quota and provenance checks

* Fix linter errors

* Regenerate

* Factor out some shared logic

* Drop unnecessary multiple nilchecks

* Use alternative strategy for rolling UIDs on inserted rules

* Fix tests, add back nilcheck, refresh UIDs during test

* Address feedback

* Add missing nil-check
2022-08-10 12:33:41 -05:00
..
test-data Alerting: Modify endpoint for testing a datasource rule using the UID (#48070) 2022-05-17 14:10:20 +03:00
tooling Alerting: Extend PUT rule-group route to write the entire rule group rather than top-level fields only (#53078) 2022-08-10 12:33:41 -05:00
api_alertmanager_guards_test.go Alerting: Add provenance guard to config api (#50147) 2022-06-04 14:55:46 +02:00
api_alertmanager_guards.go Alerting: Add provenance guard to config api (#50147) 2022-06-04 14:55:46 +02:00
api_alertmanager_test.go Move SignedInUser to user service and RoleType and Roles to org (#53445) 2022-08-10 11:56:48 +02:00
api_alertmanager.go Alerting: Code-gen parsing of URL parameters and fix related bugs (#50731) 2022-06-23 15:13:39 -05:00
api_configuration_test.go Move SignedInUser to user service and RoleType and Roles to org (#53445) 2022-08-10 11:56:48 +02:00
api_configuration.go Move SignedInUser to user service and RoleType and Roles to org (#53445) 2022-08-10 11:56:48 +02:00
api_prometheus_test_fixtures.go Alerting: Display query from grafana-managed alert rules on /api/v1/rules (#45969) 2022-03-14 10:39:20 +00:00
api_prometheus_test.go Move SignedInUser to user service and RoleType and Roles to org (#53445) 2022-08-10 11:56:48 +02:00
api_prometheus.go Alerting: Persist rule position in the group (#50051) 2022-06-22 10:52:46 -04:00
api_provisioning_test.go Alerting: Extend PUT rule-group route to write the entire rule group rather than top-level fields only (#53078) 2022-08-10 12:33:41 -05:00
api_provisioning.go Alerting: Extend PUT rule-group route to write the entire rule group rather than top-level fields only (#53078) 2022-08-10 12:33:41 -05:00
api_ruler_test.go Move SignedInUser to user service and RoleType and Roles to org (#53445) 2022-08-10 11:56:48 +02:00
api_ruler_validation_test.go Rename Acl to ACL (#52342) 2022-07-18 15:14:58 +02:00
api_ruler_validation.go Alerting: set dashboard and panel id using annotations in provisioning api (#53221) 2022-08-03 16:05:32 +02:00
api_ruler.go Alerting: Extract alert rule diff logic into separate file with exported API (#53083) 2022-08-01 23:41:23 -05:00
api_testing_test.go Move SignedInUser to user service and RoleType and Roles to org (#53445) 2022-08-10 11:56:48 +02:00
api_testing.go Alerting: Update forking request handlers to use the same errors (#52965) 2022-08-02 09:33:59 -04:00
api.go Alerting: take datasources as external alertmanagers into consideration (#52534) 2022-07-20 16:50:49 +02:00
authorization_test.go Alerting: Extract alert rule diff logic into separate file with exported API (#53083) 2022-08-01 23:41:23 -05:00
authorization.go Alerting: Extract alert rule diff logic into separate file with exported API (#53083) 2022-08-01 23:41:23 -05:00
configuration.go Alerting: Refactor API types generation with different names. (#51785) 2022-07-18 03:08:08 -04:00
errors.go Alerting: Update forking request handlers to use the same errors (#52965) 2022-08-02 09:33:59 -04:00
forking_alertmanager.go Alerting: Update forking request handlers to use the same errors (#52965) 2022-08-02 09:33:59 -04:00
forking_prometheus.go Alerting: Update forking request handlers to use the same errors (#52965) 2022-08-02 09:33:59 -04:00
forking_ruler.go Alerting: Update forking request handlers to use the same errors (#52965) 2022-08-02 09:33:59 -04:00
generated_base_api_alertmanager.go Alerting: Refactor API types generation with different names. (#51785) 2022-07-18 03:08:08 -04:00
generated_base_api_configuration.go Alerting: Refactor API types generation with different names. (#51785) 2022-07-18 03:08:08 -04:00
generated_base_api_prometheus.go Alerting: Refactor API types generation with different names. (#51785) 2022-07-18 03:08:08 -04:00
generated_base_api_provisioning.go Alerting: Extend PUT rule-group route to write the entire rule group rather than top-level fields only (#53078) 2022-08-10 12:33:41 -05:00
generated_base_api_ruler.go Alerting: Refactor API types generation with different names. (#51785) 2022-07-18 03:08:08 -04:00
generated_base_api_testing.go Alerting: Refactor API types generation with different names. (#51785) 2022-07-18 03:08:08 -04:00
lotex_am.go backend/datasources: move datasources models into the datasources service package (#51267) 2022-06-27 12:23:15 -04:00
lotex_prom.go Alerting: modify prometheus endpoints for proxying using the datasource UID (#48052) 2022-05-06 15:05:02 -04:00
lotex_ruler_test.go Move SignedInUser to user service and RoleType and Roles to org (#53445) 2022-08-10 11:56:48 +02:00
lotex_ruler.go Alerting: Code-gen parsing of URL parameters and fix related bugs (#50731) 2022-06-23 15:13:39 -05:00
promql_compat_test.go Alerting/testing promql extraction (#34665) 2021-05-25 11:54:50 -04:00
promql_compat.go Alerting: check upstream response content type in lotex proxy (#34760) 2021-05-27 14:12:29 +03:00
provisioning.go Alerting: Extend PUT rule-group route to write the entire rule group rather than top-level fields only (#53078) 2022-08-10 12:33:41 -05:00
testing_api.go Alerting: Refactor API types generation with different names. (#51785) 2022-07-18 03:08:08 -04:00
testing.go Alerting: Remove mis-behaving fake and fix masked test failure in AM config API (#47747) 2022-04-13 19:31:57 -05:00
util_test.go Alerting: Rename Recipient path parameter to DatasourceID (#47949) 2022-04-20 16:20:17 +03:00
util.go Move SignedInUser to user service and RoleType and Roles to org (#53445) 2022-08-10 11:56:48 +02:00