Skip to content

Commit 0c556f5

Browse files
authored
Build: remove usage of addons field (#11846)
We can remove the field itself after deploying this PR.
1 parent 7e2d8be commit 0c556f5

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

readthedocs/api/v2/serializers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ class VersionAdminSerializer(VersionSerializer):
171171
project_serializer_class = ProjectAdminSerializer
172172
canonical_url = serializers.SerializerMethodField()
173173
build_data = serializers.JSONField(required=False, write_only=True, allow_null=True)
174-
addons = serializers.BooleanField(required=False, write_only=True, allow_null=False)
175174

176175
def get_canonical_url(self, obj):
177176
# Use the cached object, since it has some
@@ -185,7 +184,6 @@ def get_canonical_url(self, obj):
185184

186185
class Meta(VersionSerializer.Meta):
187186
fields = VersionSerializer.Meta.fields + [
188-
"addons",
189187
"build_data",
190188
"canonical_url",
191189
"machine",

readthedocs/doc_builder/director.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ def __init__(self, data):
6060
"""
6161
self.data = data
6262

63-
# Reset `addons` field. It will be set to `True` only when it's built via `build.commands`
64-
self.data.version.addons = False
65-
6663
def setup_vcs(self):
6764
"""
6865
Perform all VCS related steps.
@@ -195,9 +192,6 @@ def build(self):
195192
self.run_build_job("post_build")
196193
self.store_readthedocs_build_yaml()
197194

198-
# Mark this version to inject the new js client when serving it via El Proxito.
199-
self.data.version.addons = True
200-
201195
after_build.send(
202196
sender=self.data.version,
203197
)
@@ -476,9 +470,6 @@ def run_build_commands(self):
476470
# by the config file. When using `build.commands` it will be `GENERIC`
477471
self.data.version.documentation_type = self.data.config.doctype
478472

479-
# Mark this version to inject the new js client when serving it via El Proxito
480-
self.data.version.addons = True
481-
482473
self.store_readthedocs_build_yaml()
483474

484475
def install_build_tools(self):

readthedocs/projects/tests/test_build_tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def test_build_updates_documentation_type(self, load_yaml_config):
304304
assert self.requests_mock.request_history[8]._request.method == "PATCH"
305305
assert self.requests_mock.request_history[8].path == "/api/v2/version/1/"
306306
assert self.requests_mock.request_history[8].json() == {
307-
"addons": True,
307+
"addons": False,
308308
"build_data": None,
309309
"built": True,
310310
"documentation_type": "mkdocs",
@@ -630,7 +630,7 @@ def test_successful_build(
630630
assert self.requests_mock.request_history[8]._request.method == "PATCH"
631631
assert self.requests_mock.request_history[8].path == "/api/v2/version/1/"
632632
assert self.requests_mock.request_history[8].json() == {
633-
"addons": True,
633+
"addons": False,
634634
"build_data": None,
635635
"built": True,
636636
"documentation_type": "sphinx",

0 commit comments

Comments
 (0)