oncall-engine/engine/apps
Joey Orlando e9969f4bd0
feat: convert organization.general_log_channel_id to organization.default_slack_channel (#5191)
# What this PR does

Related to https://github.com/grafana/oncall-private/issues/2947

Right now `general_log_channel_id` is just a string value representing
the Slack Channel ID (ex. `C043HQ70QMB`). This PR migrates this instead
to be a foreign key relationship on the `slack_slackchannel` table and
updates all references to `general_log_channel_id`.

Tested migrations locally:
```bash
Operations to perform:
  Apply all migrations: [redacted secret grafana-admin-creds:admin-user], alerts, auth, auth_token, base, contenttypes, email, exotel, fcm_django, google, heartbeat, labels, mobile_app, oss_installation, phone_notifications, schedules, sessions, slack, social_django, telegram, twilioapp, user_management, webhooks, zvonok
Running migrations:
  Applying user_management.0024_organization_general_log_slack_channel... OK
source=engine:app google_trace_id=none logger=apps.user_management.migrations.0025_auto_20241017_1919 Starting migration to populate general_log_slack_channel field.
source=engine:app google_trace_id=none logger=apps.user_management.migrations.0025_auto_20241017_1919 Total organizations to process: 1
source=engine:app google_trace_id=none logger=apps.user_management.migrations.0025_auto_20241017_1919 Organization 1 updated with SlackChannel 2 (slack_id: C043LL6RTS7).
source=engine:app google_trace_id=none logger=apps.user_management.migrations.0025_auto_20241017_1919 Finished migration. Total organizations processed: 1. Organizations updated: 1. Missing SlackChannels: 0.
  Applying user_management.0025_auto_20241017_1919... OK
```

## Future incoming PRs

- Drop `Organization.general_log_channel_id` column
- Migrate `ChannelFilter.slack_channel_id` and
`ResolutionNoteSlackMessage.slack_channel_id` to use foreign key
relationships

## 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-11-01 06:41:38 +01:00
..
alerts feat: convert organization.general_log_channel_id to organization.default_slack_channel (#5191) 2024-11-01 06:41:38 +01:00
api feat: convert organization.general_log_channel_id to organization.default_slack_channel (#5191) 2024-11-01 06:41:38 +01:00
api_for_grafana_incident Allow valid URLs for web image_url template (#5150) 2024-10-10 13:21:36 +00:00
auth_token Enable RBAC support for public API endpoints (#5211) 2024-10-30 09:54:55 +00:00
base Reschedule rate limited telegram task instead of retry (#5178) 2024-10-15 13:35:54 +00:00
chatops_proxy update URLs constructed by the backend to support IRM plugin (#5137) 2024-10-09 08:55:10 -04:00
email Make cloud email domain configurable (#4982) 2024-09-04 14:46:52 +00:00
exotel Add method to send notification bundle by SMS (#4624) 2024-07-16 14:20:16 +00:00
google address Google OAuth2 issues where user didn't grant us the https://www.googleapis.com/auth/calendar.events.readonly scope (#4802) 2024-08-14 18:02:34 -04:00
grafana_plugin feat: persist is_grafana_irm_enabled from backend plugin sync data (#5171) 2024-10-11 14:57:59 -04:00
heartbeat Improve OpenAPI schema coverage (#3629) 2024-01-12 15:11:22 +00:00
integrations feat: convert organization.general_log_channel_id to organization.default_slack_channel (#5191) 2024-11-01 06:41:38 +01:00
labels fix: update internal labels endpoints to work with RBAC (#5099) 2024-10-02 17:39:49 +00:00
metrics_exporter Split up organizations across metrics exporters (#5127) 2024-10-08 17:29:36 +00:00
mobile_app Update schedule related users to use cached final representation (#5101) 2024-10-01 13:37:28 +00:00
oss_installation feat: update RBAC permissioning to support grafana-irm-app (#5149) 2024-10-10 19:02:21 +00:00
phone_notifications Add method to send notification bundle by SMS (#4624) 2024-07-16 14:20:16 +00:00
public_api Enable RBAC support for public API endpoints (#5211) 2024-10-30 09:54:55 +00:00
schedules Minor optimizations for public API endpoints (#5172) 2024-10-11 19:39:39 +00:00
slack feat: convert organization.general_log_channel_id to organization.default_slack_channel (#5191) 2024-11-01 06:41:38 +01:00
social_auth Remove deprecated identify slack scope (#5192) 2024-10-18 06:05:41 +00:00
telegram Fix acknowledge reminder task (#5179) 2024-10-16 12:13:28 +00:00
twilioapp Add method to send notification bundle by SMS (#4624) 2024-07-16 14:20:16 +00:00
user_management feat: convert organization.general_log_channel_id to organization.default_slack_channel (#5191) 2024-11-01 06:41:38 +01:00
webhooks Add manual trigger support for webhooks (#4934) 2024-09-09 12:17:23 +00:00
zvonok Add method to send notification bundle by SMS (#4624) 2024-07-16 14:20:16 +00:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00