From 2ca762b59350f7791122c04b809da4a4a91fcb3e Mon Sep 17 00:00:00 2001 From: Will Beasley Date: Tue, 22 Oct 2024 14:46:09 -0500 Subject: [PATCH 1/8] fix missing parentheses on fx call produced an error on CRAN when we updated the test server --- tests/testthat/test-write-batch.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-write-batch.R b/tests/testthat/test-write-batch.R index b8da6d41..3ea7e6a7 100644 --- a/tests/testthat/test-write-batch.R +++ b/tests/testthat/test-write-batch.R @@ -54,7 +54,7 @@ test_that("default", { }) test_that("update-one-field", { - testthat::skip_on_cran + testthat::skip_on_cran() skip_if_onlyread() path_expected <- "test-data/specific-redcapr/write-batch/update-one-field.R" From 457f11e822ecdf7eeaf4cdc1a002a602cc30516a Mon Sep 17 00:00:00 2001 From: Will Beasley Date: Tue, 22 Oct 2024 15:51:14 -0500 Subject: [PATCH 2/8] instruction to establish new server ref #542 --- inst/test-data/projects/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/inst/test-data/projects/README.md b/inst/test-data/projects/README.md index 5f7c8243..f6cd316c 100644 --- a/inst/test-data/projects/README.md +++ b/inst/test-data/projects/README.md @@ -9,3 +9,18 @@ Steps to recreate on a fresh server 1. 'unittestphifree': First name = "Unit Test"; Last name "Phi Free". 1. 'unittestphifree-dag1': First name = "Unit Test"; Last name "PHI Free DAG1" 1. Install plugins + 1. Copy from [source](https://github.com/OuhscBbmc/REDCapR/tree/main/utility/plugins) + 1. Change the `project_id` value at the bottom of each php file. + 1. Move to destination directory + 1. Update [plugin-redirection.yml](https://github.com/OuhscBbmc/REDCapR/blob/main/inst/misc/plugin-redirection.yml) +1. Copy all the projects to the new server +1. Assign the user (created above) to the "api" user role for each project. +1. Add a token for each project +1. Create a credential file for the new project + (examples [1](https://github.com/OuhscBbmc/REDCapR/blob/main/inst/misc/example.credentials) and + [2](https://github.com/OuhscBbmc/REDCapR/blob/main/inst/misc/dev-2.credentials)) + 1. Update `redcap_uri` + 1. Update the corresponding `project_id` + 1. Update the corresponding `token` + 1. Leave `username` and `comment` untouched +1. Add new entries to [project-redirection.yml](https://github.com/OuhscBbmc/REDCapR/blob/main/inst/misc/project-redirection.yml) From 9ddeaa09732039968682f44fa8a9030b52587c55 Mon Sep 17 00:00:00 2001 From: Will Beasley Date: Tue, 22 Oct 2024 16:12:30 -0500 Subject: [PATCH 3/8] update PyCap urls https://github.com/redcap-tools/PyCap/issues/290 ref #547 --- vignettes/TroubleshootingApiCalls.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vignettes/TroubleshootingApiCalls.Rmd b/vignettes/TroubleshootingApiCalls.Rmd index eb72f5bd..947c5fcf 100644 --- a/vignettes/TroubleshootingApiCalls.Rmd +++ b/vignettes/TroubleshootingApiCalls.Rmd @@ -20,7 +20,7 @@ knitr::opts_chunk$set( ) ``` -There are many links in the pipeline between your institution's [REDCap](https://www.project-redcap.org/) server and the API user. When the end result is unsuccessful, this document should help narrow the location of the possible problem. The first two sections will be relevant to almost any language interacting with the API. The remaining sections are possibly relevant only to your language (*e.g.*, Python, R, PHP, SAS, bash), or your software library such as [redcapAPI](https://github.com/nutterb/redcapAPI) and [REDCapR](https://ouhscbbmc.github.io/REDCapR/) in R, [phpcap](https://github.com/iuredcap/phpcap) in PHP, and [PyCap](https://pycap.readthedocs.io/en/latest/) in Python). +There are many links in the pipeline between your institution's [REDCap](https://www.project-redcap.org/) server and the API user. When the end result is unsuccessful, this document should help narrow the location of the possible problem. The first two sections will be relevant to almost any language interacting with the API. The remaining sections are possibly relevant only to your language (*e.g.*, Python, R, PHP, SAS, bash), or your software library such as [redcapAPI](https://github.com/nutterb/redcapAPI) and [REDCapR](https://ouhscbbmc.github.io/REDCapR/) in R, [phpcap](https://github.com/iuredcap/phpcap) in PHP, and [PyCap](https://pypi.org/project/pycap/) in Python). Language Agnostic ================================================================== @@ -124,7 +124,7 @@ knitr::include_graphics("images/PostmanScreenshot.png") curl -X POST -H "Cache-Control: no-cache" -F "token=9A068C425B1341D69E83064A2D273A70" -F "content=record" -F "format=csv" "https://redcap-dev-2.ouhsc.edu/redcap/api/" ``` -If all these checks pass, proceed to the next section. If not, start by consulting with your REDCap administrator. If that fails, consider creating a GitHub issue for your package (*e.g.*, [redcapAPI](https://github.com/nutterb/redcapAPI) and [REDCapR](https://ouhscbbmc.github.io/REDCapR/) in R, [phpcap](https://github.com/iuredcap/phpcap) in PHP, and [PyCap](https://pycap.readthedocs.io/en/latest/) in Python). +If all these checks pass, proceed to the next section. If not, start by consulting with your REDCap administrator. If that fails, consider creating a GitHub issue for your package (*e.g.*, [redcapAPI](https://github.com/nutterb/redcapAPI) and [REDCapR](https://ouhscbbmc.github.io/REDCapR/) in R, [phpcap](https://github.com/iuredcap/phpcap) in PHP, and [PyCap](https://pypi.org/project/pycap/) in Python). Writing ------------------------------------------------------------------ From 2a7534932dd728bf9fe55c3a8f2b7f09ecd92ed3 Mon Sep 17 00:00:00 2001 From: Will Beasley Date: Tue, 22 Oct 2024 16:12:47 -0500 Subject: [PATCH 4/8] update odbc url ref #547 --- vignettes/SecurityDatabase.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/SecurityDatabase.Rmd b/vignettes/SecurityDatabase.Rmd index 29b7bd0b..136f4284 100644 --- a/vignettes/SecurityDatabase.Rmd +++ b/vignettes/SecurityDatabase.Rmd @@ -19,7 +19,7 @@ This database contains the tokens and other sensitive content (such as passwords Create a DSN on each client ======================================== -After executing the SQL code in an existing database, create an ODBC [DSN](https://en.wikipedia.org/wiki/Data_source_name) on *each* client machine that calls the database. Download the most recent drivers (as of Aug 2018, the [most recent version is 17](https://docs.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server) for Windows and Linux), then run the wizard. Many values in the wizard will remain at the default values. Here are the important ones to change. +After executing the SQL code in an existing database, create an ODBC [DSN](https://en.wikipedia.org/wiki/Data_source_name) on *each* client machine that calls the database. Download the most recent drivers (as of Aug 2018, the [most recent version is 17](https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server) for Windows and Linux), then run the wizard. Many values in the wizard will remain at the default values. Here are the important ones to change. 1. Set the DSN's `name` field to whatever is used in the repository's R code. 2. Set the authenticity method to `Integrated Windows authentication`. From 16753e5e750331543f20977d3b767a8cba26c311 Mon Sep 17 00:00:00 2001 From: Will Beasley Date: Tue, 22 Oct 2024 16:16:50 -0500 Subject: [PATCH 5/8] update REDCap url ref #547 --- vignettes/BasicREDCapROperations.Rmd | 2 +- vignettes/TroubleshootingApiCalls.Rmd | 2 +- vignettes/advanced-redcapr-operations.Rmd | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vignettes/BasicREDCapROperations.Rmd b/vignettes/BasicREDCapROperations.Rmd index 97a73cb7..c2fbaff8 100644 --- a/vignettes/BasicREDCapROperations.Rmd +++ b/vignettes/BasicREDCapROperations.Rmd @@ -9,7 +9,7 @@ vignette: > %\VignetteEncoding{UTF-8} --- -This vignette covers the the basic functions exposed by the [httr](https://github.com/r-lib/httr) and [curl](https://cran.r-project.org/package=curl) packages which allow you to interact with [REDCap](https://www.project-redcap.org/) through its API. +This vignette covers the the basic functions exposed by the [httr](https://github.com/r-lib/httr) and [curl](https://cran.r-project.org/package=curl) packages which allow you to interact with [REDCap](https://projectredcap.org/) through its API. Reading REDCap Data ================================================================== diff --git a/vignettes/TroubleshootingApiCalls.Rmd b/vignettes/TroubleshootingApiCalls.Rmd index 947c5fcf..caa1fd21 100644 --- a/vignettes/TroubleshootingApiCalls.Rmd +++ b/vignettes/TroubleshootingApiCalls.Rmd @@ -20,7 +20,7 @@ knitr::opts_chunk$set( ) ``` -There are many links in the pipeline between your institution's [REDCap](https://www.project-redcap.org/) server and the API user. When the end result is unsuccessful, this document should help narrow the location of the possible problem. The first two sections will be relevant to almost any language interacting with the API. The remaining sections are possibly relevant only to your language (*e.g.*, Python, R, PHP, SAS, bash), or your software library such as [redcapAPI](https://github.com/nutterb/redcapAPI) and [REDCapR](https://ouhscbbmc.github.io/REDCapR/) in R, [phpcap](https://github.com/iuredcap/phpcap) in PHP, and [PyCap](https://pypi.org/project/pycap/) in Python). +There are many links in the pipeline between your institution's [REDCap](https://projectredcap.org/) server and the API user. When the end result is unsuccessful, this document should help narrow the location of the possible problem. The first two sections will be relevant to almost any language interacting with the API. The remaining sections are possibly relevant only to your language (*e.g.*, Python, R, PHP, SAS, bash), or your software library such as [redcapAPI](https://github.com/nutterb/redcapAPI) and [REDCapR](https://ouhscbbmc.github.io/REDCapR/) in R, [phpcap](https://github.com/iuredcap/phpcap) in PHP, and [PyCap](https://pypi.org/project/pycap/) in Python). Language Agnostic ================================================================== diff --git a/vignettes/advanced-redcapr-operations.Rmd b/vignettes/advanced-redcapr-operations.Rmd index d3a889db..b3589477 100644 --- a/vignettes/advanced-redcapr-operations.Rmd +++ b/vignettes/advanced-redcapr-operations.Rmd @@ -11,7 +11,7 @@ vignette: > %\VignetteEncoding{UTF-8} --- -This vignette covers the the less-typical uses of [REDCapR](https://github.com/OuhscBbmc/REDCapR) to interact with [REDCap](https://www.project-redcap.org/) through its API. +This vignette covers the the less-typical uses of [REDCapR](https://github.com/OuhscBbmc/REDCapR) to interact with [REDCap](https://projectredcap.org/) through its API. ```{r set_options} #| echo = FALSE, From ffdf4bd85f2af5981059c3efe2b17a8bdb52dae2 Mon Sep 17 00:00:00 2001 From: Will Beasley Date: Tue, 22 Oct 2024 18:33:45 -0500 Subject: [PATCH 6/8] remove old revdep ref #547 --- revdep/.gitignore | 7 ----- revdep/README.md | 70 ---------------------------------------------- revdep/cran.md | 15 ---------- revdep/email.yml | 5 ---- revdep/failures.md | 1 - revdep/problems.md | 39 -------------------------- 6 files changed, 137 deletions(-) delete mode 100644 revdep/.gitignore delete mode 100644 revdep/README.md delete mode 100644 revdep/cran.md delete mode 100644 revdep/email.yml delete mode 100644 revdep/failures.md delete mode 100644 revdep/problems.md diff --git a/revdep/.gitignore b/revdep/.gitignore deleted file mode 100644 index 111ab324..00000000 --- a/revdep/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -checks -library -checks.noindex -library.noindex -cloud.noindex -data.sqlite -*.html diff --git a/revdep/README.md b/revdep/README.md deleted file mode 100644 index f165634c..00000000 --- a/revdep/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# Platform - -|field |value | -|:--------|:------------------------------------------------| -|version |R version 4.4.1 Patched (2024-08-05 r86990 ucrt) | -|os |Windows 10 x64 (build 19045) | -|system |x86_64, mingw32 | -|ui |RStudio | -|language |(EN) | -|collate |English_United States.utf8 | -|ctype |English_United States.utf8 | -|tz |America/Chicago | -|date |2024-09-07 | -|rstudio |2024.04.2+764 Chocolate Cosmos (desktop) | -|pandoc |2.5 @ C:\PROGRA~2\Pandoc\pandoc.exe | - -# Dependencies - -|package |old |new |Δ | -|:-----------|:-----|:--------|:--| -|REDCapR |1.1.0 |1.1.9007 |* | -|askpass |1.2.0 |1.2.0 | | -|backports |1.5.0 |1.5.0 | | -|bit |4.0.5 |4.0.5 | | -|bit64 |4.0.5 |4.0.5 | | -|checkmate |2.3.2 |2.3.2 | | -|cli |3.6.3 |3.6.3 | | -|clipr |0.8.0 |0.8.0 | | -|cpp11 |0.5.0 |0.5.0 | | -|crayon |1.5.3 |1.5.3 | | -|curl |5.2.2 |5.2.2 | | -|dplyr |1.1.4 |1.1.4 | | -|fansi |1.0.6 |1.0.6 | | -|generics |0.1.3 |0.1.3 | | -|glue |1.7.0 |1.7.0 | | -|hms |1.1.3 |1.1.3 | | -|httr |1.4.7 |1.4.7 | | -|jsonlite |1.8.8 |1.8.8 | | -|lifecycle |1.0.4 |1.0.4 | | -|magrittr |2.0.3 |2.0.3 | | -|mime |0.12 |0.12 | | -|openssl |2.2.1 |2.2.1 | | -|pillar |1.9.0 |1.9.0 | | -|pkgconfig |2.0.3 |2.0.3 | | -|prettyunits |1.2.0 |1.2.0 | | -|progress |1.2.3 |1.2.3 | | -|purrr |1.0.2 |1.0.2 | | -|R6 |2.5.1 |2.5.1 | | -|readr |2.1.5 |2.1.5 | | -|rlang |1.1.4 |1.1.4 | | -|stringi |1.8.4 |1.8.4 | | -|stringr |1.5.1 |1.5.1 | | -|sys |3.4.2 |3.4.2 | | -|tibble |3.2.1 |3.2.1 | | -|tidyr |1.3.1 |1.3.1 | | -|tidyselect |1.2.1 |1.2.1 | | -|tzdb |0.4.0 |0.4.0 | | -|utf8 |1.2.4 |1.2.4 | | -|vctrs |0.6.5 |0.6.5 | | -|vroom |1.6.5 |1.6.5 | | -|withr |3.0.1 |3.0.1 | | - -# Revdeps - -## New problems (1) - -|package |version |error |warning |note | -|:----------|:-------|:------|:-------|:----| -|[tidyREDCap](problems.md#tidyredcap)|1.1.1 |__+1__ | | | - diff --git a/revdep/cran.md b/revdep/cran.md deleted file mode 100644 index d26ba484..00000000 --- a/revdep/cran.md +++ /dev/null @@ -1,15 +0,0 @@ -## revdepcheck results - -We checked 6 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. - - * We saw 1 new problems - * We failed to check 0 packages - -Issues with CRAN packages are summarised below. - -### New problems -(This reports the first line of each new failure) - -* tidyREDCap - checking tests ... - diff --git a/revdep/email.yml b/revdep/email.yml deleted file mode 100644 index 0c5cef87..00000000 --- a/revdep/email.yml +++ /dev/null @@ -1,5 +0,0 @@ -release_date: ??? -rel_release_date: ??? -my_news_url: ??? -release_version: ??? -release_details: ??? diff --git a/revdep/failures.md b/revdep/failures.md deleted file mode 100644 index 9a207363..00000000 --- a/revdep/failures.md +++ /dev/null @@ -1 +0,0 @@ -*Wow, no problems at all. :)* \ No newline at end of file diff --git a/revdep/problems.md b/revdep/problems.md deleted file mode 100644 index aa9dcdc5..00000000 --- a/revdep/problems.md +++ /dev/null @@ -1,39 +0,0 @@ -# tidyREDCap - -
- -* Version: 1.1.1 -* GitHub: https://github.com/RaymondBalise/tidyREDCap -* Source code: https://github.com/cran/tidyREDCap -* Date/Publication: 2023-05-29 16:30:02 UTC -* Number of recursive dependencies: 88 - -Run `revdepcheck::revdep_details(, "tidyREDCap")` for more info - -
- -## Newly broken - -* checking tests ... - ``` - Running 'testthat.R' - ERROR - Running the tests in 'tests/testthat.R' failed. - Last 13 lines of output: - 7. ├─tidyselect:::with_subscript_errors(...) - 8. │ └─base::withCallingHandlers(...) - 9. └─tidyselect:::vars_select_eval(...) - 10. └─tidyselect:::ensure_named(...) - 11. └─vctrs::vec_as_names(names(pos), repair = "check_unique", call = call) - 12. └─vctrs (local) ``() - 13. └─vctrs:::validate_unique(names = names, arg = arg, call = call) - 14. └─vctrs:::stop_names_must_be_unique(names, arg, call = call) - 15. └─vctrs:::stop_names(...) - 16. └─vctrs:::stop_vctrs(...) - 17. └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call) - - [ FAIL 1 | WARN 8 | SKIP 0 | PASS 13 ] - Error: Test failures - Execution halted - ``` - From ac5037aef49d3805214e2492847baffa30f25a77 Mon Sep 17 00:00:00 2001 From: Will Beasley Date: Tue, 22 Oct 2024 18:45:21 -0500 Subject: [PATCH 7/8] update news & cran-comments ref #547 --- NEWS.md | 5 ++--- cran-comments.md | 49 +++++++++--------------------------------------- 2 files changed, 11 insertions(+), 43 deletions(-) diff --git a/NEWS.md b/NEWS.md index 8e20f056..4002ad1b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,14 +10,13 @@ Quick links: * [Current & previous GitHub Issues](https://github.com/OuhscBbmc/REDCapR/issues?q=is%3Aissue) * [Documentation for current GitHub version](https://ouhscbbmc.github.io/REDCapR/) -Version 1.3.x (Not yet released on CRAN) +Version 1.3.0 (released 2024-10-22) ========================================================== -These features are not yet on CRAN. Install with `remotes::install_github("OuhscBbmc/REDCapR")` - ### Minor Enhancements * Redirection layer for test suite allows you to plug in your own server (#539, #542, #544) +* Skip a test when checked on CRAN servers (but not on local or GitHub Action machines) Version 1.2.0 (released 2024-09-08) ========================================================== diff --git a/cran-comments.md b/cran-comments.md index e487596d..13382ee7 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,7 +1,8 @@ Description =============================================== -This submission is primarily to address a change in the REDCap server. A lot of packages additions in the meantime were building up. +This submission is primarily to address a failing test. +One of the test (out of hundreds) was missing `testthat::skip_on_cran()`. Thank you for taking the time to review my submission, and please tell me if there's something else I should do for CRAN. -Will Beasley @@ -11,53 +12,21 @@ Test environments 1. Local Ubuntu, R 4.4.1 2. Local Win11, R 4.4.1 patched 3. R-hub - 1. [Ubuntu Linux, R-devel](https://github.com/OuhscBbmc/REDCapR/actions/runs/10748844649/job/29817754743) - 2. [Windows Server, R-devel](https://github.com/OuhscBbmc/REDCapR/actions/runs/10748844649/job/29817754878) - 3. [MacOS, R-devel](https://github.com/OuhscBbmc/REDCapR/actions/runs/10748844649/job/29817754969) -4. [win-builder](https://win-builder.r-project.org/6a44Y48qLSlw/), development version. + 1. [Ubuntu Linux, R-devel](https://github.com/OuhscBbmc/REDCapR/actions/runs/11469699615/job/31917444604) + 2. [Windows Server, R-devel](https://github.com/OuhscBbmc/REDCapR/actions/runs/11469699615/job/31917445020) + 3. [MacOS, R-devel](https://github.com/OuhscBbmc/REDCapR/actions/runs/11469699615/job/31917445170) +4. [win-builder](https://win-builder.r-project.org/7m12AMR9sIC2//), development version. 5. [GiHub Actions R-CMD-check](https://github.com/OuhscBbmc/REDCapR/actions/workflows/check-release.yaml), Ubuntu 22.04 LTS R CMD check results ----------------------------------------------- * No ERRORs or WARNINGs on any builds. -* One one Ubuntu build, there was this warning. - I don't understand the source. I'm not calling any function called `tidy()` when I search. And the two hyperlinks containing "tidy" look fine to my eye. - - ``` - ❯ checking HTML version of manual ... NOTE - Skipping checking HTML validation: no command 'tidy' found - ``` +* One NOTE: + * produced a 403 in the check, but it resolves fine in the browser. Downstream dependencies ----------------------------------------------- -With one exception, -packages that depend/import/suggest REDCapR pass the +All packages that depend/import/suggest REDCapR pass the [Reverse dependency check](https://github.com/OuhscBbmc/REDCapR/actions/workflows/recheck.yml)s. - -I worked with **tidyREDCap** team and they accepted a PR that fixes the problem: -. -It completes successfully on my local machine. - -``` -------- Check results summary ------ -Check status summary: - ERROR NOTE OK - Source packages 0 0 1 - Reverse depends 1 2 3 - -Check results summary: -REDCapR ... OK -rdepends_REDCapCAST ... OK -rdepends_REDCapDM ... NOTE -* checking data for non-ASCII characters ... NOTE -rdepends_REDCapTidieR ... OK -rdepends_ReviewR ... NOTE -* checking data for non-ASCII characters ... NOTE -rdepends_codified ... OK -rdepends_tidyREDCap ... ERROR -* checking tests ... ERROR -``` - -Results: From 6b22f5a01f28cdec9d15c8a13a0a5b2ed706b0f9 Mon Sep 17 00:00:00 2001 From: Will Beasley Date: Tue, 22 Oct 2024 18:47:05 -0500 Subject: [PATCH 8/8] bump version ref #547 --- DESCRIPTION | 2 +- NEWS.md | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6a0bbda1..23cfa0b6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -6,7 +6,7 @@ Description: Encapsulates functions to streamline calls from R to the REDCap University. The Application Programming Interface (API) offers an avenue to access and modify data programmatically, improving the capacity for literate and reproducible programming. -Version: 1.2.0.9000 +Version: 1.3.0 Authors@R: c(person("Will", "Beasley", role = c("aut", "cre"), email = "wibeasley@hotmail.com", comment = c(ORCID = "0000-0002-5613-5006")), person("David", "Bard", role = "ctb", comment = c(ORCID = "0000-0002-3922-8489")), diff --git a/NEWS.md b/NEWS.md index 4002ad1b..0908d181 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,3 @@ -# REDCapR (development version) - Release History ==========================================================