Skip to content

Commit 8f1142c

Browse files
authored
Build: don't reset healthcheck when updating builds (#12493)
At different points during the build process (including before finishing it), we update the `Build` object via the API with new values (e.g. state, length, etc) re-using the `APIBuild` object we fetched via the API before starting the build. Since that object contains `APIBuild.healthcheck` _we are resetting_ the healthcheck before finishing the build. This commit removes the `healthcheck` field from the `APIBuild` returned, so it's not updated by the build while it's being executed.
1 parent 9172d56 commit 8f1142c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

readthedocs/api/v2/serializers.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,11 @@ class BuildAdminSerializer(BuildSerializer):
279279
commands = BuildCommandSerializer(many=True, read_only=True)
280280

281281
class Meta(BuildSerializer.Meta):
282-
# `_config` should be excluded to avoid conflicts with `config`
283-
exclude = ("_config",)
282+
# `_config` should be excluded to avoid conflicts with `config`.
283+
#
284+
# `healthcheck` is excluded to avoid updating it to `None` again during building.
285+
# See https://github.com/readthedocs/readthedocs.org/issues/12474
286+
exclude = ("_config", "healthcheck")
284287

285288

286289
class BuildAdminReadOnlySerializer(BuildAdminSerializer):

0 commit comments

Comments
 (0)