oncall-engine/engine/apps/public_api/tests
Joey Orlando e115617528
chore: drop usage of SlackMessage.organization + drop orphaned SlackMessages (#5330)
# What this PR does

- Stops writing `SlackMessage.organization` + removes references to this
field. [As we
discussed](https://raintank-corp.slack.com/archives/C083TU81TCH/p1733315887463279?thread_ts=1733311105.095309&cid=C083TU81TCH),
we do not need this field on this model/table,
`SlackMessage._slack_team_identity` is sufficient (`organization` will
be dropped in a separate PR)
- Adds a data migration script which:
- drops orphaned `SlackMessage` records; ie. ones which, even after the
[`engine/apps/slack/migrations/0007_migrate_slackmessage_channel_id.py`](https://github.com/grafana/oncall/blob/dev/engine/apps/slack/migrations/0007_migrate_slackmessage_channel_id.py)
migration, still don't have a `SlackMessage.channel` id filled in (we
discussed + agreed on dropping these records
[here](https://raintank-corp.slack.com/archives/C083TU81TCH/p1733329914516859?thread_ts=1733311105.095309&cid=C083TU81TCH))
- fills in empty `SlackMessage.slack_team_identity` values (from
`slack_message.channel.slack_team_identity`)

### Other notes

On the `organization` topic.

We store records in `SlackMessage` for two purposes (AFAICT), and in
both cases, we have references back to the `organization`:
- alert groups - `slack_message.alert_group.channel.organization`
- shift swap requests - `shift_swap_request.schedule.organization`

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-12-06 11:43:40 -05:00
..
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_alert_groups.py chore: drop usage of SlackMessage.organization + drop orphaned SlackMessages (#5330) 2024-12-06 11:43:40 -05:00
test_alerts.py augment API response pagination attributes (#2471) 2023-07-14 11:19:40 -04:00
test_custom_actions.py Migrate webhooks integration_filter to use a m2m field instead (#3946) 2024-02-23 11:55:44 +00:00
test_escalation.py update URLs constructed by the backend to support IRM plugin (#5137) 2024-10-09 08:55:10 -04:00
test_escalation_chain.py fix: allow service account requests to access organization teams (#5326) 2024-12-05 17:33:22 +00:00
test_escalation_policies.py Reworked declare incident escalation step (#5130) 2024-10-07 19:26:10 +00:00
test_integrations.py feat: add service account checks in plugin auth (#5305) 2024-11-28 19:03:07 +00:00
test_maintenance.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_on_call_shifts.py fix: Add rolling users validation for oncall shift API (#5050) 2024-09-20 21:06:33 +00:00
test_personal_notification_rules.py augment API response pagination attributes (#2471) 2023-07-14 11:19:40 -04:00
test_ratelimit.py Use dataclass methods in custom ratelimits and fix tests (#5036) 2024-09-18 13:32:16 +00:00
test_rbac_permissions.py Enable service account token auth for public API (#5254) 2024-11-19 12:52:23 +00:00
test_resolution_notes.py feat: add service account checks in plugin auth (#5305) 2024-11-28 19:03:07 +00:00
test_routes.py chore: convert two slack channel ID char fields to foreign keys (#5224) 2024-11-04 13:34:06 -05:00
test_schedule_export.py upgrade flake8 to v7 (#4141) 2024-04-02 14:26:19 +00:00
test_schedules.py feat: convert schedule.channel (char field) to schedule.slack_channel (foreign key) (#5199) 2024-11-04 14:27:21 -05:00
test_shift_swap.py Update Makefile dev bootstrap; fix test (#4582) 2024-06-25 14:43:50 +00:00
test_slack_channels.py augment API response pagination attributes (#2471) 2023-07-14 11:19:40 -04:00
test_teams.py feat: add Grafana IDs to users and teams public API endpoints (#5075) 2024-09-24 19:16:22 +00:00
test_user_groups.py augment API response pagination attributes (#2471) 2023-07-14 11:19:40 -04:00
test_users.py feat: add Grafana IDs to users and teams public API endpoints (#5075) 2024-09-24 19:16:22 +00:00
test_webhooks.py fix: service accounts creating webhooks through API (#5312) 2024-12-02 11:48:46 +00:00