oncall-engine/engine/apps/api/tests
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 World, meet OnCall! 2022-06-03 08:09:47 -06:00
conftest.py Improve Slack error handling (#3000) 2023-09-12 09:49:16 +00:00
test_alert_group.py Don't html escape quotes when rendering (#3884) 2024-02-12 21:10:22 +00:00
test_alert_group_escalation_snapshot.py Add endpoint for alert group escalation snapshot (#3615) 2024-01-10 14:52:59 +00:00
test_alert_group_table_settings.py Fix alert group columns validation (#3577) 2023-12-15 17:15:50 +00:00
test_alert_receive_channel.py Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
test_alert_receive_channel_template.py Adds new templates cheatsheats (#3643) 2024-01-17 13:49:36 +00:00
test_auth.py Reworked slack login pipeline errors (#2526) 2023-07-18 13:31:11 +00:00
test_channel_filter.py Fix channel filter endpoint (#3192) 2023-10-25 12:33:05 +00:00
test_custom_button.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
test_escalation_chain.py Fix team changing on PUT request if team is not in request data (#3530) 2023-12-07 14:44:52 +00:00
test_escalation_policy.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
test_features.py Improve OpenAPI schema coverage (#3629) 2024-01-12 15:11:22 +00:00
test_integration_heartbeat.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
test_labels.py Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00
test_live_settings.py Telegram long polling (#2250) 2023-08-24 09:12:24 +02:00
test_oncall_shift.py Disable updates for API/terraform shifts in internal API (#3224) 2023-10-31 15:08:07 +00:00
test_openapi_schema.py allow specifying more than one redis server URI in the REDIS_URI env var (#3368) 2023-11-16 10:48:36 -05:00
test_organization.py Add stack slug to /organization endpoint response (#3644) 2024-01-10 12:29:43 +00:00
test_paging.py Updates to POST /direct_paging internal API endpoint to support Grafana Incident use-cases (#3232) 2023-11-01 17:19:44 -04:00
test_permissions.py Permissions for labels (#3173) 2023-10-23 11:03:51 +00:00
test_preview_template_options.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_public_api_tokens.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
test_resolution_note.py Resolution note source mobile app (#3174) 2023-10-20 15:22:45 +01:00
test_route_regex_debugger.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_schedule_export.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
test_schedules.py Fix oncall_now for a schedule in orgs with multiple entries (#3671) 2024-01-12 14:46:13 +00:00
test_set_general_log_channel.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
test_shift_swaps.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
test_slack_channels.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
test_slack_team_settings.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
test_team.py Fix user hidden fields tests (#3919) 2024-02-19 14:27:13 +00:00
test_telegram_channel.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
test_user.py Fix user hidden fields tests (#3919) 2024-02-19 14:27:13 +00:00
test_user_groups.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
test_user_notification_policy.py Fix duplicate orders for user notification policies (#2278) 2023-06-21 11:13:56 +00:00
test_user_schedule_export.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
test_webhook_presets.py Webhook labels (#3383) 2023-11-22 11:17:41 +00:00
test_webhooks.py Support prescribed labels (#3848) 2024-02-20 14:42:51 +08:00