-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
External versions: delete after 3 months of being merged/closed #7678
Conversation
Currently we are deleting external versions when they are closed, but their docs remain in storage. With this change we mark them as inactive instead. Later a task will delete all external versions that are inactive and their last activity was from 3 months ago. Before being deleted the status is updated to link to the build page instead (the build will be deleted currently, but I'm changing that in another PR). Ref #7674
827c9d2
to
657f4da
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a great change. Will be awesome once we keep the Build's around 👍
@@ -163,3 +169,40 @@ def archive_builds_task(days=14, limit=200, include_cold=False, delete=False): | |||
build.commands.all().delete() | |||
except IOError: | |||
log.exception('Cold Storage save failure') | |||
|
|||
|
|||
def delete_inactive_external_versions(limit=200, days=30 * 3): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we really need a limit here -- are we worried about something specific with it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After 90 days, we may have a lot of versions to delete (or maybe not? We don't know how many PRs are open in a day), the task may be running for a long period of time, but not sure if that's a problem, let me know if you want me to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its fine to have a limit, I guess. We can adjust if we need to later.
Co-authored-by: Eric Holscher <[email protected]>
Currently, we are deleting external versions
when they are closed, but their docs remain in storage.
With this change we mark them as inactive instead.
Later a task will delete all external versions that are inactive
and their last activity was from 3 months ago.
The task is run once every day (not sure if this should run more frequently).
Before being deleted the status is updated to link to the build page
instead (the build will be deleted currently, but I'm changing that in
another PR).
Ref #7674