From 206f8e45b130a67ae19228d6c19409fd956e568c Mon Sep 17 00:00:00 2001 From: Anthony Johnson Date: Thu, 6 Aug 2020 11:48:42 -0600 Subject: [PATCH] Add feature flag to just skip the sync version task entirely I'm not set up to test this immediately, so can't verify if this works or if it solves the problem we're seeing. --- readthedocs/core/views/hooks.py | 6 +++++- readthedocs/projects/models.py | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/readthedocs/core/views/hooks.py b/readthedocs/core/views/hooks.py index 404d3def82c..f08770d44ef 100644 --- a/readthedocs/core/views/hooks.py +++ b/readthedocs/core/views/hooks.py @@ -4,7 +4,7 @@ from readthedocs.builds.constants import EXTERNAL from readthedocs.core.utils import trigger_build -from readthedocs.projects.models import Project +from readthedocs.projects.models import Project, Feature from readthedocs.projects.tasks import sync_repository_task @@ -95,6 +95,10 @@ def trigger_sync_versions(project): log.info('Unable to sync from %s version', version_identifier) return None + if project.has_feature(Feature.SKIP_SYNC_VERSIONS): + log.info('Skipping sync versions for project: project=%s', project.slug) + return None + options = {} if project.build_queue: # respect the queue for this project diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index 72f451d5133..b55d693b838 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -1538,6 +1538,7 @@ def add_features(sender, **kwargs): ALL_VERSIONS_IN_HTML_CONTEXT = 'all_versions_in_html_context' SKIP_SYNC_TAGS = 'skip_sync_tags' SKIP_SYNC_BRANCHES = 'skip_sync_branches' + SKIP_SYNC_VERSIONS = 'skip_sync_versions' CACHED_ENVIRONMENT = 'cached_environment' LIMIT_CONCURRENT_BUILDS = 'limit_concurrent_builds' DISABLE_SERVER_SIDE_SEARCH = 'disable_server_side_search' @@ -1625,6 +1626,10 @@ def add_features(sender, **kwargs): SKIP_SYNC_TAGS, _('Skip syncing tags'), ), + ( + SKIP_SYNC_VERSIONS, + _('Skip sync versions task'), + ), ( CACHED_ENVIRONMENT, _('Cache the environment (virtualenv, conda, pip cache, repository) in storage'),