insightsengineering / teal.slice

Reproducible slice module for teal applications
https://insightsengineering.github.io/teal.slice/
Other
11 stars 5 forks source link

335 modify Rd database #568

Closed chlebowa closed 4 months ago

chlebowa commented 4 months ago

Fixes #335

Package index is built during the installation process but only once the package has been actually installed. A file is created, <package>/html/00Index.html, that is the source for the index page. The file is built based on a parsed Rd database that is stored in <package>/Meta/Rd.rds.

Here, a script is created that will modify the existing Rd.rds and add it to inst/Meta, so that it the modified version can be used during index creation.

Note that if documentation files are changed and the index should be updated, this script must be run again. It should be done before every release at least.

github-actions[bot] commented 4 months ago

badge

Code Coverage Summary

Filename                        Stmts    Miss  Cover    Missing
----------------------------  -------  ------  -------  ------------------------------------------------------------------------------------------------------------------------------------------------------
R/calls_combine_by.R                7       0  100.00%
R/choices_labeled.R                49      14  71.43%   25, 36, 41, 51-56, 68, 72-76
R/count_labels.R                   97       0  100.00%
R/filter_panel_api.R               29       1  96.55%   132
R/FilteredData-utils.R             68      25  63.24%   21-24, 27-30, 52-57, 153, 175-184
R/FilteredData.R                  562     227  59.61%   110, 184, 326, 398, 501-510, 533, 554-595, 613-616, 632, 673-706, 721-723, 727-733, 762-790, 813-815, 819-821, 824-838, 842-852, 855-898, 939, 962-984
R/FilteredDataset-utils.R          23       1  95.65%   125
R/FilteredDataset.R               170      61  64.12%   52, 152, 191, 216-273, 312-314
R/FilteredDatasetDataframe.R      121       8  93.39%   87, 148, 158, 234-238
R/FilteredDatasetDefault.R         18       4  77.78%   103-116
R/FilteredDatasetMAE.R            134      37  72.39%   56, 117-122, 161-166, 170-171, 189-211
R/FilterPanelAPI.R                 10       0  100.00%
R/FilterState-utils.R             101       2  98.02%   264, 294
R/FilterState.R                   361      61  83.10%   89, 212, 230-234, 241-242, 256-257, 263-264, 311, 313, 315, 367, 411, 639, 682-705, 715-734, 769-775, 784-790
R/FilterStateChoices.R            341     108  68.33%   310-313, 325, 367, 389-396, 400-417, 445, 458-469, 481-489, 493-522, 543-546, 549-552, 563-586, 597, 602, 613
R/FilterStateDate.R               212     129  39.15%   227, 279-436
R/FilterStateDatettime.R          309     199  35.60%   266, 318-549
R/FilterStateEmpty.R               53      31  41.51%   89, 99-104, 117, 129-169
R/FilterStateExpr.R                75      62  17.33%   149-272
R/FilterStateLogical.R            196     144  26.53%   136, 158, 218, 222-406
R/FilterStateRange.R              408     105  74.26%   262, 384, 510-514, 517-527, 530, 542-548, 559-571, 575-585, 589-591, 605-632, 647, 650, 664-681, 716-721, 731-733
R/FilterStates-utils.R             70       9  87.14%   108, 127, 188-194, 216, 245
R/FilterStates.R                  364      30  91.76%   78-82, 191, 314-323, 411-414, 457, 542-546, 591, 712-715
R/FilterStatesDF.R                  5       0  100.00%
R/FilterStatesMAE.R                10       1  90.00%   40
R/FilterStatesMatrix.R              3       0  100.00%
R/FilterStatesSE.R                211     157  25.59%   36, 71-73, 83-85, 109-116, 124-131, 154-302
R/include_css_js.R                  5       5  0.00%    12-16
R/teal_slice.R                    107       4  96.26%   134, 188-189, 200
R/teal_slices.R                    84       5  94.05%   144-149
R/test_utils.R                     21       0  100.00%
R/utils.R                          18       0  100.00%
R/variable_types.R                 15       8  46.67%   44-51
R/zzz.R                            16      16  0.00%    3-46
TOTAL                            4273    1454  65.97%

Diff against main

Filename      Stmts    Miss  Cover
----------  -------  ------  --------
TOTAL             0       0  +100.00%

Results for commit: daf98596ba793e53d5591886b84ac1c0a231f35a

Minimum allowed coverage is 80%

:recycle: This comment has been updated with latest results

github-actions[bot] commented 4 months ago

Unit Tests Summary

  1 files   29 suites   22s :stopwatch: 359 tests 359 :white_check_mark: 0 :zzz: 0 :x: 824 runs  824 :white_check_mark: 0 :zzz: 0 :x:

Results for commit daf98596.

:recycle: This comment has been updated with latest results.

m7pr commented 4 months ago

For custom operations during the build I would suggest creating a script that does everything needed to have the package properly build, that would include so far:

And then move to the convention where we use scripts for building packages and we don't use custom RStudio buttons nor shortcuts nor custom commands.

m7pr commented 4 months ago

Well, I'm impressed what you come up with! Nice research and clever approaches. We just need to weight what is the cost of managing this feature. I think it's worth it

m7pr commented 4 months ago

I prefer this solution over https://github.com/insightsengineering/teal.slice/pull/569 as we modify the package before the build. So nobody needs an access to R library during or after package installation, which removes the issue that @pawelru mentioned here https://github.com/insightsengineering/teal.slice/pull/569#issuecomment-1981245678 (inability to over-write package files).

chlebowa commented 4 months ago

Well, unfortunately it results in a check warning:

* checking package subdirectories ... WARNING
Found the following non-empty subdirectories of ‘inst’ also used by R:
  inst/Meta
It is recommended not to interfere with package subdirectories used by
R.
m7pr commented 4 months ago

ouch : /