[SC-18090] Treat a missing partial index as empty when merging Quarto indexes - #1474
Merged
juanmleng merged 1 commit intoAug 26, 2026
Merged
Conversation
merge_file read the partial index unconditionally, but Quarto only writes listings.json when a rendered page declares a listing. A targeted preview render of pages carrying no card listing therefore produces no partial index, and the merge died with FileNotFoundError before the preview was uploaded — so the check went red on exactly the kind of change the targeted path exists for. No listings changed means nothing to merge: fall back to an empty list and write the staging base out unchanged. The new test reproduces the production traceback and fails without this change. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
Validate docs site✓ INFO: A live preview of the docs site is available — Open the preview |
Contributor
Lighthouse check results✓ INFO: No site pages to audit in this PR. Commit SHA: 95f8192 |
cachafla
approved these changes
Aug 26, 2026
juanmleng
deleted the
juan/sc-18090/fix-targeted-preview-listings-merge
branch
August 26, 2026 17:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
What and why?
Docs pull requests that change only ordinary content pages fail the
validatecheck. The page renders correctly, then the build dies:merge_filereads the partial index unconditionally, but Quarto only writeslistings.jsonwhen a rendered page declares alisting:— the card grids on hub pages. A targeted render of pages that carry none produces no partial index, so the merge crashes, and it crashes before the preview upload step. Red check, nopr_previews/URL, and a Python traceback on the author's PR that reads as the author's mistake.Before: a missing partial index is a hard error. After: it means "no listings changed, nothing to merge" — the staging base is written out unchanged, which is the correct index for a PR that rendered no listing pages.
This is not a rare edge case. The targeted render path has never completed successfully. Of the last eight
validateruns that executed, the three that took the targeted path all failed with this traceback, and the three that fell back to a full render all passed. Every green docs PR since the optimisation landed in7e10dc6d(2026-07-13) got there by falling back, because it touched an underscore-prefixed include, a_sidebar.yaml, or something else outsidesite/. The fast path is reached only by exactly the kind of change it was built for, and that case fails closed — which is likely why this has gone six weeks unreported.Currently blocked by it: documentation#1473, and two unrelated PRs from another author on branches
panchicore/docs-sc17845-field-deletionandpanchicore/docs-sc17216-pdf-parse-cancel, both with the identical traceback.How to test
4 passed. The new case,
test_absent_partial_leaves_base_as_the_merged_index, reproduces the production failure: with the fix stashed it errors with the sameFileNotFoundError, and the suite goes toFAILED (errors=1). CI already runs this suite on every PR (validate-docs-site.yaml:168), so the change is covered here.Selector behaviour was checked directly rather than assumed:
What needs special review?
The end-to-end path is still unverified, and this PR cannot verify it.
select_docs_preview_targets.pyfast-paths only files undersite/, so any PR touching.github/forces a full render — including this one. The unit test covers the fix; nothing here exercises the real targeted pipeline.That matters more than usual, because everything downstream of the merge step has also never run on the targeted path: the preview upload, the preview comment, and whether links into a partially rendered site resolve. This unblocks the road; it does not prove the road is clear. documentation#1473 changes a single content page and does take the targeted path, so re-running
validateon it after this merges is the first genuine exercise. Expect the possibility of a second problem behind this one.Also worth a second opinion on the direction. Given a 0% completion rate over six weeks, the alternative is retiring the targeted path and always doing a full render, so the configuration matches what has actually been happening. That is cheaper to reason about than a fast path nobody has watched succeed, and it is a call for whoever owns the preview pipeline rather than mine.
One behavioural trade-off to name: after this change, "there were genuinely no listings" and "Quarto should have written listings and didn't" look identical, and both produce a preview carrying staging's grids. A loud failure becomes a quiet, slightly stale preview. The same tolerance now applies to
search.json, which Quarto does appear to always write, so that path should not be reachable in practice.Dependencies, breaking changes, and deployment notes
CI tooling only, no site content. No dependencies.
Release notes
Internal CI fix, no user-facing change.
Checklist