Skip to content

Feature flag: remove DONT_SHALLOW_CLONE #10588

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

Merged
merged 7 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions readthedocs/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1928,7 +1928,6 @@ def add_features(sender, **kwargs):
# may be added by other packages
MKDOCS_THEME_RTD = "mkdocs_theme_rtd"
API_LARGE_DATA = "api_large_data"
DONT_SHALLOW_CLONE = "dont_shallow_clone"
CONDA_APPEND_CORE_REQUIREMENTS = "conda_append_core_requirements"
ALL_VERSIONS_IN_HTML_CONTEXT = "all_versions_in_html_context"
CDN_ENABLED = "cdn_enabled"
Expand Down Expand Up @@ -1969,10 +1968,6 @@ def add_features(sender, **kwargs):
MKDOCS_THEME_RTD,
_("MkDocs: Use Read the Docs theme for MkDocs as default theme"),
),
(
DONT_SHALLOW_CLONE,
_("Build: Do not shallow clone when cloning git repos"),
),
(
API_LARGE_DATA,
_("Build: Try alternative method of posting large data"),
Expand Down
14 changes: 1 addition & 13 deletions readthedocs/vcs_support/backends/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def get_remote_fetch_refspec(self):
)

def clone(self):
"""Clones the repository."""
# TODO: We should add "--no-checkout" in all git clone operations, except:
# There exists a case of version_type=BRANCH without a branch name.
# This case is relevant for building projects for the first time without knowing the name
Expand Down Expand Up @@ -268,19 +269,6 @@ def validate_submodules(self, config):
return False, invalid_submodules
return True, submodules.keys()

def use_shallow_clone(self):
"""
Test whether shallow clone should be performed.

.. note::

Temporarily, we support skipping this option as builds that rely on
git history can fail if using shallow clones. This should
eventually be configurable via the web UI.
"""
from readthedocs.projects.models import Feature
return not self.project.has_feature(Feature.DONT_SHALLOW_CLONE)

def checkout_revision(self, revision):
try:
code, out, err = self.run('git', 'checkout', '--force', revision)
Expand Down