From a24a453d14679fbf85a7296af78bd9c316cf5486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Mon, 11 Nov 2024 12:30:35 +0100 Subject: [PATCH 01/19] Remove TealData checks --- R/init.R | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/R/init.R b/R/init.R index a2c1fac786..72a61380d4 100644 --- a/R/init.R +++ b/R/init.R @@ -103,16 +103,6 @@ init <- function(data, # argument checking (independent) ## `data` - if (inherits(data, "TealData")) { - lifecycle::deprecate_stop( - when = "0.15.0", - what = "init(data)", - paste( - "TealData is no longer supported. Use teal_data() instead.", - "Please follow migration instructions https://github.com/insightsengineering/teal/discussions/988." - ) - ) - } checkmate::assert_multi_class(data, c("teal_data", "teal_data_module")) checkmate::assert_class(landing_popup, "teal_module_landing", null.ok = TRUE) From 126cbbf9c21bd899e4084aa0f05a968dbf1e3b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Mon, 11 Nov 2024 12:45:23 +0100 Subject: [PATCH 02/19] Convert server usage of dataset to an error. --- R/modules.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/modules.R b/R/modules.R index a021187e61..25b3b4e5ff 100644 --- a/R/modules.R +++ b/R/modules.R @@ -197,7 +197,7 @@ module <- function(label = "module", ) } if ("datasets" %in% server_formals) { - warning( + stop( sprintf("Called from module(label = \"%s\", ...)\n ", label), "`datasets` argument in the server is deprecated and will be removed in the next release. ", "Please use `data` instead.", From f16851dfbee10f4c89061c1759bda2c125d47eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Mon, 11 Nov 2024 12:47:23 +0100 Subject: [PATCH 03/19] Notification about module(server) no longer accepting datasets. --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 311afab39c..acb4cd9891 100644 --- a/NEWS.md +++ b/NEWS.md @@ -15,6 +15,7 @@ `datanames` one should modify `module$datanames`. * The `landing_popup_module()` needs to be passed as the `landing_popup` argument of `init` instead of being passed as a module of the `modules` argument of `init`. * `teal` no longer re-export `%>%`. Please load `library(magrittr)` instead or use `|>` from `base`. +* `module(server)` argument does not accept the `datasets` argument. ### Enhancement From 2161502d1c39bea8473cfa203e8c0e1cee400118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= <185338939+llrs-roche@users.noreply.github.com> Date: Mon, 11 Nov 2024 14:18:10 +0100 Subject: [PATCH 04/19] Update NEWS.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marcin <133694481+m7pr@users.noreply.github.com> Signed-off-by: LluΓ­s Revilla <185338939+llrs-roche@users.noreply.github.com> --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index acb4cd9891..19eac23a27 100644 --- a/NEWS.md +++ b/NEWS.md @@ -15,7 +15,7 @@ `datanames` one should modify `module$datanames`. * The `landing_popup_module()` needs to be passed as the `landing_popup` argument of `init` instead of being passed as a module of the `modules` argument of `init`. * `teal` no longer re-export `%>%`. Please load `library(magrittr)` instead or use `|>` from `base`. -* `module(server)` argument does not accept the `datasets` argument. +* `module(server)` parameter does not accept the `datasets` argument. ### Enhancement From 59a06ca4e5ac9c2ebb7b08be28521b48fba525e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Mon, 11 Nov 2024 14:50:42 +0100 Subject: [PATCH 05/19] Remove modules checks for datasets --- R/modules.R | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/R/modules.R b/R/modules.R index 25b3b4e5ff..11a40b57ef 100644 --- a/R/modules.R +++ b/R/modules.R @@ -196,15 +196,6 @@ module <- function(label = "module", "\n - `...` server_args elements will be passed to the module named argument or to the `...`" ) } - if ("datasets" %in% server_formals) { - stop( - sprintf("Called from module(label = \"%s\", ...)\n ", label), - "`datasets` argument in the server is deprecated and will be removed in the next release. ", - "Please use `data` instead.", - call. = FALSE - ) - } - ## UI checkmate::assert_function(ui) @@ -217,15 +208,6 @@ module <- function(label = "module", "\n - `...` ui_args elements will be passed to the module argument of the same name or to the `...`" ) } - if (any(c("data", "datasets") %in% ui_formals)) { - stop( - sprintf("Called from module(label = \"%s\", ...)\n ", label), - "UI with `data` or `datasets` argument is no longer accepted.\n ", - "If some UI inputs depend on data, please move the logic to your server instead.\n ", - "Possible solutions are renderUI() or updateXyzInput() functions." - ) - } - ## `filters` if (!missing(filters)) { From 5d3e89e7a98d5466a0f4bdb56f0cf132437e5905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Mon, 11 Nov 2024 14:58:36 +0100 Subject: [PATCH 06/19] Remove tests related to parameters datasets --- tests/testthat/test-module_teal.R | 20 -------------------- tests/testthat/test-modules.R | 8 -------- 2 files changed, 28 deletions(-) diff --git a/tests/testthat/test-module_teal.R b/tests/testthat/test-module_teal.R index 2e91a13f57..79db71e2c3 100644 --- a/tests/testthat/test-module_teal.R +++ b/tests/testthat/test-module_teal.R @@ -915,26 +915,6 @@ testthat::describe("srv_teal teal_modules", { ) }) - testthat::it("srv_teal_module.teal_module passes (deprecated) datasets to the server module", { - testthat::expect_warning( - shiny::testServer( - app = srv_teal, - args = list( - id = "test", - data = teal.data::teal_data(iris = iris, mtcars = mtcars), - modules = modules( - module("module_1", server = function(id, datasets) datasets) - ) - ), - expr = { - session$setInputs(`teal_modules-active_tab` = "module_1") - testthat::expect_s3_class(modules_output$module_1(), "FilteredData") - } - ), - "`datasets` argument in the server is deprecated and will be removed in the next release" - ) - }) - testthat::it("srv_teal_module.teal_module passes server_args to the ...", { shiny::testServer( app = srv_teal, diff --git a/tests/testthat/test-modules.R b/tests/testthat/test-modules.R index b1658af98c..4e4c1474cb 100644 --- a/tests/testthat/test-modules.R +++ b/tests/testthat/test-modules.R @@ -24,14 +24,6 @@ testthat::test_that("module requires label argument to be a string different tha testthat::expect_error(module(label = "global_filters"), "is reserved in teal") }) -testthat::test_that("module warns when server contains datasets argument", { - testthat::expect_warning( - module(server = function(id, datasets) NULL), - "`datasets` argument in the server is deprecated" - ) -}) - - testthat::test_that("module expects server being a shiny server module with any argument", { testthat::expect_no_error(module(server = function(id) NULL)) From 6fd1a377d42e9a526fbb0fa2ae43af0e3b9c05d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Tue, 12 Nov 2024 10:35:31 +0100 Subject: [PATCH 07/19] Module's ui functions are only checked to have the id parameter. All other parameters are not checked and are silently swallowed by ... --- tests/testthat/test-modules.R | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/testthat/test-modules.R b/tests/testthat/test-modules.R index 4e4c1474cb..d2c10a8133 100644 --- a/tests/testthat/test-modules.R +++ b/tests/testthat/test-modules.R @@ -70,11 +70,6 @@ testthat::test_that("module requires ui_args argument to be a list", { testthat::expect_error(module(ui_args = list(1, 2, 3)), "Must have names") }) -testthat::test_that("module throws when ui has data or datasets argument", { - testthat::expect_error(module(ui = function(id, data) NULL)) - testthat::expect_error(module(ui = function(id, datasets) NULL)) -}) - testthat::test_that("module expects ui being a shiny ui module with any argument", { testthat::expect_no_error(module(ui = function(id) NULL)) testthat::expect_no_error(module(ui = function(id, any_argument) NULL)) From 98832ccc04dcae55aa25b8e8608c550858471071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= <185338939+llrs-roche@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:37:48 +0100 Subject: [PATCH 08/19] Update NEWS.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marcin <133694481+m7pr@users.noreply.github.com> Signed-off-by: LluΓ­s Revilla <185338939+llrs-roche@users.noreply.github.com> --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 588ad00df8..cfc4c77339 100644 --- a/NEWS.md +++ b/NEWS.md @@ -15,7 +15,7 @@ `datanames` one should modify `module$datanames`. * The `landing_popup_module()` needs to be passed as the `landing_popup` argument of `init` instead of being passed as a module of the `modules` argument of `init`. * `teal` no longer re-export `%>%`. Please load `library(magrittr)` instead or use `|>` from `base`. -* `module(server)` parameter does not accept the `datasets` argument. +* `module(server)` parameter no longer supports the `datasets` argument. ### Enhancement From 34cda3c625fc1ccf3d77cfc7d4a8735908325e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Wed, 13 Nov 2024 12:12:30 +0100 Subject: [PATCH 09/19] Undo before merging: Test fix setup-r-dependencies --- .github/workflows/check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 03297d30fc..1f6dd0e1e8 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -21,7 +21,7 @@ jobs: uses: insightsengineering/r.pkg.template/.github/workflows/audit.yaml@main r-cmd: name: R CMD Check 🧬 - uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main + uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@dependency_resolution@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -52,7 +52,7 @@ jobs: insightsengineering/teal.widgets r-cmd-non-cran: name: R CMD Check (non-CRAN) 🧬 - uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main + uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@dependency_resolution@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: From 69ac901149502d25466a6d1cae8783225808479c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Wed, 13 Nov 2024 12:34:38 +0100 Subject: [PATCH 10/19] Avoid issue with two @ on github actions. --- .github/workflows/check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 1f6dd0e1e8..8f7643ca75 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -21,7 +21,7 @@ jobs: uses: insightsengineering/r.pkg.template/.github/workflows/audit.yaml@main r-cmd: name: R CMD Check 🧬 - uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@dependency_resolution* secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -52,7 +52,7 @@ jobs: insightsengineering/teal.widgets r-cmd-non-cran: name: R CMD Check (non-CRAN) 🧬 - uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@dependency_resolution* secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: From 36940bd26161ac63054113d08a5105efdb80991a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Wed, 13 Nov 2024 13:58:23 +0100 Subject: [PATCH 11/19] Temporary: Always use the r.pkg.template branch that has the fix for the github action --- .github/workflows/check.yaml | 22 +++++++++++----------- .github/workflows/docs.yaml | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 8f7643ca75..388b8ecaad 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -18,7 +18,7 @@ on: jobs: audit: name: Audit Dependencies πŸ•΅οΈβ€β™‚οΈ - uses: insightsengineering/r.pkg.template/.github/workflows/audit.yaml@main + uses: insightsengineering/r.pkg.template/.github/workflows/audit.yaml@dependency_resolution* r-cmd: name: R CMD Check 🧬 uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@dependency_resolution* @@ -81,7 +81,7 @@ jobs: insightsengineering/teal.widgets coverage: name: Coverage πŸ“” - uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@main + uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@dependency_resolution* secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -98,10 +98,10 @@ jobs: linter: if: github.event_name != 'push' name: SuperLinter πŸ¦Έβ€β™€οΈ - uses: insightsengineering/r.pkg.template/.github/workflows/linter.yaml@main + uses: insightsengineering/r.pkg.template/.github/workflows/linter.yaml@dependency_resolution* roxygen: name: Roxygen πŸ…Ύ - uses: insightsengineering/r.pkg.template/.github/workflows/roxygen.yaml@main + uses: insightsengineering/r.pkg.template/.github/workflows/roxygen.yaml@dependency_resolution* secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -116,32 +116,32 @@ jobs: insightsengineering/teal.widgets gitleaks: name: gitleaks πŸ’§ - uses: insightsengineering/r.pkg.template/.github/workflows/gitleaks.yaml@main + uses: insightsengineering/r.pkg.template/.github/workflows/gitleaks.yaml@dependency_resolution* spelling: name: Spell Check πŸ†Ž - uses: insightsengineering/r.pkg.template/.github/workflows/spelling.yaml@main + uses: insightsengineering/r.pkg.template/.github/workflows/spelling.yaml@dependency_resolution* secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} links: if: github.event_name != 'push' name: Check URLs 🌐 - uses: insightsengineering/r.pkg.template/.github/workflows/links.yaml@main + uses: insightsengineering/r.pkg.template/.github/workflows/links.yaml@dependency_resolution* vbump: name: Version Bump πŸ€œπŸ€› if: github.event_name == 'push' - uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@main + uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@dependency_resolution* secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} version: name: Version Check 🏁 - uses: insightsengineering/r.pkg.template/.github/workflows/version.yaml@main + uses: insightsengineering/r.pkg.template/.github/workflows/version.yaml@dependency_resolution* licenses: name: License Check πŸƒ - uses: insightsengineering/r.pkg.template/.github/workflows/licenses.yaml@main + uses: insightsengineering/r.pkg.template/.github/workflows/licenses.yaml@dependency_resolution* style: if: github.event_name != 'push' name: Style Check πŸ‘— - uses: insightsengineering/r.pkg.template/.github/workflows/style.yaml@main + uses: insightsengineering/r.pkg.template/.github/workflows/style.yaml@dependency_resolution* with: auto-update: true secrets: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 7c3e2f9617..ea4529cdf9 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -36,7 +36,7 @@ on: jobs: docs: name: Pkgdown Docs πŸ“š - uses: insightsengineering/r.pkg.template/.github/workflows/pkgdown.yaml@main + uses: insightsengineering/r.pkg.template/.github/workflows/pkgdown.yaml@dependency_resolution* secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: From 6ccaf17fbd34f286f7a223431161dd7d8587b6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Wed, 13 Nov 2024 14:09:05 +0100 Subject: [PATCH 12/19] Temporary: Testing again with two @ --- .github/workflows/check.yaml | 26 +++++++++++++------------- .github/workflows/docs.yaml | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 388b8ecaad..a37ef6e0ee 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -18,10 +18,10 @@ on: jobs: audit: name: Audit Dependencies πŸ•΅οΈβ€β™‚οΈ - uses: insightsengineering/r.pkg.template/.github/workflows/audit.yaml@dependency_resolution* + uses: insightsengineering/r.pkg.template/.github/workflows/audit.yaml@dependency_resolution@main r-cmd: name: R CMD Check 🧬 - uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@dependency_resolution* + uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@dependency_resolution@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -52,7 +52,7 @@ jobs: insightsengineering/teal.widgets r-cmd-non-cran: name: R CMD Check (non-CRAN) 🧬 - uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@dependency_resolution* + uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@dependency_resolution@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -81,7 +81,7 @@ jobs: insightsengineering/teal.widgets coverage: name: Coverage πŸ“” - uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@dependency_resolution* + uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@dependency_resolution@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -98,10 +98,10 @@ jobs: linter: if: github.event_name != 'push' name: SuperLinter πŸ¦Έβ€β™€οΈ - uses: insightsengineering/r.pkg.template/.github/workflows/linter.yaml@dependency_resolution* + uses: insightsengineering/r.pkg.template/.github/workflows/linter.yaml@dependency_resolution@main roxygen: name: Roxygen πŸ…Ύ - uses: insightsengineering/r.pkg.template/.github/workflows/roxygen.yaml@dependency_resolution* + uses: insightsengineering/r.pkg.template/.github/workflows/roxygen.yaml@dependency_resolution@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -116,32 +116,32 @@ jobs: insightsengineering/teal.widgets gitleaks: name: gitleaks πŸ’§ - uses: insightsengineering/r.pkg.template/.github/workflows/gitleaks.yaml@dependency_resolution* + uses: insightsengineering/r.pkg.template/.github/workflows/gitleaks.yaml@dependency_resolution@main spelling: name: Spell Check πŸ†Ž - uses: insightsengineering/r.pkg.template/.github/workflows/spelling.yaml@dependency_resolution* + uses: insightsengineering/r.pkg.template/.github/workflows/spelling.yaml@dependency_resolution@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} links: if: github.event_name != 'push' name: Check URLs 🌐 - uses: insightsengineering/r.pkg.template/.github/workflows/links.yaml@dependency_resolution* + uses: insightsengineering/r.pkg.template/.github/workflows/links.yaml@dependency_resolution@main vbump: name: Version Bump πŸ€œπŸ€› if: github.event_name == 'push' - uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@dependency_resolution* + uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@dependency_resolution@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} version: name: Version Check 🏁 - uses: insightsengineering/r.pkg.template/.github/workflows/version.yaml@dependency_resolution* + uses: insightsengineering/r.pkg.template/.github/workflows/version.yaml@dependency_resolution@main licenses: name: License Check πŸƒ - uses: insightsengineering/r.pkg.template/.github/workflows/licenses.yaml@dependency_resolution* + uses: insightsengineering/r.pkg.template/.github/workflows/licenses.yaml@dependency_resolution@main style: if: github.event_name != 'push' name: Style Check πŸ‘— - uses: insightsengineering/r.pkg.template/.github/workflows/style.yaml@dependency_resolution* + uses: insightsengineering/r.pkg.template/.github/workflows/style.yaml@dependency_resolution@main with: auto-update: true secrets: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index ea4529cdf9..f051434992 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -36,7 +36,7 @@ on: jobs: docs: name: Pkgdown Docs πŸ“š - uses: insightsengineering/r.pkg.template/.github/workflows/pkgdown.yaml@dependency_resolution* + uses: insightsengineering/r.pkg.template/.github/workflows/pkgdown.yaml@dependency_resolution@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: From 1a14f636a62ed70e7592b4dbd767c198090b8abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Wed, 13 Nov 2024 14:13:22 +0100 Subject: [PATCH 13/19] Temporary: test action with hash instead of branch name --- .github/workflows/check.yaml | 26 +++++++++++++------------- .github/workflows/docs.yaml | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index a37ef6e0ee..3de27008cc 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -18,10 +18,10 @@ on: jobs: audit: name: Audit Dependencies πŸ•΅οΈβ€β™‚οΈ - uses: insightsengineering/r.pkg.template/.github/workflows/audit.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/audit.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc r-cmd: name: R CMD Check 🧬 - uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -52,7 +52,7 @@ jobs: insightsengineering/teal.widgets r-cmd-non-cran: name: R CMD Check (non-CRAN) 🧬 - uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -81,7 +81,7 @@ jobs: insightsengineering/teal.widgets coverage: name: Coverage πŸ“” - uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -98,10 +98,10 @@ jobs: linter: if: github.event_name != 'push' name: SuperLinter πŸ¦Έβ€β™€οΈ - uses: insightsengineering/r.pkg.template/.github/workflows/linter.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/linter.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc roxygen: name: Roxygen πŸ…Ύ - uses: insightsengineering/r.pkg.template/.github/workflows/roxygen.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/roxygen.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -116,32 +116,32 @@ jobs: insightsengineering/teal.widgets gitleaks: name: gitleaks πŸ’§ - uses: insightsengineering/r.pkg.template/.github/workflows/gitleaks.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/gitleaks.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc spelling: name: Spell Check πŸ†Ž - uses: insightsengineering/r.pkg.template/.github/workflows/spelling.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/spelling.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} links: if: github.event_name != 'push' name: Check URLs 🌐 - uses: insightsengineering/r.pkg.template/.github/workflows/links.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/links.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc vbump: name: Version Bump πŸ€œπŸ€› if: github.event_name == 'push' - uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} version: name: Version Check 🏁 - uses: insightsengineering/r.pkg.template/.github/workflows/version.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/version.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc licenses: name: License Check πŸƒ - uses: insightsengineering/r.pkg.template/.github/workflows/licenses.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/licenses.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc style: if: github.event_name != 'push' name: Style Check πŸ‘— - uses: insightsengineering/r.pkg.template/.github/workflows/style.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/style.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc with: auto-update: true secrets: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index f051434992..e46544949c 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -36,7 +36,7 @@ on: jobs: docs: name: Pkgdown Docs πŸ“š - uses: insightsengineering/r.pkg.template/.github/workflows/pkgdown.yaml@dependency_resolution@main + uses: insightsengineering/r.pkg.template/.github/workflows/pkgdown.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: From 6ad436eaf6acac67df1328d646dbe3de57228476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Thu, 14 Nov 2024 09:22:04 +0100 Subject: [PATCH 14/19] Revert temporary changes after setup-r-dependencies was fixed --- .github/workflows/check.yaml | 26 +++++++++++++------------- .github/workflows/docs.yaml | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 3de27008cc..03297d30fc 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -18,10 +18,10 @@ on: jobs: audit: name: Audit Dependencies πŸ•΅οΈβ€β™‚οΈ - uses: insightsengineering/r.pkg.template/.github/workflows/audit.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc + uses: insightsengineering/r.pkg.template/.github/workflows/audit.yaml@main r-cmd: name: R CMD Check 🧬 - uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc + uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -52,7 +52,7 @@ jobs: insightsengineering/teal.widgets r-cmd-non-cran: name: R CMD Check (non-CRAN) 🧬 - uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc + uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -81,7 +81,7 @@ jobs: insightsengineering/teal.widgets coverage: name: Coverage πŸ“” - uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc + uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -98,10 +98,10 @@ jobs: linter: if: github.event_name != 'push' name: SuperLinter πŸ¦Έβ€β™€οΈ - uses: insightsengineering/r.pkg.template/.github/workflows/linter.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc + uses: insightsengineering/r.pkg.template/.github/workflows/linter.yaml@main roxygen: name: Roxygen πŸ…Ύ - uses: insightsengineering/r.pkg.template/.github/workflows/roxygen.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc + uses: insightsengineering/r.pkg.template/.github/workflows/roxygen.yaml@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: @@ -116,32 +116,32 @@ jobs: insightsengineering/teal.widgets gitleaks: name: gitleaks πŸ’§ - uses: insightsengineering/r.pkg.template/.github/workflows/gitleaks.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc + uses: insightsengineering/r.pkg.template/.github/workflows/gitleaks.yaml@main spelling: name: Spell Check πŸ†Ž - uses: insightsengineering/r.pkg.template/.github/workflows/spelling.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc + uses: insightsengineering/r.pkg.template/.github/workflows/spelling.yaml@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} links: if: github.event_name != 'push' name: Check URLs 🌐 - uses: insightsengineering/r.pkg.template/.github/workflows/links.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc + uses: insightsengineering/r.pkg.template/.github/workflows/links.yaml@main vbump: name: Version Bump πŸ€œπŸ€› if: github.event_name == 'push' - uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc + uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} version: name: Version Check 🏁 - uses: insightsengineering/r.pkg.template/.github/workflows/version.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc + uses: insightsengineering/r.pkg.template/.github/workflows/version.yaml@main licenses: name: License Check πŸƒ - uses: insightsengineering/r.pkg.template/.github/workflows/licenses.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc + uses: insightsengineering/r.pkg.template/.github/workflows/licenses.yaml@main style: if: github.event_name != 'push' name: Style Check πŸ‘— - uses: insightsengineering/r.pkg.template/.github/workflows/style.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc + uses: insightsengineering/r.pkg.template/.github/workflows/style.yaml@main with: auto-update: true secrets: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index e46544949c..7c3e2f9617 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -36,7 +36,7 @@ on: jobs: docs: name: Pkgdown Docs πŸ“š - uses: insightsengineering/r.pkg.template/.github/workflows/pkgdown.yaml@fd11bcdd25b3d8904e574c2becc3f72df9add7fc + uses: insightsengineering/r.pkg.template/.github/workflows/pkgdown.yaml@main secrets: REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} with: From 13ab2961d5c35f2bee45f9494bca227c2431c2e9 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 08:31:28 +0000 Subject: [PATCH 15/19] [skip roxygen] [skip vbump] Roxygen Man Pages Auto Update --- man/teal_data_module.Rd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/man/teal_data_module.Rd b/man/teal_data_module.Rd index 9c3cbd29f9..9765ce4504 100644 --- a/man/teal_data_module.Rd +++ b/man/teal_data_module.Rd @@ -35,7 +35,9 @@ App user will be able to interact and change the data output from the module mul \item{object}{(\code{teal_data_module})} -\item{code}{(\code{character} or \code{language}) code to evaluate. If \code{character}, comments are retained.} +\item{code}{(\code{character}, \code{language} or \code{expression}) code to evaluate. +It is possible to preserve original formatting of the \code{code} by providing a \code{character} or an +\code{expression} being a result of \code{parse(keep.source = TRUE)}.} \item{data}{(\code{teal_data_module}) object} From dee8f417b7cd2505068992abe154dfa537a330f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Thu, 14 Nov 2024 15:21:39 +0100 Subject: [PATCH 16/19] Bring back messages on datasets now as errors and tests adjusting for the error level. --- R/modules.R | 18 ++++++++++++++++++ tests/testthat/test-module_teal.R | 20 ++++++++++++++++++++ tests/testthat/test-modules.R | 7 +++++++ 3 files changed, 45 insertions(+) diff --git a/R/modules.R b/R/modules.R index 11a40b57ef..4d5bbaaadf 100644 --- a/R/modules.R +++ b/R/modules.R @@ -197,6 +197,15 @@ module <- function(label = "module", ) } + if ("datasets" %in% server_formals) { + stop( + sprintf("Called from module(label = \"%s\", ...)\n ", label), + "`datasets` argument in the server is deprecated and will be removed in the next release. ", + "Please use `data` instead.", + call. = FALSE + ) + } + ## UI checkmate::assert_function(ui) ui_formals <- names(formals(ui)) @@ -209,6 +218,15 @@ module <- function(label = "module", ) } + if (any("datasets" %in% ui_formals)) { + stop( + sprintf("Called from module(label = \"%s\", ...)\n ", label), + "UI with `data` or `datasets` argument is no longer accepted.\n ", + "If some UI inputs depend on data, please move the logic to your server instead.\n ", + "Possible solutions are renderUI() or updateXyzInput() functions." + ) + } + ## `filters` if (!missing(filters)) { datanames <- filters diff --git a/tests/testthat/test-module_teal.R b/tests/testthat/test-module_teal.R index 79db71e2c3..30529e43df 100644 --- a/tests/testthat/test-module_teal.R +++ b/tests/testthat/test-module_teal.R @@ -915,6 +915,26 @@ testthat::describe("srv_teal teal_modules", { ) }) + testthat::it("srv_teal_module.teal_module passes (deprecated) datasets to the server module", { + testthat::expect_error( + shiny::testServer( + app = srv_teal, + args = list( + id = "test", + datasets = teal.data::teal_data(iris = iris, mtcars = mtcars), + modules = modules( + module("module_1", server = function(id, datasets) datasets) + ) + ), + expr = { + session$setInputs(`teal_modules-active_tab` = "module_1") + testthat::expect_s3_class(modules_output$module_1(), "FilteredData") + } + ), + "`datasets` argument in the server is deprecated and will be removed in the next release" + ) + }) + testthat::it("srv_teal_module.teal_module passes server_args to the ...", { shiny::testServer( app = srv_teal, diff --git a/tests/testthat/test-modules.R b/tests/testthat/test-modules.R index d2c10a8133..5a83805541 100644 --- a/tests/testthat/test-modules.R +++ b/tests/testthat/test-modules.R @@ -24,6 +24,13 @@ testthat::test_that("module requires label argument to be a string different tha testthat::expect_error(module(label = "global_filters"), "is reserved in teal") }) +testthat::test_that("module errors when server contains datasets argument", { + testthat::expect_error( + module(server = function(id, datasets) NULL), + "`datasets` argument in the server is deprecated" + ) +}) + testthat::test_that("module expects server being a shiny server module with any argument", { testthat::expect_no_error(module(server = function(id) NULL)) From 288598e258c226aaa88219da3c6fc1be6339f645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= <185338939+llrs-roche@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:15:31 +0100 Subject: [PATCH 17/19] Update R/modules.R MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dawid KaΕ‚Δ™dkowski Signed-off-by: LluΓ­s Revilla <185338939+llrs-roche@users.noreply.github.com> --- R/modules.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/modules.R b/R/modules.R index 4d5bbaaadf..791c354259 100644 --- a/R/modules.R +++ b/R/modules.R @@ -218,7 +218,7 @@ module <- function(label = "module", ) } - if (any("datasets" %in% ui_formals)) { + if (any(c("data", "datasets") %in% ui_formals)) { stop( sprintf("Called from module(label = \"%s\", ...)\n ", label), "UI with `data` or `datasets` argument is no longer accepted.\n ", From 65559910470f120f0d7966a8c7eccb8bb36f1b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 15 Nov 2024 11:02:00 +0100 Subject: [PATCH 18/19] Revert some changes --- NEWS.md | 1 - R/modules.R | 4 ++-- tests/testthat/test-module_teal.R | 6 +++--- tests/testthat/test-modules.R | 9 +++++++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/NEWS.md b/NEWS.md index cfc4c77339..1401db5eae 100644 --- a/NEWS.md +++ b/NEWS.md @@ -15,7 +15,6 @@ `datanames` one should modify `module$datanames`. * The `landing_popup_module()` needs to be passed as the `landing_popup` argument of `init` instead of being passed as a module of the `modules` argument of `init`. * `teal` no longer re-export `%>%`. Please load `library(magrittr)` instead or use `|>` from `base`. -* `module(server)` parameter no longer supports the `datasets` argument. ### Enhancement diff --git a/R/modules.R b/R/modules.R index 791c354259..fc863219a9 100644 --- a/R/modules.R +++ b/R/modules.R @@ -198,7 +198,7 @@ module <- function(label = "module", } if ("datasets" %in% server_formals) { - stop( + warning( sprintf("Called from module(label = \"%s\", ...)\n ", label), "`datasets` argument in the server is deprecated and will be removed in the next release. ", "Please use `data` instead.", @@ -219,7 +219,7 @@ module <- function(label = "module", } if (any(c("data", "datasets") %in% ui_formals)) { - stop( + warning( sprintf("Called from module(label = \"%s\", ...)\n ", label), "UI with `data` or `datasets` argument is no longer accepted.\n ", "If some UI inputs depend on data, please move the logic to your server instead.\n ", diff --git a/tests/testthat/test-module_teal.R b/tests/testthat/test-module_teal.R index 30529e43df..5610fe5c60 100644 --- a/tests/testthat/test-module_teal.R +++ b/tests/testthat/test-module_teal.R @@ -916,14 +916,14 @@ testthat::describe("srv_teal teal_modules", { }) testthat::it("srv_teal_module.teal_module passes (deprecated) datasets to the server module", { - testthat::expect_error( + testthat::expect_warning( shiny::testServer( app = srv_teal, args = list( id = "test", - datasets = teal.data::teal_data(iris = iris, mtcars = mtcars), + dataset = teal.data::teal_data(iris = iris, mtcars = mtcars), modules = modules( - module("module_1", server = function(id, datasets) datasets) + module("module_1", server = function(id, data) data) ) ), expr = { diff --git a/tests/testthat/test-modules.R b/tests/testthat/test-modules.R index 5a83805541..fde07538cd 100644 --- a/tests/testthat/test-modules.R +++ b/tests/testthat/test-modules.R @@ -24,8 +24,8 @@ testthat::test_that("module requires label argument to be a string different tha testthat::expect_error(module(label = "global_filters"), "is reserved in teal") }) -testthat::test_that("module errors when server contains datasets argument", { - testthat::expect_error( +testthat::test_that("module warns when server contains datasets argument", { + testthat::expect_warning( module(server = function(id, datasets) NULL), "`datasets` argument in the server is deprecated" ) @@ -77,6 +77,11 @@ testthat::test_that("module requires ui_args argument to be a list", { testthat::expect_error(module(ui_args = list(1, 2, 3)), "Must have names") }) +testthat::test_that("module throws when ui has data or datasets argument", { + testthat::expect_warning(module(ui = function(id, data) NULL)) + testthat::expect_warning(module(ui = function(id, datasets) NULL)) +}) + testthat::test_that("module expects ui being a shiny ui module with any argument", { testthat::expect_no_error(module(ui = function(id) NULL)) testthat::expect_no_error(module(ui = function(id, any_argument) NULL)) From 2d1080a91bbbffb2bd1738ac8514bc0d1ee5b75a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Fri, 15 Nov 2024 12:17:44 +0100 Subject: [PATCH 19/19] Revert from warning to stop for ui formals as requested. --- R/modules.R | 2 +- tests/testthat/test-module_teal.R | 4 ++-- tests/testthat/test-modules.R | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/modules.R b/R/modules.R index fc863219a9..f6d5bfcbe1 100644 --- a/R/modules.R +++ b/R/modules.R @@ -219,7 +219,7 @@ module <- function(label = "module", } if (any(c("data", "datasets") %in% ui_formals)) { - warning( + stop( sprintf("Called from module(label = \"%s\", ...)\n ", label), "UI with `data` or `datasets` argument is no longer accepted.\n ", "If some UI inputs depend on data, please move the logic to your server instead.\n ", diff --git a/tests/testthat/test-module_teal.R b/tests/testthat/test-module_teal.R index 5610fe5c60..2e91a13f57 100644 --- a/tests/testthat/test-module_teal.R +++ b/tests/testthat/test-module_teal.R @@ -921,9 +921,9 @@ testthat::describe("srv_teal teal_modules", { app = srv_teal, args = list( id = "test", - dataset = teal.data::teal_data(iris = iris, mtcars = mtcars), + data = teal.data::teal_data(iris = iris, mtcars = mtcars), modules = modules( - module("module_1", server = function(id, data) data) + module("module_1", server = function(id, datasets) datasets) ) ), expr = { diff --git a/tests/testthat/test-modules.R b/tests/testthat/test-modules.R index fde07538cd..65295a363d 100644 --- a/tests/testthat/test-modules.R +++ b/tests/testthat/test-modules.R @@ -78,8 +78,8 @@ testthat::test_that("module requires ui_args argument to be a list", { }) testthat::test_that("module throws when ui has data or datasets argument", { - testthat::expect_warning(module(ui = function(id, data) NULL)) - testthat::expect_warning(module(ui = function(id, datasets) NULL)) + testthat::expect_error(module(ui = function(id, data) NULL)) + testthat::expect_error(module(ui = function(id, datasets) NULL)) }) testthat::test_that("module expects ui being a shiny ui module with any argument", {