oncall-engine/engine/apps/schedules/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
..
calendars Handle ical schedule import with duplicated event UIDs (#2760) 2023-08-07 13:11:46 +00:00
tasks chore: drop usage of SlackMessage.organization + drop orphaned SlackMessages (#5330) 2024-12-06 11:43:40 -05:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
conftest.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
custom_shift_test_cases.py Fix for user appearing in shift rotation when they should not be (#5064) 2024-10-03 20:04:55 +00:00
factories.py shift swap requests model + CRUD endpoints (#2597) 2023-07-21 19:35:19 +00:00
test_amixr_users_in_ical.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_check_gaps_and_empty_shifts.py Refactor gaps and empty shift checks (#3785) 2024-01-31 15:25:06 +01:00
test_custom_on_call_shift.py Fix for user appearing in shift rotation when they should not be (#5064) 2024-10-03 20:04:55 +00:00
test_ical_proxy.py Add multiple ical all-day event for testing 2022-11-03 14:36:42 -03:00
test_ical_utils.py feat: update RBAC permissioning to support grafana-irm-app (#5149) 2024-10-10 19:02:21 +00:00
test_notify_about_empty_shifts_in_schedule.py feat: convert schedule.channel (char field) to schedule.slack_channel (foreign key) (#5199) 2024-11-04 14:27:21 -05:00
test_notify_about_gaps_in_schedule.py feat: convert schedule.channel (char field) to schedule.slack_channel (foreign key) (#5199) 2024-11-04 14:27:21 -05:00
test_on_call_schedule.py Fix issue with DST starting/ending causing overlaps/gaps (#5266) 2024-11-20 17:04:25 +00:00
test_quality_score.py Move cache clear to fixtures, fix some deprecation notices (#3269) 2023-11-06 16:52:50 +00:00
test_shift_swap_request.py bump uwsgi to 2.0.26 + Python to 3.12.3 (#4495) 2024-06-10 15:33:37 -04:00