oncall-engine/engine/common
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
..
api_helpers Remove unused const 2024-01-24 16:32:58 +08:00
cloud_auth_api update request body to Cloud Auth API POST /v1/sign API call (#3838) 2024-02-05 14:56:48 -05:00
constants remove all references to deprecated AlertGroup.is_restricted field (#3228) 2023-10-31 20:10:45 +00:00
custom_celery_tasks fix infinitely retrying apps.alerts.tasks.notify_user.perform_notification task (#3708) 2024-01-18 07:07:01 -05:00
exceptions Send demo alert with dynamic payload and get demo payload example on private api (#1700) 2023-04-18 02:48:11 +00:00
insight_log Enable flake8-bugbear, fix issues (#3454) 2023-11-29 15:04:48 +00:00
jinja_templater Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
migrations Add instruction on removing nullable fields from Django models (#2659) 2023-08-08 12:46:18 +00:00
oncall_gateway Handle 400 status codes from Chatops Proxy (#3886) 2024-02-13 14:36:49 +08:00
ordered_model Re-enable a few mypy rules + fix existing errors (#2725) 2023-08-03 09:43:03 +00:00
recaptcha Add validation of hostname for recapctha (#1445) 2023-03-06 08:59:48 +00:00
tests Support alert routing based on labels (#3778) 2024-01-30 13:07:19 -05:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
cache.py patch redis cluster multi-key operations (#3496) 2023-12-04 13:08:57 -05:00
database.py Fix Grafana teams sync (#1652) 2023-03-28 18:26:24 +00:00
l10n.py add user locale field to mobile app user settings table + change going on call push notification text (#2131) 2023-06-14 12:19:58 -04:00
public_primary_keys.py Re-enable a few mypy rules + fix existing errors (#2725) 2023-08-03 09:43:03 +00:00
timezones.py shift swap requests model + CRUD endpoints (#2597) 2023-07-21 19:35:19 +00:00
utils.py Don't html escape quotes when rendering (#3884) 2024-02-12 21:10:22 +00:00