Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't update Slack user groups for deleted organizations #2985

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

vstpme
Copy link
Member

@vstpme vstpme commented Sep 6, 2023

What this PR does

Make sure that Slack user groups are not getting updated for deleted orgs.
Without this change, there could be issues with backends in multiple clusters trying to update a single Slack user group after migrating an org to another cluster (organizations get soft deleted from the original cluster after migration).

Which issue(s) this PR fixes

https://github.com/grafana/support-escalations/issues/6936

Checklist

  • Unit, integration, and e2e (if applicable) tests updated
  • Documentation added (or pr:no public docs PR label added if not required)
  • CHANGELOG.md updated (or pr:no changelog PR label added if not required)

@vstpme vstpme added the pr:no public docs Added to a PR that does not require public documentation updates label Sep 6, 2023
SlackUserGroup.objects.filter(oncall_schedules__isnull=False).distinct().values_list("pk", flat=True)
SlackUserGroup.objects.filter(
oncall_schedules__isnull=False, # has oncall schedules connected
oncall_schedules__organization__deleted_at__isnull=True, # organization is not deleted
Copy link
Member Author

@vstpme vstpme Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⬆️ The main change of the PR

@vstpme vstpme marked this pull request as ready for review September 6, 2023 15:49
@vstpme vstpme requested a review from a team September 6, 2023 15:49
@vstpme vstpme added this pull request to the merge queue Sep 6, 2023
Merged via the queue into dev with commit 31759fd Sep 6, 2023
@vstpme vstpme deleted the vadimkerr/slack-user-group-deleted-org branch September 6, 2023 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:no public docs Added to a PR that does not require public documentation updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants