Skip to content

Fix PR builds being marked built #7069

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 2 commits into from
May 13, 2020
Merged
Changes from 1 commit
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
20 changes: 8 additions & 12 deletions readthedocs/projects/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,14 +787,13 @@ def run_build(self, record):
# We upload EXTERNAL version media files to blob storage
# We should have this check here to make sure
# the files don't get re-uploaded on web.
if self.version.type != EXTERNAL:
self.update_app_instances(
html=bool(outcomes['html']),
search=bool(outcomes['search']),
localmedia=bool(outcomes['localmedia']),
pdf=bool(outcomes['pdf']),
epub=bool(outcomes['epub']),
)
self.update_app_instances(
html=bool(outcomes['html']),
search=bool(outcomes['search']),
localmedia=bool(outcomes['localmedia']),
pdf=bool(outcomes['pdf']),
epub=bool(outcomes['epub']),
)
else:
log.warning('No build ID, not syncing files')

Expand Down Expand Up @@ -1114,9 +1113,6 @@ def update_app_instances(
'Updating version failed, skipping file sync: version=%s',
self.version,
)
hostname = socket.gethostname()

delete_unsynced_media = True

# Broadcast finalization steps to web application instances
fileify.delay(
Expand Down Expand Up @@ -1272,7 +1268,7 @@ def fileify(version_pk, commit, build):
This is so we have an idea of what files we have in the database.
"""
version = Version.objects.get_object_or_log(pk=version_pk)
if not version:
if not version or version.type == EXTERNAL:
return
project = version.project

Expand Down