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 all commits
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
26 changes: 10 additions & 16 deletions readthedocs/projects/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,18 +783,14 @@ def run_build(self, record):
epub=bool(outcomes['epub']),
)

# Finalize build and update web servers
# 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']),
)
# TODO: Remove this function and just update the DB and index search directly
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 +1110,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 +1265,8 @@ 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:
# Don't index external version builds for now
if not version or version.type == EXTERNAL:
return
project = version.project

Expand Down