oncall-engine/engine/apps/slack
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
..
migrations chore: drop usage of SlackMessage.organization + drop orphaned SlackMessages (#5330) 2024-12-06 11:43:40 -05:00
models chore: drop usage of SlackMessage.organization + drop orphaned SlackMessages (#5330) 2024-12-06 11:43:40 -05:00
representatives chore: random slack code cleanup (#5307) 2024-11-29 13:21:29 +00:00
scenarios chore: drop usage of SlackMessage.organization + drop orphaned SlackMessages (#5330) 2024-12-06 11:43:40 -05:00
tests chore: drop usage of SlackMessage.organization + drop orphaned SlackMessages (#5330) 2024-12-06 11:43:40 -05:00
types Introduce slash command matcher (#4717) 2024-07-24 09:53:06 +00:00
0009_remove_slackmessage_active_update_task_id_db.py chore: remove references to SlackMessage._channel_id (#5325) 2024-12-06 09:28:26 -05:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
alert_group_slack_service.py chore: drop usage of SlackMessage.organization + drop orphaned SlackMessages (#5330) 2024-12-06 11:43:40 -05:00
chatops_proxy_routing.py Prepare OnCall for Unified Slack App (#4232) 2024-06-03 09:07:10 +00:00
client.py Update when slack client ratelimit retry handler is enabled (#3447) 2023-11-30 12:35:46 +00:00
constants.py fix: improve Slack rate limiting logic when updating alert groups (#5287) 2024-12-02 14:40:30 -05:00
errors.py Update Slack user group for a schedule - handle paid_team_only Slack API error (#4793) 2024-08-09 14:51:01 +00:00
installation.py Unified Slack app reinstall (#4682) 2024-07-19 11:53:06 +00:00
slack_formatter.py Fix alert group rendering (#3424) 2023-11-24 15:39:37 +00:00
slash_command.py Make root command configurable (#4863) 2024-08-21 06:54:47 +00:00
tasks.py chore: drop usage of SlackMessage.organization + drop orphaned SlackMessages (#5330) 2024-12-06 11:43:40 -05:00
urls.py Make Slack URLs work without trailing slashes (#4607) 2024-07-03 15:55:54 +00:00
utils.py fix: improve Slack rate limiting logic when updating alert groups (#5287) 2024-12-02 14:40:30 -05:00
views.py chore: drop usage of SlackMessage.organization + drop orphaned SlackMessages (#5330) 2024-12-06 11:43:40 -05:00