From d80cf46af424c73daf8ac8b9d5dbe0ac29791d95 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Thu, 9 Oct 2025 18:04:33 -0500 Subject: [PATCH 1/2] Remove DONT_CLEAN_BUILD feature flag Ref https://github.com/readthedocs/readthedocs.org/pull/12462#issuecomment-3355500323 --- readthedocs/projects/models.py | 7 ------- readthedocs/projects/tasks/utils.py | 11 ----------- readthedocs/vcs_support/backends/git.py | 8 -------- 3 files changed, 26 deletions(-) diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index 3cbba2315a4..a40556df350 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -1983,7 +1983,6 @@ def add_features(sender, **kwargs): SCALE_IN_PROTECTION = "scale_in_prtection" USE_S3_SCOPED_CREDENTIALS_ON_BUILDERS = "use_s3_scoped_credentials_on_builders" BUILD_FULL_CLEAN = "build_full_clean" - DONT_CLEAN_BUILD = "dont_clean_build" BUILD_HEALTHCHECK = "build_healthcheck" BUILD_NO_ACKS_LATE = "build_no_acks_late" @@ -2039,12 +2038,6 @@ def add_features(sender, **kwargs): USE_S3_SCOPED_CREDENTIALS_ON_BUILDERS, _("Build: Use S3 scoped credentials for uploading build artifacts."), ), - ( - DONT_CLEAN_BUILD, - _( - "Build: Don't clean the build directory. Only for Enterprise users with dedicated builders." - ), - ), ( BUILD_FULL_CLEAN, _("Build: Clean all build directories to avoid leftovers from other projects."), diff --git a/readthedocs/projects/tasks/utils.py b/readthedocs/projects/tasks/utils.py index b78bd010f9d..b51f6a29fd2 100644 --- a/readthedocs/projects/tasks/utils.py +++ b/readthedocs/projects/tasks/utils.py @@ -27,17 +27,6 @@ def clean_build(version=None): """Clean the files used in the build of the given version.""" - - if version and version.project.has_feature( - Feature.DONT_CLEAN_BUILD, - ): - log.info( - "Skipping cleaning build files for project with DONT_CLEAN_BUILD feature.", - project_slug=version.project.slug, - version_slug=version.slug, - ) - return - if version: del_dirs = [ os.path.join(version.project.doc_path, dir_, version.slug) diff --git a/readthedocs/vcs_support/backends/git.py b/readthedocs/vcs_support/backends/git.py index 3c994d96b28..f11953da043 100644 --- a/readthedocs/vcs_support/backends/git.py +++ b/readthedocs/vcs_support/backends/git.py @@ -53,14 +53,6 @@ def update(self): code, stdout, stderr = self.run(*cmd.split(), escape_command=False) return - # Check for existing checkout and skip clone if it exists. - from readthedocs.projects.models import Feature - - if self.project.has_feature(Feature.DONT_CLEAN_BUILD) and os.path.exists( - os.path.join(self.working_dir, ".git") - ): - return self.fetch() - self.clone() # TODO: We are still using return values in this function that are legacy. # This should be either explained or removed. From 4db15217cb92e57d8fd2e9d56b522a11e2d39ad4 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Mon, 27 Oct 2025 15:37:18 -0500 Subject: [PATCH 2/2] Lint --- readthedocs/projects/tasks/utils.py | 1 - readthedocs/vcs_support/backends/git.py | 1 - 2 files changed, 2 deletions(-) diff --git a/readthedocs/projects/tasks/utils.py b/readthedocs/projects/tasks/utils.py index b51f6a29fd2..997693ed729 100644 --- a/readthedocs/projects/tasks/utils.py +++ b/readthedocs/projects/tasks/utils.py @@ -17,7 +17,6 @@ from readthedocs.core.utils.filesystem import safe_rmtree from readthedocs.doc_builder.exceptions import BuildAppError from readthedocs.notifications.models import Notification -from readthedocs.projects.models import Feature from readthedocs.storage import build_media_storage from readthedocs.worker import app diff --git a/readthedocs/vcs_support/backends/git.py b/readthedocs/vcs_support/backends/git.py index f11953da043..b7bb6ea511c 100644 --- a/readthedocs/vcs_support/backends/git.py +++ b/readthedocs/vcs_support/backends/git.py @@ -1,6 +1,5 @@ """Git-related utilities.""" -import os import re from typing import Iterable from urllib.parse import urlparse