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

Fix change config yml loc #1042

Conversation

ilyaZar
Copy link
Contributor

@ilyaZar ilyaZar commented May 24, 2023

Fix #887

Problem:
Whenever golem::document_and_reload() calls get_golem_wd() to retrieve values from a yml-config, and the user changed the destination of that yml before that call, golem::document_and_reload() has no chance to know about that config change in the current setup.

Fix:
This PR solves this by adding a helper to guess_where_config() which finds the user config-yaml , reads it and passes the wd (and possibly other configs) to get_golem_wd(), golem::document_and_reload() etc.

ColinFay and others added 30 commits July 2, 2022 10:28
All config manipulation now go through amend_golem_config.
This allows to be sure that the !expr are not lost

Close ThinkR-open#709
There is no need to set things that are already set in the yaml
The name is already set by the function that gsub in the files
so there is no need to do it one extra time
…_wd()

The attr is not set before being passed to set_golem_wd() in set_golem_options()
The yaml manimpulation functions are now separated
in various files
The get_golem_* didn't rely on the GOLEM_CONFIG_ACTIVE  env_var
+ get_golem_wd tries golem::pkg_path
+ get_golem_name tries pkg_name
+ get_golem_version tries pkg_version
Hotfix because of the dirty way we released
version 0.3.3
path is now renamed pkg
ColinFay and others added 27 commits April 4, 2023 21:23
1. add a double check to look for modules with names starting with "mod_mod_xxx" (see R/add_r_files.R)

2. add syntax check for module names to add_module(): explicitly ask the user if s/he wants to name her module "mod_xxx" or "mod_mod_xxx"
- save old golem name in tmp-variable and use helper-func inside set_golem_name() to overwrite tests/testthat.R
- helper-func screens for old_name instances and replaces them with new_name

Refs: ThinkR-open#805
- save <old_name> in tmp-variable and use helper-func inside set_golem_name() to change file name from "vignettes/<old_name>.R" to "vignettes/<new_name>.R"
- helper-func screens for old_name instances inside <vignettes/<old_name>.R> and replaces them with new_name, then saves output to "vignettes/<new_name>.R"

Refs: ThinkR-open#805
- adding a message to the user to check for
other places for the name
- passing the path to sub functions
- remove 'author_XXX' args and replace with 'authors'
- make 'authors' arg default to class 'person'
- use class check on 'authors', throw error if it fails
- use desc$set_authors

This mostly draws from the ideas of @jmeyer2482 and @ColinFay:

Co-authored-by: Colin Fay <[email protected]>
Co-authored-by: jmeyer2482 <[email protected]>
- update vignette/a_start.Rmd with new fill_desc() interface
- delete some redundant whitespaces in same file
- changes since values of authors are of type person() which
    requires parsing the entries
- adjust interace of fill_desc() so build.R runs smoothly
Merge branch 'fix-change-config-yml-loc' of https://github.com/ThinkR-open/golem into fix-change-config-yml-loc

# Conflicts:
#	R/config.R
#	tests/testthat/test-config.R
- add helper try_user_config_location() that searchers for the new config location which is to be set inside R/app_config.R
- update guess_where_config() with a final guess using this helper
@ilyaZar
Copy link
Contributor Author

ilyaZar commented May 24, 2023

hups that that was certainly not what I wanted to do...

@ilyaZar ilyaZar closed this May 24, 2023
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.