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'),