Skip to content

Commit 2962ccb

Browse files
committed
File indexers: correctly get page content from PR previews
1 parent 69d49a6 commit 2962ccb

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

readthedocs/projects/tasks/search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def _get_indexers(*, version: Version, build: Build, search_index_name=None):
165165
indexers.append(search_indexer)
166166

167167
# File tree diff is under a feature flag for now,
168-
# and we only allow to compare PR previous against the latest version.
168+
# and we only allow to compare PR previews against the latest version.
169169
has_feature = version.project.has_feature(
170170
Feature.GENERATE_MANIFEST_FOR_FILE_TREE_DIFF
171171
)

readthedocs/rtd_tests/tests/test_imported_file.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,19 +366,19 @@ def test_create_file_tree_manifest(self, write_manifest):
366366
files=[
367367
FileTreeDiffFile(
368368
path="index.html",
369-
main_content_hash=mock.ANY,
369+
main_content_hash="f3336aabed1ae8057ffb0cca20d23d4c",
370370
),
371371
FileTreeDiffFile(
372372
path="404.html",
373-
main_content_hash=mock.ANY,
373+
main_content_hash="b855c3d54f84e075b70faa9958123377",
374374
),
375375
FileTreeDiffFile(
376376
path="test.html",
377-
main_content_hash=mock.ANY,
377+
main_content_hash="04e5dc4003413e36b8bec86bc5e28b07",
378378
),
379379
FileTreeDiffFile(
380380
path="api/index.html",
381-
main_content_hash=mock.ANY,
381+
main_content_hash="15958dc725d925c8524b1766cde73d66",
382382
),
383383
],
384384
)
@@ -402,4 +402,4 @@ def test_create_file_tree_manifest(self, write_manifest):
402402
with override_settings(DOCROOT=self.test_dir):
403403
self._copy_storage_dir(new_version)
404404
index_build(self.build.pk)
405-
write_manifest.assert_called_once()
405+
write_manifest.assert_called_once_with(new_version, manifest)

readthedocs/search/parsers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def _get_page_content(self, page):
6767
type_="html",
6868
version_slug=self.version.slug,
6969
include_file=False,
70+
version_type=self.version.type,
7071
)
7172
file_path = self.storage.join(storage_path, page)
7273
with self.storage.open(file_path, mode="r") as f:

0 commit comments

Comments
 (0)