Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Quarto websites projects inspection and generated configuration #2455

Merged
merged 4 commits into from
Dec 6, 2024

Conversation

marcosnav
Copy link
Collaborator

Intent

The goal of this PR is to improve the experience of Quarto website projects. Focused in two main points:

  1. pre- and post- scripts are now automatically picked up to be added to the configuration on project inspection.
  2. Users can select _quarto.yml as entrypoint and configuration will be properly generated.

Fixes #2266

Type of Change

    • Bug Fix
    • New Feature
    • Breaking Change
    • Documentation
    • Refactor
    • Tooling

Approach

In order to allow points mentioned above, it was necessary to reorganize a bit the code that triggers the quarto inspect command and that, sub sequentially, uses the output to generate the deployment configuration, having specific checks for _quarto.yml picked up as entrypoint and extending the inspect output struct to account for directory scanning scenarios.

User Impact

Users now will:

  1. Get pre- and post- scripts included - if any - to the configuration on Quarto project inspection.
  2. Users can select _quarto.yml as entrypoint and configuration will be properly generated.

Automated Tests

New tests were created to cover this new functionality.

Directions for Reviewers

Try publishing a Quarto website project, even better if it has pre-render and post-render scripts to confirm such files are included in the resulting configuration.

The jumpstart example of a Quarto website can be used as example.

Checklist

… to the configuration and allowing to use quarto yml files as entrypoints
@@ -22,11 +22,11 @@ type QuartoDetector struct {
log logging.Logger
}

func NewQuartoDetector() *QuartoDetector {
func NewQuartoDetector(log logging.Logger) *QuartoDetector {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Noticed the previous log implementation in this struct wasn't logging because it was not the initialized logger instance with a pre-defined output. Updated the signature to receive the logger instead of creating a new one.

@@ -36,25 +36,27 @@ type quartoMetadata struct {
Server any `json:"server"`
}

type quartoProjectConfig struct {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pulled out this config object for re-usability purposes.

@sagerb
Copy link
Collaborator

sagerb commented Nov 26, 2024

@marcosnav The code within the PR is looking good, but I started hitting some issues with the quarto examples within connect-content repo, so I would like to have you test each of the quarto content types within the repo, as I think you'll want to make some changes.

I started with connect-content/bundles/quarto-book-none. After needing to fix up the renv issues (which are not within scope of your changes), my deployment (after picking _quarto.yml as the entrypoint) would not render successfully do to missing files. Since you've got changes within this code which adds additional files into the included file list, I think you should update the code to grab every file which quarto inspect returns.

In this case, I saw quarto inspect return:

{
  "quarto": {
    "version": "1.5.57"
  },
  "dir": "/Users/billsager/dev/connect-content/bundles/quarto-book-none",
  "engines": [
    "markdown"
  ],
  "config": {
    "project": {
      "type": "book",
      "lib-dir": "site_libs",
      "output-dir": "_book",
      "render": [
        "index.qmd",
        "intro.qmd",
        "summary.qmd",
        "references.qmd"
      ]
    },
    "book": {
      "title": "quarto-book-none",
      "author": "Jane Doe",
      "date": "2/9/2022",
      "chapters": [
        "index.qmd",
        "intro.qmd",
        "summary.qmd",
        "references.qmd"
      ],
      "render": [
        {
          "type": "chapter",
          "file": "index.qmd",
          "depth": 0
        },
        {
          "type": "chapter",
          "file": "intro.qmd",
          "number": 1,
          "depth": 0
        },
        {
          "type": "chapter",
          "file": "summary.qmd",
          "number": 2,
          "depth": 0
        },
        {
          "type": "chapter",
          "file": "references.qmd",
          "depth": 0
        }
      ]
    },
    "bibliography": "references.bib",
    "format": {
      "html": {
        "theme": "cosmo"
      }
    },
    "language": {},
    "website": {
      "title": "quarto-book-none",
      "sidebar": {
        "title": "quarto-book-none",
        "contents": [
          "index.qmd",
          "intro.qmd",
          "summary.qmd",
          "references.qmd"
        ],
        "style": "floating",
        "tools": []
      },
      "page-navigation": true
    }
  },
  "files": {
    "input": [
      "/Users/billsager/dev/connect-content/bundles/quarto-book-none/index.qmd",
      "/Users/billsager/dev/connect-content/bundles/quarto-book-none/intro.qmd",
      "/Users/billsager/dev/connect-content/bundles/quarto-book-none/summary.qmd",
      "/Users/billsager/dev/connect-content/bundles/quarto-book-none/references.qmd"
    ],
    "resources": [],
    "config": [
      "/Users/billsager/dev/connect-content/bundles/quarto-book-none/_quarto.yml"
    ],
    "configResources": [
      "/Users/billsager/dev/connect-content/bundles/quarto-book-none/references.bib"
    ]
  },
  "fileInformation": {
    "/Users/billsager/dev/connect-content/bundles/quarto-book-none/index.qmd": {
      "includeMap": [],
      "codeCells": []
    },
    "/Users/billsager/dev/connect-content/bundles/quarto-book-none/intro.qmd": {
      "includeMap": [],
      "codeCells": []
    },
    "/Users/billsager/dev/connect-content/bundles/quarto-book-none/summary.qmd": {
      "includeMap": [],
      "codeCells": []
    },
    "/Users/billsager/dev/connect-content/bundles/quarto-book-none/references.qmd": {
      "includeMap": [],
      "codeCells": []
    }
  }
}

The initial error I saw within the render logs on Connect was that references.bib was not included.

If we are going to include all of the referenced files automatically for quarto projects, (at least the ones that quarto inspect does tell us about), then I think you'll want to make sure you parse out all of the locations in which the inspect results will return file references.

Do you think it would be a good idea to source the schema from the quarto code itself, to determine what is returned by inspect (with all of the file references it could have)?

Let me know if you agree with me that we should address these additional file references within your PR. Thanks so much!

@marcosnav
Copy link
Collaborator Author

@sagerb Thanks for trying it out and noticing that. I tested out mainly the jumpstart examples and a couple other projects, I'll take a look to this other bundles to see other cases that we might be missing.

I do think that it makes sense to address some of these other file inclusions on this PR, I'll take another pass to the schema we have and see what we are missing.

@marcosnav
Copy link
Collaborator Author

Also, Quarto 1.6 was just released and it now supports a new _brand.yml file, I'll take a look and see if this new file is supported by default or if it has it's own new place within the inspect command output.

@sagerb
Copy link
Collaborator

sagerb commented Nov 26, 2024

@marcosnav Do you think we need to first capture the version of quarto and then deserialize into a version specific structure? Or are you seeing that they are simply adding additional fields vs. removing/changing ones?

@marcosnav
Copy link
Collaborator Author

Do you think we need to first capture the version of quarto and then deserialize into a version specific structure? Or are you seeing that they are simply adding additional fields vs. removing/changing ones?

@sagerb So far I haven't seen the need for versioning the structure, changes are additive. Specifically for the new _brand.yml, it is a special file like _metadata.yml, nothing brakes if it is not present and we just add it to the deployment if it exists, nothing happens if it exists and it is not used.

@marcosnav
Copy link
Collaborator Author

@sagerb PR ready for another look, with some more adjustments to identify and add project related resources.

@sagerb
Copy link
Collaborator

sagerb commented Dec 2, 2024

Validation details from projects in repo: connect-content, on main. Using Quarto v 1.6.39 on Mac, but v 1.5.57 on Connect Server.

  • NOTE: should we call out the mismatch, like we do with Python?
  1. bundles/quarto-doc-none
    • success (selected bundles/quarto-doc-none/quarto-doc-none.qmd)
  2. bundles/quarto-multidoc-proj-none
    • ????? Always rendered to be document 1, even though have tried three different entrypoints: bundles/quarto-multidoc-proj-none/_quarto.yml, bundles/quarto-multidoc-proj-none/document1.qmd and bundles/quarto-multidoc-proj-none/document2.qmd.
    • Would have expected w/ entrypoint selected as document2.qmd, that we would render and show document2?
  3. bundles/quarto-proj-none
    • success Selected bundles/quarto-proj-none/_quarto.yml and updated existing deployment to bundles/quarto-proj-none/quarto-proj-none.qmd.
  4. bundles/quarto-proj-none-ojs
    • success Selected bundles/quarto-proj-none-ojs/quarto-proj-none-ojs.qmd and updated existing deployment to bundles/quarto-proj-none-ojs/_quarto.yml
  5. bundles/quarto-proj-py
    • success Selected bundles/quarto-proj-py/quarto-proj-py.qmd and updated to existing deployment to bundles/quarto-proj-py/_quarto.yml
  6. bundles/quarto-proj-r
    • Repo has existing renv directory populated. Was unable to deploy, got error:

Could not scan R packages from lockfile: renv.lock, R6: package not found in current libPaths; consider running renv::restore() to populate the renv library
- NOTE: This seems to be another example of how we do require a working R environment to deploy? Should we detect this by running renv::status() and parsing the output, so we can show a quicker error?
- ran renv::snapshot() and restored packages
- success Selected bundles/quarto-proj-r/_quarto.yml

  1. bundles/quarto-proj-r-py
    • success Selected bundles/quarto-proj-r-py/quarto-proj-r-py.qmd
  2. bundles/quarto-proj-r-shiny
    • success Selected bundles/quarto-proj-r-shiny/quarto-proj-r-shiny.qmd
  3. bundles/quarto-website-none
    • PROBLEM ?? Selected bundles/quarto-website-none/about.qmd - styles.css - included in quarto inspect output but not pulled into file list
    • located at project.files.configResources[]
{
  "quarto": {
    "version": "1.6.39"
  },
  "engines": [
    "markdown"
  ],
  "formats": {
    "html": {
      "identifier": {
        "display-name": "HTML",
        "target-format": "html",
        "base-format": "html"
      },
      "execute": {
        "fig-width": 7,
        "fig-height": 5,
        "fig-format": "retina",
        "fig-dpi": 96,
        "df-print": "default",
        "error": false,
        "eval": true,
        "cache": null,
        "freeze": false,
        "echo": true,
        "output": true,
        "warning": true,
        "include": true,
        "keep-md": false,
        "keep-ipynb": false,
        "ipynb": null,
        "enabled": null,
        "daemon": null,
        "daemon-restart": false,
        "debug": false,
        "ipynb-filters": [],
        "ipynb-shell-interactivity": null,
        "plotly-connected": true,
        "engine": "markdown"
      },
      "render": {
        "keep-tex": false,
        "keep-typ": false,
        "keep-source": false,
        "keep-hidden": false,
        "prefer-html": false,
        "output-divs": true,
        "output-ext": "html",
        "fig-align": "default",
        "fig-pos": null,
        "fig-env": null,
        "code-fold": "none",
        "code-overflow": "scroll",
        "code-link": false,
        "code-line-numbers": false,
        "code-tools": false,
        "tbl-colwidths": "auto",
        "merge-includes": true,
        "inline-includes": false,
        "preserve-yaml": false,
        "latex-auto-mk": true,
        "latex-auto-install": true,
        "latex-clean": true,
        "latex-min-runs": 1,
        "latex-max-runs": 10,
        "latex-makeindex": "makeindex",
        "latex-makeindex-opts": [],
        "latex-tlmgr-opts": [],
        "latex-input-paths": [],
        "latex-output-dir": null,
        "link-external-icon": false,
        "link-external-newwindow": false,
        "self-contained-math": false,
        "format-resources": [],
        "notebook-links": true
      },
      "pandoc": {
        "standalone": true,
        "wrap": "none",
        "default-image-extension": "png",
        "to": "html",
        "css": [
          "styles.css"
        ],
        "output-file": "index.html"
      },
      "language": {
        "toc-title-document": "Table of contents",
        "toc-title-website": "On this page",
        "related-formats-title": "Other Formats",
        "related-notebooks-title": "Notebooks",
        "source-notebooks-prefix": "Source",
        "other-links-title": "Other Links",
        "code-links-title": "Code Links",
        "launch-dev-container-title": "Launch Dev Container",
        "launch-binder-title": "Launch Binder",
        "article-notebook-label": "Article Notebook",
        "notebook-preview-download": "Download Notebook",
        "notebook-preview-download-src": "Download Source",
        "notebook-preview-back": "Back to Article",
        "manuscript-meca-bundle": "MECA Bundle",
        "section-title-abstract": "Abstract",
        "section-title-appendices": "Appendices",
        "section-title-footnotes": "Footnotes",
        "section-title-references": "References",
        "section-title-reuse": "Reuse",
        "section-title-copyright": "Copyright",
        "section-title-citation": "Citation",
        "appendix-attribution-cite-as": "For attribution, please cite this work as:",
        "appendix-attribution-bibtex": "BibTeX citation:",
        "appendix-view-license": "View License",
        "title-block-author-single": "Author",
        "title-block-author-plural": "Authors",
        "title-block-affiliation-single": "Affiliation",
        "title-block-affiliation-plural": "Affiliations",
        "title-block-published": "Published",
        "title-block-modified": "Modified",
        "title-block-keywords": "Keywords",
        "callout-tip-title": "Tip",
        "callout-note-title": "Note",
        "callout-warning-title": "Warning",
        "callout-important-title": "Important",
        "callout-caution-title": "Caution",
        "code-summary": "Code",
        "code-tools-menu-caption": "Code",
        "code-tools-show-all-code": "Show All Code",
        "code-tools-hide-all-code": "Hide All Code",
        "code-tools-view-source": "View Source",
        "code-tools-source-code": "Source Code",
        "tools-share": "Share",
        "tools-download": "Download",
        "code-line": "Line",
        "code-lines": "Lines",
        "copy-button-tooltip": "Copy to Clipboard",
        "copy-button-tooltip-success": "Copied!",
        "repo-action-links-edit": "Edit this page",
        "repo-action-links-source": "View source",
        "repo-action-links-issue": "Report an issue",
        "back-to-top": "Back to top",
        "search-no-results-text": "No results",
        "search-matching-documents-text": "matching documents",
        "search-copy-link-title": "Copy link to search",
        "search-hide-matches-text": "Hide additional matches",
        "search-more-match-text": "more match in this document",
        "search-more-matches-text": "more matches in this document",
        "search-clear-button-title": "Clear",
        "search-text-placeholder": "",
        "search-detached-cancel-button-title": "Cancel",
        "search-submit-button-title": "Submit",
        "search-label": "Search",
        "toggle-section": "Toggle section",
        "toggle-sidebar": "Toggle sidebar navigation",
        "toggle-dark-mode": "Toggle dark mode",
        "toggle-reader-mode": "Toggle reader mode",
        "toggle-navigation": "Toggle navigation",
        "crossref-fig-title": "Figure",
        "crossref-tbl-title": "Table",
        "crossref-lst-title": "Listing",
        "crossref-thm-title": "Theorem",
        "crossref-lem-title": "Lemma",
        "crossref-cor-title": "Corollary",
        "crossref-prp-title": "Proposition",
        "crossref-cnj-title": "Conjecture",
        "crossref-def-title": "Definition",
        "crossref-exm-title": "Example",
        "crossref-exr-title": "Exercise",
        "crossref-ch-prefix": "Chapter",
        "crossref-apx-prefix": "Appendix",
        "crossref-sec-prefix": "Section",
        "crossref-eq-prefix": "Equation",
        "crossref-lof-title": "List of Figures",
        "crossref-lot-title": "List of Tables",
        "crossref-lol-title": "List of Listings",
        "environment-proof-title": "Proof",
        "environment-remark-title": "Remark",
        "environment-solution-title": "Solution",
        "listing-page-order-by": "Order By",
        "listing-page-order-by-default": "Default",
        "listing-page-order-by-date-asc": "Oldest",
        "listing-page-order-by-date-desc": "Newest",
        "listing-page-order-by-number-desc": "High to Low",
        "listing-page-order-by-number-asc": "Low to High",
        "listing-page-field-date": "Date",
        "listing-page-field-title": "Title",
        "listing-page-field-description": "Description",
        "listing-page-field-author": "Author",
        "listing-page-field-filename": "File Name",
        "listing-page-field-filemodified": "Modified",
        "listing-page-field-subtitle": "Subtitle",
        "listing-page-field-readingtime": "Reading Time",
        "listing-page-field-wordcount": "Word Count",
        "listing-page-field-categories": "Categories",
        "listing-page-minutes-compact": "{0} min",
        "listing-page-category-all": "All",
        "listing-page-no-matches": "No matching items",
        "listing-page-words": "{0} words",
        "listing-page-filter": "Filter",
        "draft": "Draft"
      },
      "metadata": {
        "lang": "en",
        "fig-responsive": true,
        "quarto-version": "1.6.39",
        "editor": "visual",
        "theme": "cosmo",
        "title": "quarto-website-none"
      },
      "extensions": {
        "book": {
          "multiFile": true
        }
      }
    }
  },
  "resources": [
    "styles.css"
  ],
  "fileInformation": {
    "index.qmd": {
      "includeMap": [],
      "codeCells": [],
      "metadata": {
        "title": "quarto-website-none"
      }
    }
  },
  "project": {
    "quarto": {
      "version": "1.6.39"
    },
    "dir": "/Users/billsager/dev/connect-content/bundles/quarto-website-none",
    "engines": [
      "markdown"
    ],
    "config": {
      "project": {
        "type": "website",
        "lib-dir": "site_libs",
        "output-dir": "_site"
      },
      "website": {
        "title": "quarto-website-none",
        "navbar": {
          "background": "primary",
          "left": [
            {
              "href": "index.qmd",
              "text": "Home"
            },
            "about.qmd"
          ]
        }
      },
      "format": {
        "html": {
          "theme": "cosmo",
          "css": "styles.css"
        }
      },
      "editor": "visual",
      "language": {}
    },
    "files": {
      "input": [
        "/Users/billsager/dev/connect-content/bundles/quarto-website-none/index.qmd",
        "/Users/billsager/dev/connect-content/bundles/quarto-website-none/about.qmd"
      ],
      "resources": [],
      "config": [
        "/Users/billsager/dev/connect-content/bundles/quarto-website-none/_quarto.yml"
      ],
      "configResources": [
        "/Users/billsager/dev/connect-content/bundles/quarto-website-none/styles.css"
      ]
    },
    "fileInformation": {
      "/Users/billsager/dev/connect-content/bundles/quarto-website-none/index.qmd": {
        "includeMap": [],
        "codeCells": [],
        "metadata": {
          "title": "quarto-website-none"
        }
      },
      "/Users/billsager/dev/connect-content/bundles/quarto-website-none/about.qmd": {
        "includeMap": [],
        "codeCells": [],
        "metadata": {
          "title": "About"
        }
      }
    }
  }
}
- BUT does work if you pick `_quarto.yml`, which then selects the directory... and includes a reference to `styles.css` somehow...
- NOTE: Should we allow entrypoint browsing to include directory as well?
  1. bundles/quarto-website-py
    • Success Selected bundles/quarto-website-py/_quarto.yml
    • NOTE: would exhibit same missing styles.css if picked different quarto file as entrypoint.
  2. bundles/quarto-website-py-deps
    • PROBLEM Selected bundles/quarto-website-py-deps/_quarto.yml
    • NOTE: would exhibit same missing styles.css if picked different quarto file as entrypoint.
  3. bundles/quarto-website-r
    • Success Selected bundles/quarto-website-r/_quarto.yml
    • NOTE: would exhibit same missing styles.css if picked different quarto file as entrypoint.
  4. bundles/quarto-website-r-deps
    • Success Selected bundles/quarto-website-r-deps/_quarto.yml
    • NOTE: would exhibit same missing styles.css if picked different quarto file as entrypoint.
  5. bundles/quarto-website-r-py
    • UNABLE to deploy
Error when running renv::restore()` - `Reason(s):
'ld: library not found for -lgfortran'
install of package 'Matrix' failed [error code 1]`
- Ran `renv::snapshot()` and chose to not install missing packages.
- **Success** deploying after ^^^ - entrypoint selected `bundles/quarto-website-r-py/_quarto.yml`
  1. bundles/quarto-website-r-py-deps
    • Selected bundles/quarto-website-r-py-deps/_quarto.yml as entrypoint.
    • Ran renv::snapshot() and chose to not install missing packages
    • See warning:
The 'yaml' package is required to parse dependencies within Quarto Markdown files 
Consider installing it with `install.packages("yaml")`. 
- Did not make a difference - `deps.R` was not picked up by `quarto inspect`
- Deployed successfully, but failed to run:
An error occurred while running your content. (Error code: render-missing-r-package)
- Manually added `deps.R` and saw error on connect log:
! there is no package called 'rsample'
- Ran `renv::snapshot()` and selected to install packages and snapshot again.
- Success deploying and running!
  1. bundles/quarto-website-r-py-separate-files
    • ran renv::snapshot() and restored packages
    • saw message:
Warning message:
The 'yaml' package is required to parse dependencies within Quarto Markdown files
Consider installing it with `install.packages("yaml")`.
- reran `renv::snapshot()` to generate new lockfile
- added `deps.R` to file list
- **Success**
  1. bundles/quarto-website-r-py-separate-files-deps
    • ran renv::snapshot() and restored packages
    • ran install.packages("yaml")
    • ran renv::snapshot() to generate new lockfile
    • added deps.R to file list
    • Success

@sagerb
Copy link
Collaborator

sagerb commented Dec 2, 2024

Summary of validation findings:

Problem #1: Not detecting styles.css and adding it to the file list, if do not pick _quarto.yml as entrypoint file. See finding # 9 above, to see how quarto inspect about.qmd did return a reference to the file.

Problem #2: We are seeing different inspection results depending if the entrypoint selected is _quarto.yml or one of the project's qmd files. This feels like it puts too much burden on the user to select the correct one, while they are performing an operation at which time we cannot guide them. Running on the Connect server works, so perhaps we can use the inspection results that we get with _quarto.yml, but also maintain the entrypoint selected?

Questions

  • Are findings within # 2 expected?
  • Multiple examples of how we need to either re-run renv::restore() or renv::snapshot() and restore packages (or not) to allow proper package discovery. Doesn't this conflict with the objective of not needing to be able to execute code?
  • Did we want to update the entrypoint selection dialog to allow selection of directories (to allow Quarto directory/projects?)
  • Should have quarto inspection found the dependency of deps.R? (See 11, 13, 15, and 16)
  • Should we be warning when local quarto version doesn't match with what is on Connect Server?

@sagerb
Copy link
Collaborator

sagerb commented Dec 2, 2024

@marcosnav See my findings above. I think you should address the two problem items above, as technically, they seems within reach. The other items I placed into Questions, just need some group discussion or actions.

@marcosnav
Copy link
Collaborator Author

Thanks for the thorough testing @sagerb!

Problem # 1: Not detecting styles.css and adding it to the file list, if do not pick _quarto.yml as entrypoint file. See finding # 9 above, to see how quarto inspect about.qmd did return a reference to the file.

Good call on this one, I pushed a new commit addressing the config resources found when picking an individual .qmd file as entrypoint.

Should have quarto inspection found the dependency of deps.R?

I don't think so, deps.R is not really used, you should be able to deploy without selecting it. It can be confusing because every example on connect-content requires some kind of renv:: acrobatics to make it work, but that file is not required for the deployment to succeed.

About Problem 2 - _quarto.yml vs xyz-file.qmd entrypoint selection

It is known and expected to have a different data structure for the inspection results. While working on this, I noticed that running the inspection command in the directory of the chosen entrypoint, regardless of being a _quarto.yml or a .qmd file, worked really good and maybe we could rely only on directory inspection.

However, the inspector code for quarto was built with the premise of having a file and inspecting on it and noticed that changing that was going to take more work, creating new questions and bringing more risk, so opted for extending the inspection output structure and detecting when _quarto.yml is chosen.

That said, I'm open to have some refactoring and change things to always inspect directories when it comes to quarto projects, that would be also easier to maintain, but the focus of this work was on allowing quarto websites to be easily deployed, then we can improve that.

About the rest of the questions

I think all those are valid questions worth discussing on our project planning meeting to create individual issues as we see fit. For now I think this current PR has enough scoped changes with a step forward on helping the user with quarto projects giving consistent results when picking _quarto.yml or any other individual file.

@jonkeane
Copy link
Collaborator

jonkeane commented Dec 3, 2024

Multiple examples of how we need to either re-run renv::restore() or renv::snapshot() and restore packages (or not) to allow proper package discovery. Doesn't this conflict with the objective of not needing to be able to execute code?

This is exactly the place where we are stuck currently given the ecosystem of manifest.json + needing more information than the renv.lock file has to send up to connect. We would like to live in a Connect world where this isn't a requirement, but today it is. So today we do need to effectively be in a place (well the renv library does) where one could execute the code. But this isn't transitive: just because today we do effectively need to be in that state, that doesn't mean that executing the code is a requirement we should always assert/strive for in other situations or in the future if the manifest.json/renv.lock issue is solved.

NOTE: This seems to be another example of how we do require a working R environment to deploy? Should we detect this by running renv::status() and parsing the output, so we can show a quicker error?

I couldn't quite tell from the formatting if this was a quote of something somewhere or what. But, yes this sounds like a good idea. We almost certainly should not do it in this PR, but using renv::status to diagnose the renv setup (and then "just" passing whatever renv says to the user to resolve) would be an excellent way to get folks into an renv state that works for publishing.

Copy link
Collaborator

@sagerb sagerb left a comment

Choose a reason for hiding this comment

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

Thanks for making the latest set of changes. I've validated them and reviewed that code as well. Looks great!

I'm ok with putting off a discussion regarding the switch to simply always performing inspection upon the subdirectory of what has been selected as an entrypoint. It feels like something that would provide the same type of functionality as the IDE, so I'd recommend we investigate and discuss this further.

@marcosnav marcosnav merged commit 3f22dbb into main Dec 6, 2024
14 checks passed
@marcosnav marcosnav deleted the mnv-quarto-websites branch December 6, 2024 15:24
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 Website not deploying as expected
3 participants