diff --git a/readthedocs/doc_builder/director.py b/readthedocs/doc_builder/director.py index 0bc4aeac859..698a42389a2 100644 --- a/readthedocs/doc_builder/director.py +++ b/readthedocs/doc_builder/director.py @@ -24,7 +24,6 @@ from readthedocs.doc_builder.python_environments import Conda, Virtualenv from readthedocs.projects.constants import BUILD_COMMANDS_OUTPUT_PATH_HTML from readthedocs.projects.exceptions import RepositoryError -from readthedocs.projects.models import Feature from readthedocs.projects.signals import after_build, before_build, before_vcs from readthedocs.storage import build_tools_storage @@ -250,16 +249,24 @@ def checkout(self): self.data.build["config"] = self.data.config.as_dict() self.data.build["readthedocs_yaml_path"] = custom_config_file + now = timezone.now() + + # fmt: off + # These browndates matches https://blog.readthedocs.com/use-build-os-config/ + browndates = any([ + timezone.datetime(2023, 7, 14, 0, 0, 0, tzinfo=timezone.utc) < now < timezone.datetime(2023, 7, 14, 12, 0, 0, tzinfo=timezone.utc), # First, 12hs + timezone.datetime(2023, 8, 14, 0, 0, 0, tzinfo=timezone.utc) < now < timezone.datetime(2023, 8, 15, 0, 0, 0, tzinfo=timezone.utc), # Second, 24hs + timezone.datetime(2023, 9, 4, 0, 0, 0, tzinfo=timezone.utc) < now < timezone.datetime(2023, 9, 6, 0, 0, 0, tzinfo=timezone.utc), # Third, 24hs + timezone.datetime(2023, 9, 25, 0, 0, 0, tzinfo=timezone.utc) < now, # Fully removal + ]) + # fmt: on + # Raise a build error if the project is not using a config file or using v1 - if self.data.project.has_feature( - Feature.NO_CONFIG_FILE_DEPRECATED - ) and self.data.config.version not in ("2", 2): + if browndates and self.data.config.version not in ("2", 2): raise BuildUserError(BuildUserError.NO_CONFIG_FILE_DEPRECATED) # Raise a build error if the project is using "build.image" on their config file - now = timezone.now() - # fmt: off # These browndates matches https://blog.readthedocs.com/use-build-os-config/ browndates = any([ diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index 834f55fa4b5..3fb00da5229 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -1949,7 +1949,6 @@ def add_features(sender, **kwargs): # Build related features GIT_CLONE_FETCH_CHECKOUT_PATTERN = "git_clone_fetch_checkout_pattern" HOSTING_INTEGRATIONS = "hosting_integrations" - NO_CONFIG_FILE_DEPRECATED = "no_config_file" SCALE_IN_PROTECTION = "scale_in_prtection" FEATURES = ( @@ -2089,10 +2088,6 @@ def add_features(sender, **kwargs): "Proxito: Inject 'readthedocs-addons.js' as