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

v 0.5.0 release candidate #1163

Merged
merged 317 commits into from
Aug 16, 2024
Merged

v 0.5.0 release candidate #1163

merged 317 commits into from
Aug 16, 2024

Conversation

ColinFay
Copy link
Member

@ColinFay ColinFay commented Aug 7, 2024

No description provided.

ColinFay and others added 30 commits May 26, 2023 10:56
get_current_config()/add_dockerfiles_renv() use golem::get_golem_wd

- get_current_config() defaults to get_golem_wd() instead getwd()
- guess_where_config() defaults to get_golem_wd() instead pkg_path
- add_dockerfiles_renv() defaults to get_golem_wd() instead "."
- daf_desc(path = ...) defaults to get_golem_wd() instead "."
- pkg_{name,verion}() default to get_golem_wd() instead "."
- change docs to reference get_golem_wd() as the new default path for argument 'sourcefolder'
- add punctuation ad the end of some arg-docs for consistency purposes
- update docs to fill_desc()
- update docs to param set_options
- use consistent RMD style: remove \code{} and replace with ` `
- add argument check to set_options to NOT FAIL SILENTLY when a typo
  occurs
- restyle file with grk_style_transformer()
- remove artefacts from older set_options()
- inform user about setting some default golem options
mostly formatting, typos and some text improvements:
1. move code chunks below bullets in .Rmd to improve visual appearance
2. be consistent with use of markdown for package names
3. remove other artefacts from old set_golem_option() use
4. hide last code chunk
5. fix other typos
6. be more descriptive in some places
rename add_rstudioconnect_file() to add_positconnect_file() in files:

- add_rstudio_files.R
- vignettes/c_deploy.Rmd
- tests/testthat/test-add_deploy_helpers.R
- inst/mantest/build.R
- inst/shinyexamle/dev/03_deploy.R
- _pkgdown.yml

Not touching NAMESPACE, .Rd-files, and NEWS.md as they are updated otherwise.

Keep  add_rstudioconnect_file for compatibility but with depcrecation
note.

Refs: #888
* Add -it flag when run docker so ^C still works

Add -it flag when run docker so ^C still works

* Revert "Add -it flag when run docker so ^C still works"

This reverts commit ac237d5.

* ci: code coverage

* ci: simpler pkgdown action

* ci: installing thinkridentity in the pkgdown site

* fix dockerfiler deps

---------

Co-authored-by: Ivo Kwee <[email protected]>
Co-authored-by: Colin Fay <[email protected]>
Co-authored-by: colin <[email protected]>
* Add -it flag when run docker so ^C still works

Add -it flag when run docker so ^C still works

* Revert "Add -it flag when run docker so ^C still works"

This reverts commit ac237d5.

* ci: code coverage

* ci: simpler pkgdown action

* ci: installing thinkridentity in the pkgdown site

* chore : triger ci, add new french video on README

---------

Co-authored-by: Ivo Kwee <[email protected]>
Co-authored-by: Colin Fay <[email protected]>
Co-authored-by: colin <[email protected]>
* Fix 887 and improve code coverage of `R/config.R` from  28.21% to 100% (#1043)

* fix: add user supplied path to config for guess_where_config()

- add helper try_user_config_location()
    - search for new config location to be set inside R/app_config.R
- update guess_where_config() with a final guess using this helper
- run styler::style_file("R/config.R", transformers =
  grkstyle::grk_style_transformers())

* fix: logical scalar operation should use && instead of &

* test: guess_where_config() works with path changes

- path changes mean new dir and new filename so:
  - create a new dir for config
  - move config to that dir and rename

=> test correctly identifies changes (changing dir AND changing filename) in the yaml-config.

attribute to @ALanguillaume with some minor tweaks

Co-authored-by: ALanguillaume <[email protected]>

* refactor: improve readability and logical of `try_user_config_location()`

- encapsulate finding the relevant lines in the config file into "guess_lines_to_config_file()"
    - function allows for multi-line/grk-style app_sys()-calls (if file path to long and must be put into next line)
    - has clearer and commented logic to find the lines
- document proper logic of function with comments
- style with `grkstyle::grk_style_transformer`
- update `tests/testthat/test-config.R` to incorporate above changes and move code coverage of that file to 63.16%

* style: try_user_config_location() returns fs-paths for consistency

- allows valid comparison with fs_path()'s inside guess_where_config() and output values from try_user_config_location()
- fix a typo in a comment

* refactor: improve readability and logic inside guess_where_config

Why:

- clearly outline the different cases: since now the user can add a golem-config, there can be conflicting cases between the default golem config and the user golem config (if e.g. the user forgets to delete the default)
- update the tests to check these different cases
- remark: test inside testthat should work without golem:: prefixes

* test: add test for exotic corner cases of guess_where_config()

- test that config file can be found if
   - we end up inside "inst/" (a corner case not tested before)
   - guess_where_config() is fed with argument values for 'path' and 'file' that do not work

-> improves code coverage to 70.75%

* feature: guess_where_config() fails a bit faster

- remove last if-statement (which is almost a duplicate of the one before)
   -> this makes the guess_where_config() fail easier (i.e. return NULL) as other exotic corner cases should be handled more explicitly
- remark: golem::pkg_path() will (almost) never produce an error but this may change so the try-construct within attempt() is kept

- improve comments for corner case IV.B as internal developer note

* refactor: encapsulate yesno() for clarity and easier testing

* test: move coverage of R/config.R to 100%

- notably: add package mockery to Suggests (no dependencies except for testthat and used for tests only)

- add tests for non-interactive usage of guess_where_config(): check that error is thrown correctly

- add tests for interactive usage of guess_where_config():
    - user says yes: test that necessary files are created
    - user says no: test that we return NULL

- add tests for encapsulated ask_golem_creation_upon_config()
    - shallow test as non-interactive menu() calls (inside the yesno()) are forbidden
    - but this makes code coverage 100% :)

* docs: update docs for get_current_config()

- only exported function from R/config.R needs proper docs
- besides more details on older usage and behavior:
    - add docs on how to set user supplied golem config
    - add code snippets

---------

Co-authored-by: ALanguillaume <[email protected]>

* chore update news and Rd files

---------

Co-authored-by: Ilya Zarubin <[email protected]>
Co-authored-by: ALanguillaume <[email protected]>
* Fix 1074 to improve code coverage of `R/utils.R` to 100% (#1075)

* feature: improve is_exisiting_module()

    - make it self-check if is called inside an R package (by checking for existence of an R-directory)
    - improve docs: add information that it checks for the existence of a module /!\ file /!\ name which is not the same as a module
    - improve tests:
        - proper cleanup of a golem
        - check failure/error if not inside a R-package (in the above sense)

* tests: test create_if_need() function non-interactively

- must produce error when called non-interactively for argyment type="file"

* refactor: add clearer logic for create_if_needed() and test interactively 'no'

- allow mocking of user interaction with "no"-response for testing purposes
    - requires encapsulation of yesno() to a separate function
- restyle the file with grkstyler
- add a test that mimicks user interation with "no" response of the yesno()-function

=> improve test coverage to 60.09 %

* tests: add test for user interactive behavior "yes"

whereby improving coverage to 62.62 %

* refactor:

- shallow-test encapsulated function ask_golem_creation_file()
- remove redundant check_file_exist() which is never used inside `{golem}`!
- improve formatting of some comments inside create_if_needed()

=> improve test coverage to 67.79%

* tests: increaset R/utils.R coverage to 88.98%

- snapshot tests save the output of cli-messages and check options
    - if cli:: package changes we see a different output and the snapshots will inform about this
    - additionally check do_if_unquiet() feature of these message functions

* chore set att_amend_desc default parameters

---------

Co-authored-by: Ilya Zarubin <[email protected]>
…1080)

* tests: add tests to increase test coverage

- change filename: testthat style suggets naming "tests/test-with_opt.R" to test functions in a file named "R/with_opt.R"
- improve tests for maintenance mode to see whether it works with setting options in a fresh golem
- add tests for "SHINY_PORT"

Refs: #1065

* tests: add tests to further increase coverage

Add a test for get_golem_options() function which was untested before.

* tests: test with_golem_options() with print=TRUE

- formatting with grk
- update comments to explain the test
- update the SHINY_PORT test to actually test the behaviour properly
- add a new test to check whether print=TRUE works inside with_golem_options()

Co-authored-by: Ilya Zarubin <[email protected]>
* Fix 1026 (#1064)

* docs: link to golemverse for external resources

The "Example Apps" section on the golemverse page is missing, so I kept it there for as a level two header (in case one wants to copy it to the golemvsere page).

* docs: move sections with relevant content for the user to the top

I. user preferences in terms of priority (more or less ...) probably
   1. Installation
   2. New project creation
   3. Every day workflow
   4. Additional resources
   5. Meta info such as about (golem version/code coverage), CoC, how to contribute etc.

II. developer preference in terms of priority (more or less ...) probably
   1. Meta info in the "About" section golem version/code coverage
   2. the rest from above

Though I'd prefer the current ordering myself it might be a wise choice to change it towards the user, but that's a matter of taste.

Fix some typos and markdown styling.

---------

Co-authored-by: vincent guyader <[email protected]>

* chore update README

fix #1026

---------

Co-authored-by: Ilya Zarubin <[email protected]>
* Fix 1058, 1060, 1062 and improve code coverage in `use_files.R` from 0 to 100% (#1059)

* tests: add dummy files for use_{external,internal}_XXX_files() testing

- add some dummy files to the inst/utils/ directory

- for later: add tests that download exactly from that directory

Refs: #1058

* tests: add testing for external-funcs standard cases

* tests: add testing for internal-funcs standard cases

- fix typo in testfile_template_html
- use styler::style_file(..., style = grkstyle::grk_style_transformer)

* fix: set default value for argument name before using it

- the order needs a change at some places: first set a default value when name argument is missing
    - only then call check_name_length() to avoid errors of the type:
    "argument "name" is missing, with no default"
- also, to avoid RStudio and other IDEs linting a missing argument, provide a default value "NULL" for argument  'name'

Refs: #1060

* feat: improve error handling and allow codecovr. to be 100%

- instead of throwing an error, return 'FALSE' is passed and cat_dir_necessary() prints an informative message to the user (with the same effect i.e. not creating a directory)
- this behavior is a bit more userfriendly and also allows for a code coverage of 100%; the latter is not possible to implement since tests are run non-interactively

* tests: add corner cases for tests to make covr. 100%

* chore bump coverage

---------

Co-authored-by: Ilya Zarubin <[email protected]>
* add user supplied `file` for `run_dev()` & make covr. 100% for `run_dev.R`  (#1050)

* fix: user supplied 'file'-argument works correctly

- use path constructed from 'file' argument instead of hard code "dev/run_dev.R"
- improve error message on failure

Refs: #886

* tests: improve test-covr. of run_dev.R form 0% to 100%

- add test for default 'file' argument
- add test for user supplied 'file' argument where
    - run_dev.R renamed to run_dev2.R
    - path to run_dev changed to top-level golem path
- add test for error if run_dev cannot find the 'file'

* docs: update docs for run_dev

- give a bit more context on usage
- fix some typos
- use markdown highlighting consistently
- add invisible return as this is a pure side-effect function

* core update README

---------

Co-authored-by: Ilya Zarubin <[email protected]>
@ColinFay
Copy link
Member Author

go !

@ColinFay ColinFay merged commit 5fba0b3 into master Aug 16, 2024
0 of 12 checks passed
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.

7 participants