oncall-engine/engine/apps
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
..
alerts Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
api Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
api_for_grafana_incident Add render_for_web information to alert group incident API (#3005) 2023-09-12 12:02:42 +00:00
auth_token Add more logging to plugin sync and install (#3730) 2024-01-23 22:59:33 +00:00
base make mobile app notification title and subtitle templatable (#3845) 2024-02-08 17:23:15 -05:00
email Change email templating to not wrap user defined templates (#3862) 2024-02-09 19:03:25 +00:00
grafana_plugin Enable labels feature only if labels plugin is enabled (#3769) 2024-01-30 07:29:16 +00:00
heartbeat Improve OpenAPI schema coverage (#3629) 2024-01-12 15:11:22 +00:00
integrations add pytest-xdist to speed up backend tests (#3839) 2024-02-05 16:04:15 -05:00
labels Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
metrics_exporter Add transaction on_commit before signals for alert group actions (#3731) 2024-01-31 15:54:50 -07:00
mobile_app Fix rounding issue with displayed time when sending "You're going oncall" push notification (#3872) 2024-02-09 15:31:34 -05:00
oss_installation Improve OpenAPI schema coverage (#3629) 2024-01-12 15:11:22 +00:00
phone_notifications Revert "upgrade to Python 3.12 (#3456)" and "bump uwsgi version to latest #3466" (#3483) 2023-12-01 09:56:26 -05:00
public_api Restrict integration name uniqueness per team (#3863) 2024-02-12 11:40:08 +00:00
schedules Refactor gaps and empty shift checks (#3785) 2024-01-31 15:25:06 +01:00
slack Check for permissions on Slack escalate command (#3891) 2024-02-14 19:02:09 +00:00
social_auth Don't check chatops gateway link in OSS deployment (#3893) 2024-02-14 13:15:04 +00:00
telegram Handle ag telegram message does not exist (#3830) 2024-02-05 12:19:41 +00:00
twilioapp add missing db migrations + add additional backend db migration check to CI (#3234) 2023-10-31 16:00:55 -04:00
user_management Fix grafana_labels sync 2024-02-01 13:43:32 +08:00
webhooks Add status change trigger type to webhooks (#3920) 2024-02-19 14:12:56 -03:00
zvonok Improve zvonok verification call (#3768) 2024-02-08 14:05:11 -05:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00