ci: enforce quarto extensions render only what they serve - #442
ci: enforce quarto extensions render only what they serve#442amylin1249 wants to merge 1 commit into
Conversation
Extension release summary🚀 Will release on merge
😴 Changed but won't releaseThe following extensions have code changes but the manifest version hasn't been incremented:
If you intended to release these changes, update the See the contributing guide for details. |
7166093 to
5edcc6d
Compare
dotNomad
left a comment
There was a problem hiding this comment.
I think all of the changes to the extensions here make a lot of sense, but the linting needs a bit more work. My suggestion would be just fix the extensions and come back to the linting in future work.
| _infra: | ||
| - integration/** | ||
| - .github/actions/connect-integration-test/** | ||
| - .github/actions/lint-extension/** |
There was a problem hiding this comment.
Should this be added to the complex-extension block too?
|
|
||
| # Without a _quarto.yml the directory is not a project, so Connect renders | ||
| # only the entrypoint and no sibling Markdown becomes a page. | ||
| if ! INSPECT=$(quarto inspect "$EXT_DIR" 2>/dev/null); then |
There was a problem hiding this comment.
Any quarto inspect failure will result in "not a Quarto project" so if the _quarto.yml is incorrect, like missing a semicolon in render: quarto inspect will error, but this will pass.
I think that this is tricky to do right though, maybe this is a good first pass that we improve over time.
| # A lone document is unambiguously the served document. Otherwise a | ||
| # rendered sibling Markdown file (Quarto ignores README.md) is a stray | ||
| # page that could become the served document. | ||
| STRAY_MD=$(grep -iE '\.md$' <<< "$INPUTS" | grep -viE '^README\.md$' || true) |
There was a problem hiding this comment.
This isn't checking for stray .qmd docs or other file types that Quarto can render.
|
|
||
| # Rendered input basenames. | ||
| INPUTS=$(jq -r '.files.input[] | split("/") | last' <<< "$INSPECT") | ||
| COUNT=$(grep -c . <<< "$INPUTS") |
There was a problem hiding this comment.
If there are no input matches I think this will exit 1 and fail.
Adds a lint-extension guard for Quarto content: it fails when a non-website extension renders more than one document, since with no pinned project.render the default served document can silently flip away from the entrypoint (#392) while every build-time check stays green. Addresses review feedback from #442: - Only skips the check when _quarto.yml is absent; an invalid _quarto.yml now fails quarto inspect loudly instead of passing. - Flags any stray rendered document (.qmd, .ipynb, etc.), not just Markdown. - Also retests complex extensions when the lint-extension action changes, matching the simple-extension _infra filter.
Adds a lint-extension guard for Quarto content: it fails when a non-website extension renders more than one document, since with no pinned project.render the default served document can silently flip away from the entrypoint (#392) while every build-time check stays green. Addresses review feedback from #442: - Only skips the check when _quarto.yml is absent; an invalid _quarto.yml now fails quarto inspect loudly instead of passing. - Flags any stray rendered document (.qmd, .ipynb, etc.), not just Markdown. - Also retests complex extensions when the lint-extension action changes, matching the simple-extension _infra filter.
Fixes #403 -- adds a lint-extension guard that enforces the standard that a Quarto extension renders only the document it serves.
To make the existing content pass, this PR pins project.render to the entrypoint on quarto-stock-report-python, quarto-stock-report-r, and pqr (these ones rendered a stray CHANGELOG page).
As a part of the cleanup, this PR also deletes connect-extension.qmd from quarto-document and quarto-stock-report-python (this is a superseded legacy gallery-metadata file that now lives in the extension block of manifest.json).