Repository navigation
fix(extension): quarto use template failed correctly copy extensions when scoped in organisation/owner name - #14010
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
…ls to copy extensions Fixes quarto-dev#14008
Update the template tests to dynamically handle multiple extensions. This change improves test coverage and ensures that both 'jasa' and 'acm' templates are validated correctly.
5ff9976 to
9e58603
Compare
cderv
left a comment
There was a problem hiding this comment.
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.
…#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.
Description
quarto use template quarto-journals/acmcreated an empty_extensionsfolder 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.useTemplatepassed the staged template root tocopyExtensions, so the owner-scoped extension was never found.It now passes the template's
_extensionsdirectory, 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):
AI-assisted PR
Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.