From 0c556f5374a347adbde7a6fe116a790c62e9cdc2 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Thu, 12 Dec 2024 11:10:14 -0500 Subject: [PATCH] Build: remove usage of addons field (#11846) We can remove the field itself after deploying this PR. --- readthedocs/api/v2/serializers.py | 2 -- readthedocs/doc_builder/director.py | 9 --------- readthedocs/projects/tests/test_build_tasks.py | 4 ++-- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/readthedocs/api/v2/serializers.py b/readthedocs/api/v2/serializers.py index 39431120d30..0dd9ceed76f 100644 --- a/readthedocs/api/v2/serializers.py +++ b/readthedocs/api/v2/serializers.py @@ -171,7 +171,6 @@ class VersionAdminSerializer(VersionSerializer): project_serializer_class = ProjectAdminSerializer canonical_url = serializers.SerializerMethodField() build_data = serializers.JSONField(required=False, write_only=True, allow_null=True) - addons = serializers.BooleanField(required=False, write_only=True, allow_null=False) def get_canonical_url(self, obj): # Use the cached object, since it has some @@ -185,7 +184,6 @@ def get_canonical_url(self, obj): class Meta(VersionSerializer.Meta): fields = VersionSerializer.Meta.fields + [ - "addons", "build_data", "canonical_url", "machine", diff --git a/readthedocs/doc_builder/director.py b/readthedocs/doc_builder/director.py index 5917b0441ae..605161cbd43 100644 --- a/readthedocs/doc_builder/director.py +++ b/readthedocs/doc_builder/director.py @@ -60,9 +60,6 @@ def __init__(self, data): """ self.data = data - # Reset `addons` field. It will be set to `True` only when it's built via `build.commands` - self.data.version.addons = False - def setup_vcs(self): """ Perform all VCS related steps. @@ -195,9 +192,6 @@ def build(self): self.run_build_job("post_build") self.store_readthedocs_build_yaml() - # Mark this version to inject the new js client when serving it via El Proxito. - self.data.version.addons = True - after_build.send( sender=self.data.version, ) @@ -476,9 +470,6 @@ def run_build_commands(self): # by the config file. When using `build.commands` it will be `GENERIC` self.data.version.documentation_type = self.data.config.doctype - # Mark this version to inject the new js client when serving it via El Proxito - self.data.version.addons = True - self.store_readthedocs_build_yaml() def install_build_tools(self): diff --git a/readthedocs/projects/tests/test_build_tasks.py b/readthedocs/projects/tests/test_build_tasks.py index 7e5639224a3..a458c65ab8c 100644 --- a/readthedocs/projects/tests/test_build_tasks.py +++ b/readthedocs/projects/tests/test_build_tasks.py @@ -304,7 +304,7 @@ def test_build_updates_documentation_type(self, load_yaml_config): assert self.requests_mock.request_history[8]._request.method == "PATCH" assert self.requests_mock.request_history[8].path == "/api/v2/version/1/" assert self.requests_mock.request_history[8].json() == { - "addons": True, + "addons": False, "build_data": None, "built": True, "documentation_type": "mkdocs", @@ -630,7 +630,7 @@ def test_successful_build( assert self.requests_mock.request_history[8]._request.method == "PATCH" assert self.requests_mock.request_history[8].path == "/api/v2/version/1/" assert self.requests_mock.request_history[8].json() == { - "addons": True, + "addons": False, "build_data": None, "built": True, "documentation_type": "sphinx",