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

External versions: delete after 3 months of being merged/closed #7678

Merged
merged 2 commits into from
Dec 7, 2020

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Nov 18, 2020

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

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
@stsewd stsewd force-pushed the delete-external-after-x-days branch from 827c9d2 to 657f4da Compare November 18, 2020 22:22
@stsewd stsewd requested a review from a team November 18, 2020 23:42
Copy link
Member

@ericholscher ericholscher left a 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 👍

docs/guides/autobuild-docs-for-pull-requests.rst Outdated Show resolved Hide resolved
@@ -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):
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants