Skip to content

fix(extension): quarto use template failed correctly copy extensions when scoped in organisation/owner name - #14010

Merged
cderv merged 6 commits into
quarto-dev:mainfrom
mcanouil:fix/issue14008
Oct 19, 2026
Merged

cderv merged 6 commits into
quarto-dev:mainfrom
mcanouil:fix/issue14008

Conversation

@mcanouil

@mcanouil mcanouil commented Feb 8, 2026 •

Copy link
Copy Markdown
Collaborator

Description

quarto use template quarto-journals/acm created an empty _extensions folder and did not install the extension.
The acm template keeps its extension under _extensions/quarto-journals/acm/, one level deeper than templates such as jasa.
useTemplate passed the staged template root to copyExtensions, so the owner-scoped extension was never found.
It now passes the template's _extensions directory, which is the same directory it already reads to confirm the installation.

The smoke test now runs for both jasa and acm, and checks that _extensions/quarto-journals/<name> exists after the command.
jasa covers the layout that already worked.
acm fails without the fix and passes with it.

Fixes #14008

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Claude Code.
  • Codebase grounding: local clone.
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.

@mcanouil mcanouil self-assigned this Feb 8, 2026
@posit-snyk-bot

posit-snyk-bot commented Feb 8, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@mcanouil
mcanouil marked this pull request as ready for review February 8, 2026 22:29
@cderv
cderv self-requested a review February 9, 2026 08:03
@cscheid cscheid added this to the v1.10 milestone Feb 17, 2026
@mcanouil mcanouil modified the milestones: v1.10, v1.11 Jul 30, 2026
@mcanouil
mcanouil requested review from cderv and removed request for cderv October 19, 2026 11:53

@cderv cderv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the fix and the tests.

Passing extDir makes copyExtensions read the same _extensions directory that readExtensions already uses to list the template's extensions, so the quarto-journals/acm layout is found now. I checked the acm test fails without the change in template.ts and passes with it, and quarto use template quarto-journals/acm installs _extensions/quarto-journals/acm locally.

One related case not covered, and not for this PR: a local template (a directory, so no owner) shipping _extensions/quarto-journals/acm gets it installed as _extensions/acm. A document using the qualified format: quarto-journals/acm-pdf then fails with "Unable to read the extension". Unqualified acm-pdf still works. Before this PR nothing was installed for this layout, so this is still better. I'll open a separate issue for it.

LGTM.

@cderv
cderv merged commit 4c7b5d2 into quarto-dev:main Oct 19, 2026
51 checks passed
@mcanouil
mcanouil deleted the fix/issue14008 branch October 19, 2026 13:40
cderv added a commit that referenced this pull request Oct 20, 2026
…#15117)

When an extension's source stores it under an owner folder, such as
_extensions/quarto-journals/acm/, install drops that folder. The
namespace comes from the install source (the GitHub owner, or none for
a local path or archive), so a copy cannot overwrite the original. A
document using the qualified name quarto-journals/acm-pdf then fails
with "Unable to read the extension 'quarto-journals/acm'", and nothing
at install time says why. quarto add, quarto update and quarto use
template now print the id an extension was installed as and the names
to use for it when the source owner differs from the install owner.

- Print the install id and usable names from readAndCopyExtensions()
- Test a local directory, a cross-owner GitHub template, and the case
  where the owners match (no note printed)
- Document the install namespace rules and lookup in llm-docs

Follow-up to #14010. See #14008 for the repo that stores its extension
under an owner folder. Related to #15111.
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.

quarto use template creates empty _extensions folder and fails to copy extensions

4 participants