Skip to content

Build: Allow multiple PDFs #10438

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

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3f2bd1f
Adds a feature flag and some initial ability to handle multiple PDFs
benjaoming Jun 14, 2023
f7c3b58
WIP: Only copy top-level files
benjaoming Jun 20, 2023
8efd480
Fix the test
benjaoming Jun 20, 2023
abea0cb
WIP
benjaoming Jun 21, 2023
a39256d
Merge branch 'main' of github.com:readthedocs/readthedocs.org into fe…
benjaoming Jun 21, 2023
032c7fd
WIP: Task and ImportedFile creation
benjaoming Jun 21, 2023
b89dd23
WIP: Need to hide new behavior behind Feature flag
benjaoming Jun 22, 2023
653a0ce
Hide new behaviors behind feature flag
benjaoming Jun 23, 2023
64ada46
Merge branch 'main' of github.com:readthedocs/readthedocs.org into fe…
benjaoming Jun 23, 2023
216592e
Melt together two test scenarios
benjaoming Jun 26, 2023
600b948
Adds tests to model/querysets
benjaoming Jun 26, 2023
f452630
Move constant to where other MEDIA_TYPES are handled
benjaoming Jun 26, 2023
9bfe6f3
Reuse DOWNLOADABLE_MEDIA_TYPES, add comment about removing pdf_file_name
benjaoming Jun 26, 2023
65e714b
lint
benjaoming Jun 26, 2023
99ffb3b
WIP
benjaoming Jun 26, 2023
7b11369
Finalize test case for testing that multiple ImportedFile objects are…
benjaoming Jun 26, 2023
8fadd42
Update failure test case
benjaoming Jun 26, 2023
d91a455
Add some more test comments
benjaoming Jun 26, 2023
c610326
comment update
benjaoming Jun 26, 2023
d13eaa2
Merge branch 'main' of github.com:readthedocs/readthedocs.org into fe…
benjaoming Jun 28, 2023
01e3c2a
Mock revoking the API key?
benjaoming Jun 28, 2023
c5622b2
Merge branch 'main' of github.com:readthedocs/readthedocs.org into fe…
benjaoming Jun 28, 2023
cc2231d
Merge branch 'mock-api-revoke' into feature/multiple-pdfs
benjaoming Jun 28, 2023
c1cc8eb
Update tests after we stopped mocking 'glob'
benjaoming Jun 28, 2023
c49bbc1
lint
benjaoming Jun 28, 2023
0075280
Add test case test_build_commands_executed_multiple_artifacts with ne…
benjaoming Jun 28, 2023
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
Prev Previous commit
Next Next commit
Add some more test comments
benjaoming committed Jun 26, 2023

Verified

This commit was signed with the committer’s verified signature.
benjaoming Benjamin Balder Bach
commit d91a455b6802d1db8c94e7e84af05be0a51f76be
10 changes: 7 additions & 3 deletions readthedocs/rtd_tests/tests/test_project.py
Original file line number Diff line number Diff line change
@@ -281,6 +281,7 @@ def test_git_service_class_gitlab(self):
self.assertEqual(self.pip.git_service_class(), GitLabService)

def test_artifact_path(self):
"""Verify that we can generate a meaningful path from known methods and constants."""
project1 = get(Project, main_language_project=None)

imported_pdf = get(
@@ -289,9 +290,12 @@ def test_artifact_path(self):
name="test1.pdf",
path="test1.pdf",
)
assert project1.artifact_path(imported_pdf.get_media_type()).endswith(
f"/{BUILD_COMMANDS_OUTPUT_PATH}pdf"
)
media_path = project1.artifact_path(imported_pdf.get_media_type())

# Verify that BUILD_COMMANDS_OUTPUT_PATH is part of the path
assert media_path.endswith(f"/{BUILD_COMMANDS_OUTPUT_PATH}pdf")
# Verify that it ends with /pdf as expected
assert media_path.endswith("/pdf")


@mock.patch('readthedocs.projects.forms.trigger_build', mock.MagicMock())
5 changes: 1 addition & 4 deletions readthedocs/rtd_tests/tests/test_project_querysets.py
Original file line number Diff line number Diff line change
@@ -294,10 +294,7 @@ def test_feature_multiple_projects(self):
)

def test_importedfile_queryset(self):
"""
Asserts that queryset methods function
:return:
"""
"""Verify queryset methods for ImportedFile."""
project1 = fixture.get(Project, main_language_project=None)

imported_pdf = get(