oncall-engine/engine
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
..
apps Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
common Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
config_integrations Improve template to handle empty group labels (#2794) 2023-08-17 07:52:05 +00:00
engine Add ability to migrate one org (#3809) 2024-02-01 18:25:36 +08:00
settings Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
static/images remove django admin panel (#2731) 2023-08-02 14:26:50 -04:00
type_stubs/icalendar continue addressing mypy violations (#2170) 2023-06-27 10:23:08 +00:00
.dockerignore One startup command to rule them all (#760) 2022-11-07 16:34:43 +01:00
.gitignore modify push notification settings + use fcm-django library (#998) 2022-12-20 12:41:34 +01:00
celery_with_exporter.sh Add flag to debug logs (#912) 2022-11-29 11:16:42 +08:00
conftest.py address occasional failing tests when run w/ pytest-xdist (#3840) 2024-02-06 11:57:54 -05:00
Dockerfile Revert "upgrade to Python 3.12 (#3456)" and "bump uwsgi version to latest #3466" (#3483) 2023-12-01 09:56:26 -05:00
manage.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
pyproject.toml patch occasional UnicodeEncodeError that occurs with outgoing webhooks (#3832) 2024-02-02 21:08:04 +00:00
requirements-dev.txt add pytest-xdist to speed up backend tests (#3839) 2024-02-05 16:04:15 -05:00
requirements.txt Bump django from 4.2.7 to 4.2.10 in /engine (#3853) 2024-02-08 08:36:17 -05:00
tox.ini address occasional failing tests when run w/ pytest-xdist (#3840) 2024-02-06 11:57:54 -05:00
uwsgi.ini Use Tilt for local development (#1396) 2023-09-07 19:38:19 +08:00
wait_for_test_mysql_start.sh Revert "Revert "speed up ci builds from 15 to <7 minutes"" (#1643) 2023-03-28 09:34:03 +02:00