Skip to content

ci: enforce quarto extensions render only what they serve - #442

Closed
amylin1249 wants to merge 1 commit into
mainfrom
ci-quarto-served-document-guard
Closed

ci: enforce quarto extensions render only what they serve#442
amylin1249 wants to merge 1 commit into
mainfrom
ci-quarto-served-document-guard

Conversation

@amylin1249

@amylin1249 amylin1249 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

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).

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Extension release summary

🚀 Will release on merge

  • pqr: 0.1.30.1.4
  • quarto-stock-report-python: 1.0.51.0.6
  • quarto-stock-report-r: 1.0.41.0.5

😴 Changed but won't release

The following extensions have code changes but the manifest version hasn't been incremented:

  • package-vulnerability-scanner: manifest version 3.0.6 ≤ released version 3.0.6
  • publisher-command-center: manifest version 0.0.8 ≤ released version 0.0.8
  • quarto-document: manifest version 1.0.1 ≤ released version 1.0.1
  • runtime-version-scanner: manifest version 1.0.5 ≤ released version 1.0.5
  • usage-metrics-dashboard: manifest version 1.0.15 ≤ released version 1.0.15

If you intended to release these changes, update the version field in each extension's manifest.json.

See the contributing guide for details.

@amylin1249
amylin1249 force-pushed the ci-quarto-served-document-guard branch from 7166093 to 5edcc6d Compare July 24, 2026 19:00
@amylin1249
amylin1249 marked this pull request as ready for review July 24, 2026 19:08
@amylin1249
amylin1249 requested review from dotNomad, karawoo and m-- July 24, 2026 19:09

@dotNomad dotNomad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/**

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are no input matches I think this will exit 1 and fail.

@amylin1249

Copy link
Copy Markdown
Contributor Author

Splitting per your feedback: extension fixes in #449, linting (with your comments addressed) stacked on top in #450.

@amylin1249 amylin1249 closed this Jul 28, 2026
dotNomad pushed a commit that referenced this pull request Aug 14, 2026
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.
dotNomad pushed a commit that referenced this pull request Aug 14, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: guard against Quarto extensions serving the wrong document

2 participants