Skip to content

Commit

Permalink
Build: remove usage of addons field (#11846)
Browse files Browse the repository at this point in the history
We can remove the field itself after deploying this PR.
  • Loading branch information
stsewd authored Dec 12, 2024
1 parent 7e2d8be commit 0c556f5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
2 changes: 0 additions & 2 deletions readthedocs/api/v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -185,7 +184,6 @@ def get_canonical_url(self, obj):

class Meta(VersionSerializer.Meta):
fields = VersionSerializer.Meta.fields + [
"addons",
"build_data",
"canonical_url",
"machine",
Expand Down
9 changes: 0 additions & 9 deletions readthedocs/doc_builder/director.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/projects/tests/test_build_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 0c556f5

Please sign in to comment.