oncall-engine/engine/apps/alerts/models
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
..
__init__.py Remove unnecessary signal (#2030) 2023-07-25 07:21:41 +00:00
alert.py Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
alert_group.py Add transaction on_commit before signals for alert group actions (#3731) 2024-01-31 15:54:50 -07:00
alert_group_counter.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
alert_group_log_record.py Add transaction on_commit before signals for alert group actions (#3731) 2024-01-31 15:54:50 -07:00
alert_manager_models.py Enable flake8-bugbear, fix issues (#3454) 2023-11-29 15:04:48 +00:00
alert_receive_channel.py Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
channel_filter.py Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
custom_button.py re-enable mypy GitHub Actions CI job (#2390) 2023-06-29 14:01:52 +00:00
escalation_chain.py re-enable mypy GitHub Actions CI job (#2390) 2023-06-29 14:01:52 +00:00
escalation_policy.py Update escalation step wording (#3854) 2024-02-08 15:04:35 +00:00
grafana_alerting_contact_point.py Improve getting/updating contact points for Grafana Alerting integration (#2742) 2023-08-18 12:12:29 +02:00
invitation.py Trigger alert group signal after transaction commit (#3001) 2023-09-11 14:28:37 +00:00
maintainable_object.py Improve OpenAPI schema coverage (#3629) 2024-01-12 15:11:22 +00:00
resolution_note.py Resolution note source mobile app (#3174) 2023-10-20 15:22:45 +01:00
user_has_notification.py World, meet OnCall! 2022-06-03 08:09:47 -06:00