fix(report): render from any directory and add badge styling#487
Conversation
The report's index.qmd and details.qmd render product/category badges (Connect, Workbench, Package Manager, Security, Prerequisites) with the .badge-* CSS classes from _PRODUCT_BADGE_CSS, but those classes were never defined in any stylesheet. Every badge rendered as plain unstyled text next to the test title. Add report/styles.css with the .badge-* rules (Posit brand colors) and reference it from _quarto.yml so both report pages share one definition.
vip report shelled out to 'quarto render' in ./report, but the Quarto templates (index.qmd, details.qmd, _quarto.yml, styles.css) only exist in a source checkout and were not shipped in the wheel. Run from any other directory, quarto found no inputs, rendered nothing, and exited 0 -- so the command silently produced no report. - Bundle the report templates in the wheel (force-include -> vip/_report), mirroring the scaffold pattern. - run_report now copies the bundled templates into the working report/ dir (refreshing from the package, falling back to the repo checkout), errors loudly when results or templates are missing or when quarto produces no output, and prints the output path. Also fixes the --open path (_output, not the stale _site). - Resolve troubleshooting.toml and .feature files from the installed vip_tests package (with repo fallback) so hints and BDD steps render when installed, not only from a checkout. - Add selftests covering template bundling/copy, the arbitrary-directory render path, the no-output error, and support-file resolution.
There was a problem hiding this comment.
Pull request overview
This PR fixes vip report so it reliably renders a Quarto HTML report when VIP is installed as a wheel and run from any working directory, and it centralizes CSS so product/category badges render with intended styling.
Changes:
- Bundle Quarto report templates into the wheel and copy/refresh them into the working
./report/directory before rendering. - Resolve
troubleshooting.tomland.featurefiles from either a repo checkout layout or the installedvip_testspackage. - Add shared badge styling in
report/styles.cssand wire it via_quarto.yml.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vip/reporting.py | Adds helpers to locate troubleshooting data and feature files from checkout or installed vip_tests. |
| src/vip/cli.py | Ensures templates exist (bundled or repo fallback), renders report from report/, validates output, and fixes --open pathing. |
| selftests/test_cli_report.py | Adds selftests for template copying, arbitrary-directory rendering, and support-file resolution. |
| report/styles.css | Defines .badge-* classes used by the Quarto templates. |
| report/index.qmd | Uses the new resolution helpers for troubleshooting hints and feature parsing. |
| report/details.qmd | Uses the new resolution helpers for troubleshooting hints and feature parsing. |
| report/_quarto.yml | Adds shared CSS reference and confirms output dir is _output. |
| pyproject.toml | Force-includes Quarto templates into the wheel under vip/_report/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Preview Screenshots7 screenshots captured across the website preview. The report preview ( Website Preview —
|
| URL | Status |
|---|---|
/pr-preview-site/pr-487/ |
✅ captured |
/pr-preview-site/pr-487/getting-started/ |
✅ captured |
/pr-preview-site/pr-487/shiny-app/ |
✅ captured |
/pr-preview-site/pr-487/tests/ |
✅ captured |
/pr-preview-site/pr-487/feature-matrix/ |
✅ captured |
/pr-preview-site/pr-487/report/ |
✅ captured |
/pr-preview/pr-487/ |
Warning
Firewall blocked 2 domains
The following domains were blocked by the firewall during workflow execution:
fonts.gstatic.commtalk.google.com
To allow these domains, add them to the
network.allowedlist in your workflow frontmatter:
network:
allowed:
- defaults
- "fonts.gstatic.com"
- "mtalk.google.com"See Network Configuration for more information.
Generated by Capture preview screenshots for PRs · 53 AIC · ⌖ 6.55 AIC · ⊞ 6.1K · ◷
Address PR review: _ensure_report_templates gated only on index.qmd, so a partial template source could return True and render a degraded report (e.g. missing badge styling). Verify all _REPORT_TEMPLATE_FILES are present, topping up from the repo checkout when a bundled copy is incomplete. Also assert the CLI --help exit code in the help selftest.
Preview Screenshots7 screenshots captured across website and report previews. 🌐 Website Preview —
|
Review follow-ups on the vip report fixes: - The bundled-template refresh now skips files whose content is already identical and prints a stderr notice listing any existing files it did overwrite, so local template customizations never disappear silently. - A missing quarto binary now produces a clear install-Quarto error instead of an uncaught FileNotFoundError traceback. - The importlib.resources.as_file guard catches OSError (not just FileNotFoundError) so zip-imported packages on Python < 3.12 fall back to the repo checkout instead of crashing. - New selftest pins the pyproject force-include block to cli._REPORT_TEMPLATE_FILES so the two lists cannot drift.
|
Preview Screenshots4 screenshots captured | PR #487
|













Summary
Two related fixes to the Quarto report, found while running
vip report.1.
vip reportproduced no report when run outside a source checkoutrun_reportshelled out toquarto renderin./report, but the Quartotemplates (
index.qmd,details.qmd,_quarto.yml,styles.css) only existin a source checkout — they were not shipped in the wheel. Run from any other
directory (e.g. after
uv tool install),./reportheld only theresults.jsonthatvip verifywrote, so quarto found no inputs, renderednothing, and exited 0 — the command silently produced no report.
force-include → vip/_report), mirroringthe existing
scaffoldpattern.run_reportcopies the bundled templates into the workingreport/dir(refreshing from the package, falling back to a repo checkout), then renders.
It now errors loudly when the results file or templates are missing, or when
quarto produces no output, and prints the output path. Also fixes the
--openpath (_output, not the stale_site).troubleshooting.tomland.featurefiles from the installedvip_testspackage (with repo fallback), so troubleshooting hints and BDDsteps render when installed, not only from a checkout.
2. Product/category badges rendered as unstyled text
index.qmd/details.qmdrender product badges (Connect, Workbench, PackageManager, Security, Prerequisites) with
.badge-*CSS classes, but thoseclasses were never defined in any stylesheet, so every badge showed as plain
text next to the test title.
report/styles.csswith the.badge-*rules (Posit brand colors) andreference it from
_quarto.ymlso both report pages share one definition.Verification
vip report --results <results.json>from a freshtemp directory (reproducing the installed-tool scenario). It produced
report/_output/index.htmlwith styled badges, theFailed (27)section, 7troubleshooting-hint blocks, and 34 feature-step procedures — hints and steps
resolved from the installed package.
vip/_report/{index.qmd,details.qmd,_quarto.yml,styles.css}are bundled.
ruff check+ruff formatclean.cd report && uv run quarto renderfrom the checkout, wherethe repo-relative paths still resolve, so the example-report preview keeps
working (and now gets styled badges).
Test plan
selftests/test_cli_report.pycovers template bundling/copy, thearbitrary-directory render path, the no-output error, and support-file
resolution.