fix: detect Quarto engines in fallback path and normalize backfill#4098
fix: detect Quarto engines in fallback path and normalize backfill#4098zackverham wants to merge 3 commits into
Conversation
…3993) When quarto inspect is unavailable, the fallback path for .qmd files was not reading file content to detect R/Python code chunks, resulting in an empty engines array in the manifest. Connect uses this field to determine whether to restore the renv environment, so an empty engines array caused renv restore to be skipped entirely. Additionally, normalizeConfig now backfills knitr/jupyter engines when it independently discovers R/Python needs (e.g., via renv.lock), ensuring engines stay consistent even if the detector missed them. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @zackverham's task in 2m 14s —— View job Code Review Complete
SummaryThis PR fixes a real issue where Connect receives ReviewCode Quality: Goodquarto.ts (lines 510-539) - Fallback engine detection for
normalize.ts (lines 129-148) - Engine backfill:
Test Coverage: ComprehensiveThe new tests cover:
Minor ConsiderationIn const qmdFiles = await globDir(baseDir, "*.qmd");This doesn't use VerdictApprove - The fix is correct, well-tested, and addresses the root cause. The code follows existing patterns and the test coverage is solid. |
|
@claude can you fix the minor consideration noted in the PR review comment? |
|
Claude finished @zackverham's task in 1m 0s —— View job Fixed case-insensitive glob for
|
Add { nocase: true } to the globDir call for .qmd files in
genNonInspectConfig() for consistency with findEntrypoints(). This
ensures files like Report.QMD are found on case-sensitive filesystems.
Co-authored-by: zackverham <zackverham@users.noreply.github.com>
|
@claude can you add a changelog blurb for this PR |
|
Claude finished @zackverham's task in 48s —— View job Adding Changelog Entry
Added a changelog entry under
|
Co-authored-by: zackverham <zackverham@users.noreply.github.com>
Smoke Test PlanSetup
Scenario 1:
|
|
Using these to validate locally - just commenting them here for reproducibility. Smoke Test FilesMinimal Scenario 1: R only (
|
|
Closing this in favor of #4128 |
Summary
Fixes #3993
.qmdfiles: Whenquarto inspectis unavailable (quarto not installed or not in PATH), the fallback path now reads.qmdfile content and scans for{r}and{python}code chunks, setting the appropriate engines (knitr/jupyter) and language configs. Previously,.qmdfiles in the fallback path got no engines at all, while.ipynband.Rmdalready had correct handling.normalizeConfig()now ensuresquarto.enginesincludesknitr/jupyterwhen it independently discovers R/Python needs (e.g., viarenv.lockorrpy2). This is a defensive fix — if the detector missed engines for any reason, normalize catches it before the config is written to TOML.Without these fixes, Connect receives
engines: []in the manifest, which causes it to skiprenvrestore entirely, leading to missing packages at render time.Test plan
quarto.test.tsnormalize.test.ts.qmdwith{r}chunks andrenv.lockfrom Positron, verify manifest hasengines: ["knitr"]🤖 Generated with Claude Code