Skip to content

zz ‐ [archive ‐ roadmap ‐ v0.5] Inflate all and clean the package after inflates

Sébastien Rochette edited this page Aug 17, 2023 · 1 revision

Emoji Legend

  • ✅ Done
  • ⚠️ We faced a problem, and took more time than estimated
  • ⏳ Number of days estimated for a section
  • 🟣 We are on it at the moment
  • 🔴 You decided that we will not realise it
  • ⏸️ You decided it is not mandatory, but nice if we have time
  • 🔜 To be done soon

v0.5

=> https://github.com/ThinkR-open/fusen/milestone/2

Context

  • The aim is to allow to clean the package if users inflated functions from the examples, or if there renamed some function.
  • We want to detect obsolete files in "R/", "tests/" and "vignettes/"
  • We want to allow the user to list some files that were not inflated, and directly written in "R/", "tests/" or "vignettes/"

If functions are renamed, old R files stay in the "R/" directory.
Create a new function to warn if there are functions not in any flat file.
This function needs to be independent or optional as there may be old functions from before using {fusen}.

Steps

✅ config file

  • List in a metadata file during inflate (yaml ?):
    • This lists outputs of the flat file
    • This lists scripts that should not be cleaned because manually added
flat_add_toto.Rmd:
  R: fun.R, zaza.R
  tests: test-fun.R, test-zaza.R
  vignette: start-fun.Rmd
dont_clean:
  R: my_fun_from_before.R, my_golem_module.R
  tests: test-my_fun_from_before.R
  vignette: Userguide.Rmd

✅ The migration process from previous {fusen} and keep some files

  • Detect all R, tests, vignettes files
  • Detect files linked to a flat_file to register to "config_fusen.yaml"
  • Allow some "keep" files, not created with the fusen process
  • Allow to register everything before starting the cleaning process, assuming all files are legitimate:

✅ Inflate all

The issues needed to reach this goal are gathered in a dedicated milestone : https://github.com/ThinkR-open/fusen/milestone/3

The objective is to build an inflate_all() function, able to inflate every flat file present in a package created with {fusen}.

Pre-requisite for this feature : having inflated each flat file individually, hence the config_fusen.yml will contain the inflate parameters

See how to deal with this step in the future, to remove this pre-requisite

✅ Step 1

Modify config_fusen.yml to be able to store fusen::inflate() parameters

config_fusen.yml currently stores some informations, for instance a list of the .R files, unit tests files and vignettes associated to each flat file. This is done through fusen::df_to_config(). This function must be modified to be able to store fusen::inflate() parameters in config_fusen.yml

Issues

Issue #194

✅ Step 2

Within a call to fusen::inflate() there is a call to fusen::df_to_config(). We want the parameters of the fusen::inflate() call to be used by fusen::df_to_config() in order to write them in config_fusen.yml

Issues

Issue #196

Related issue #190

✅ Step 3

We need to be able to read the inflate parameters in the config_fusen.yml in order to inflate all the "active" flat files listed in this config file.

The function read_inflate_params() is created.

Issues

Issue #198

✅ Step 4

We need to able to list which flat files can be used in inflate_all() and those which can't and tell why.

Issues

Issue #202

✅ Step 5

Inflate all the flat files listed in config_fusen.yaml and for which inflate-related parameters were specified. We need to use the functions read_inflate_params() and pre_inflate_all_diagnosis(....)

✅ Issues

Issue #96

Associated PR : https://github.com/ThinkR-open/fusen/pull/204

✅ Work remaining to be done

⏳ Estimated Time : 1 day

  • Writing documentation

⏳ Estimated Time : 0.5 day

✅ Extra features

✅ Detect unregistered files

First part of Clean obsolete files in R, tests or vignettes : https://github.com/ThinkR-open/fusen/issues/24

✅ See also https://github.com/ThinkR-open/fusen/milestone/2

✅ CRAN submission

Work to be done

  • Version upgrade
  • NEWS.md to be updated
  • CRAN-related checks

⏳ Estimated Time : ? days

✅ Blog post writing

Work to be done

  • Writing
  • Reviewing
  • Publishing

⏳ Estimated Time : 1 day (for writing step)