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

Add task to delete empty deleted integrations from the database #3941

Merged
merged 7 commits into from
Feb 27, 2024

Conversation

mderynck
Copy link
Contributor

@mderynck mderynck commented Feb 21, 2024

What this PR does

Add task which will cleanup deleted integrations from the database if they don't have any alert groups. This is to help address an issue where queries are slowing down due to having a large numbers of ids that do not contribute to the result.

This will be connected as part of sync organization task once it tests out ok.

Which issue(s) this PR fixes

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)

@mderynck mderynck added the pr:no public docs Added to a PR that does not require public documentation updates label Feb 22, 2024
@mderynck mderynck marked this pull request as ready for review February 22, 2024 21:10
@mderynck mderynck requested a review from a team February 22, 2024 21:10
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added

- Add manually run task to cleanup unused integrations @mderynck ([#3941](https://github.com/grafana/oncall/pull/3941))
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if that's have to be a manual task. I'd prefer it to b automatic, otherwise it is not clear who will own it, and we would need to add some docs about that process

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would like to release this task to run manually and then in a follow-up PR connect it to run as part of sync_organization to cover everything. So it will only be manual for a short time.

Copy link
Contributor

@iskhakov iskhakov left a comment

Choose a reason for hiding this comment

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

I don't see any dangerous on_delete=models.CASCADE relations. Looks good to me

@mderynck mderynck added this pull request to the merge queue Feb 27, 2024
@mderynck mderynck removed this pull request from the merge queue due to a manual request Feb 27, 2024
@mderynck mderynck added this pull request to the merge queue Feb 27, 2024
@mderynck mderynck removed this pull request from the merge queue due to a manual request Feb 27, 2024
@mderynck mderynck added this pull request to the merge queue Feb 27, 2024
Merged via the queue into dev with commit 2c7ebcf Feb 27, 2024
21 checks passed
@mderynck mderynck deleted the mderynck/cleanup-deleted-integrations branch February 27, 2024 17:45
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.

3 participants