fix(connect): correct rmd, jupyter, and shiny content bundles#207
fix(connect): correct rmd, jupyter, and shiny content bundles#207ian-flores merged 6 commits intomainfrom
Conversation
- test_deploy_rmarkdown: populate `packages` with rmarkdown+knitr so
Connect's packrat parser finds the expected `Package` column instead
of erroring on an empty `packages: {}` dict.
- test_deploy_jupyter: add `entrypoint` and a `files` block with MD5
checksums to the jupyter-static manifest so nbconvert receives the
notebook filename.
- test_deploy_shiny: replace the incorrect `bootstraplib` HTML marker
with `vip test`, the text the Shiny app actually renders.
Fixes #181
Fixes #180
Fixes #179
There was a problem hiding this comment.
Pull request overview
Updates Connect content-deploy BDD tests to generate more realistic content bundles/manifests so deployments render correctly for R Markdown, Jupyter, and Shiny.
Changes:
- Populate the R Markdown manifest’s
packagesblock to avoid packrat lock parsing errors. - Fix the Jupyter
jupyter-staticmanifest by addingentrypointand afileschecksum block sonbconvertreceives the notebook filename. - Update the Shiny expected-output marker to match actual rendered app output.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # The test app renders `fluidPage("vip test")`, so the text "vip test" | ||
| # appears inside the HTML. We also check for "shiny" as a framework | ||
| # marker (present in the framework-injected <script> tags). |
There was a problem hiding this comment.
The comment says the Shiny test app renders fluidPage("vip test"), but the bundle created above uses fluidPage("VIP test"). Since the marker check is case-insensitive this won’t break the test, but the comment is currently inaccurate—update it to match the actual app code (or note that the assertion lowercases content).
| # The test app renders `fluidPage("vip test")`, so the text "vip test" | |
| # appears inside the HTML. We also check for "shiny" as a framework | |
| # marker (present in the framework-injected <script> tags). | |
| # The test app renders `fluidPage("VIP test")`; the marker check | |
| # lowercases content, so the lowercase text "vip test" still matches. | |
| # We also check for "shiny" as a framework marker (present in the | |
| # framework-injected <script> tags). |
| # Connect's jupyter-static renderer uses ``entrypoint`` (and a ``files`` | ||
| # block listing every bundled file with an MD5 checksum) to find the | ||
| # notebook to pass to ``nbconvert``. ``primary_document`` alone is | ||
| # insufficient: if ``files`` is missing or ``entrypoint`` is unset, | ||
| # nbconvert is invoked with an empty filename argument. |
There was a problem hiding this comment.
The comment says the files block lists “every bundled file”, but this bundle also includes manifest.json and it isn’t listed under files. Either add manifest.json to the files mapping or adjust the wording (and PR description) so it doesn’t imply full coverage.
📸 Preview Screenshots — PR #20710 screenshots captured from PR preview deployments. 🌐 Website PreviewReport Details · view page Example Report · view page Feature Matrix · view page Getting Started · view page Report Page · view page Shiny App · view page Tests · view page Home · view page 📊 Report PreviewReport Details · view page Home · view page 📋 All captured URLs (10 total)✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
|
📸 Preview Screenshots — PR #2079 screenshots captured across 2 preview sites. Assets will be available after this workflow completes.
🌐 Website Preview📊 Validation Report Preview
Summary
|
|












Summary
Three content-deploy test bugs, all in
src/vip_tests/connect/test_content_deploy.py:"packages": {}, which triggered[.data.frame(lockInfo, , "Package") : undefined columns selectedin Connect's packrat parser. Now populated withrmarkdownandknitrentries in the same schema used byshiny_manifest.json.jupyter-staticmanifest setprimary_documentbut omittedentrypointand a top-levelfilesblock, causingnbconvertto be invoked with an empty filename argument. Now setsentrypointand emits afilesblock with MD5 checksums for every bundled file."bootstraplib"never appears in actual Shiny HTML output. Replaced with"vip test"(the text the app renders) plus the existing"shiny"framework marker.Test plan
just checkpassesuv run pytest selftests/passes (303/303 locally;test_1k_usersis a known sandbox flake that passes on rerun)https://pub.ganso.lab.staging.posit.team):test_deploy_shiny— deploy completed in 643s, response body contained both"shiny"and"vip test"markers, test PASSEDtest_deploy_jupyter— deploy completed in 67s, Connect producednotebook.htmlat the content URL, provingnbconvertreceived the filename (the fix(connect): test_deploy_jupyter fails — nbconvert receives empty filename #180 bug). Verification step then fails on a pre-existing orthogonal bug infetch_contenthandling relativeLocationredirects — filed as fix(connect): fetch_content fails on relative Location redirect headers #213test_deploy_rmarkdown— packrat now parses the manifest without the[.data.frame(lockInfo, , "Package") : undefined columns selectederror; the original fix(connect): test_deploy_rmarkdown fails with packrat lockfile error #181 bug is fixed. Deploy still fails on a separate downstream issue (Rmd manifest is missingknitr's transitive depsevaluate,highr,xfun,yaml) — filed as fix(connect): test_deploy_rmarkdown manifest is missing transitive R package dependencies #214Fixes #181
Fixes #180
Fixes #179