oncall-engine/engine/apps/alerts
Innokentii Konstantinov acd0c44c33
Support prescribed labels (#3848)
# What this PR does

**Cleanup label typing:**
1. LabelParam -> two separate types LabekKey and LabelValue 
2. LabelData -> renamed to LabelPair. 
3. LabelKeyData -> renamed to LabelOption
Data is not giving any info about what this type represents. 
4. Remove LabelsData and LabelsKeysData types. They are just list of
types listed above and with new naming it feels obsolete.
5. ValueData removed. LabelPair is used instead.
6. Rework AlertGroupCustomLabel to use LabelKey type for key to make
type system more consistent. Name model type AlertGroupCustomLabel**DB**
and api type AlertGroupCustomLabel**API** to clearly distinguish them.

**Split update_labels_cache into two tasks** update_label_option_cache
and update_label_pairs_cache.
Original task was expecting array of LabelsData (now it's LabelPair) OR
one LabelKeyData ( now it's LabelOption). I believe having one function
with two sp different argument types makes it more complicated for
understanding.


**Make OnCall backend support prescribed labels**. OnCall will sync and
store "prescribed" field for key and values, so Label dropdown able to
disable editing for certain labels.

## Which issue(s) this PR fixes

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)

---------

Co-authored-by: Maxim Mordasov <maxim.mordasov@grafana.com>
Co-authored-by: Yulya Artyukhina <Ferril.darkdiver@gmail.com>
2024-02-20 14:42:51 +08:00
..
escalation_snapshot Speed up escalation auditor (#3578) 2023-12-18 12:28:55 +00:00
grafana_alerting_sync_manager Revert "upgrade to Python 3.12 (#3456)" and "bump uwsgi version to latest #3466" (#3483) 2023-12-01 09:56:26 -05:00
incident_appearance make mobile app notification title and subtitle templatable (#3845) 2024-02-08 17:23:15 -05:00
incident_log_builder WIP: Direct paging improvements (#3064) 2023-09-28 03:57:49 +00:00
migrations Alertmanager V2 migration prep (#3722) 2024-01-23 10:36:58 +00:00
models Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
tasks Update notification checker (#3818) 2024-02-01 15:42:43 +00:00
tests Update notification checker (#3818) 2024-02-01 15:42:43 +00:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
constants.py Public API: Acknowledge & Resolve actions (#3108) 2023-10-05 09:46:48 +01:00
integration_options_mixin.py AlertManager v2 (#2643) 2023-08-01 12:18:52 +08:00
paging.py Add transaction block and callbacks when triggering tasks (#3779) 2024-01-31 09:26:14 -05:00
representative.py apps.get_model -> import (#2619) 2023-07-25 09:43:23 +00:00
signals.py Fix warnings when running backend tests (#2079) 2023-06-06 18:38:00 +00:00
utils.py Enable flake8-bugbear, fix issues (#3454) 2023-11-29 15:04:48 +00:00