Skip to content
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

Build only HTML and Save external version artifacts in different directory #5886

Merged
merged 5 commits into from
Jul 10, 2019

Conversation

saadmk11
Copy link
Member

@saadmk11 saadmk11 commented Jul 6, 2019

No description provided.

@saadmk11 saadmk11 requested review from ericholscher, davidfischer and a team July 6, 2019 14:28
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit of a quirk with how we run in production, but our build servers can't talk to the database. We need to find another way to send this information to the build servers and pass it along.

@@ -543,8 +543,13 @@ def get_storage_path(self, type_, version_slug=LATEST, include_file=True):
:return: the path to an item in storage
(can be used with ``storage.url`` to get the URL)
"""
type_dir = type_
# Add `external/` prefix for external versions
if self.versions(manager=EXTERNAL).filter(slug=version_slug).exists():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this runs on the builders, so we can't query the DB for security reasons. We might need to think more about how we can pass this data to the builder. Can we set type_ differently coming in?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericholscher We call this function in some other places also. if we change how _type works then we have to check everywhere if the version is external or not then send the type accordingly and also we have to change how we get file extension in that function. but a better way would be that we pass version_type to the function and check it there (thought we have to handle it in all other places). What do you think we should do?

Copy link
Member

@ericholscher ericholscher Jul 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, we just need to capture that info somewhere and pass it along, instead of querying it. It's already passed into the build process somewhere right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is in available the build process. but I have to check other places we call this function :)

@saadmk11 saadmk11 changed the title Save external version artifacts in different directory Build only HTML and Save external version artifacts in different directory Jul 9, 2019
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a lot better 👍

"""
Get a path to a build artifact for use with Django's storage system.

:param type_: Media content type, ie - 'pdf', 'htmlzip'
:param version_slug: Project version slug for lookup
:param version_type: Project version type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong order. This should be last.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@ericholscher ericholscher merged commit 92215ce into readthedocs:gsoc-19-pr-builder Jul 10, 2019
@saadmk11 saadmk11 deleted the update-storage branch July 11, 2019 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants