ThinkR-open / golem

A Framework for Building Robust Shiny Apps
https://thinkr-open.github.io/golem/
Other
908 stars 132 forks source link

Fix 887 and improve code coverage of `R/config.R` from 28.21% to 100% #1043

Closed ilyaZar closed 1 year ago

ilyaZar commented 1 year ago

Fix #887

Problem: Whenever golem::document_and_reload() calls get_golem_wd() to retrieve values from a yml-config, and the user changed the location of that yml before that call, golem::document_and_reload() is not aware of that location change and fails. Specifically, guess_where_config() cannot find the location when it is not of standard type (e.g. "inst/golem-config.yml").

Fix: This PR solves this by adding a helper to guess_where_config() which finds the user config-yaml by reading its new location from user changes in "R/app_config.R".

ALanguillaume commented 1 year ago

Thanks a lot @ilyaZar !

I will take the time to review your PR asap. In the mean time I quickly eye-balled on the code and made a few comments.

ilyaZar commented 1 year ago

Done:

Just refactored the logic for the whole file because it got complicated and messy. Here is a summary of all changes of this PR so far:

image

To-Do:

ilyaZar commented 1 year ago

@VincentGuyader do you think above CI failures relate to #1072 or #1070 ? my forked branch passed the tests on my local machine hence the question.

if you point me somewhere I'll try to fix the PR myself to make it pass the CI. thanks!