Skip to content

Add option for yaml for approved use - #302

Open
nicholas-masel wants to merge 26 commits into
mainfrom
199-feature-request-list-approved-packages-and-functions-in-yaml-file
Open

nicholas-masel wants to merge 26 commits into
mainfrom
199-feature-request-list-approved-packages-and-functions-in-yaml-file

Conversation

@nicholas-masel

@nicholas-masel nicholas-masel commented Aug 24, 2026 •

Copy link
Copy Markdown
Collaborator

Thank you for your Pull Request!

We have developed a Pull Request template to aid you and our reviewers. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the logrx codebase remains robust and consistent.

The spirit of logrx

While many packages to facilitate the logging of code already exist in the R ecosystem, it is hard to find a solution that works well for clinical programming applications. Many logging implementations are more implicit and rely on user input to create the log for the execution of a script. While this is useful for logging specific events of an application, in clinical programming a log has a set purpose.

logrx is built around the concept of creating a log for the execution of an R script that provides an overview of what happened as well as the environment that it happened in. We set out to create a flexible logging utility that could provide the necessary information to anyone reviewing the code execution so they can recreate the execution environment and run the code for themselves. Please make sure your Pull Request meets this spirit of logrx.

Please check off each taskbox as an acknowledgment that you completed the task. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the dev branch until you have checked off each task.

  • The spirit of logrx is met in your Pull Request
  • Code is formatted according to the tidyverse style guide
  • Updated relevant unit tests or have written new unit tests. Remember to remove any configured log objects at the end of every test using log_remove().
  • Creation/updates to relevant roxygen headers and examples.
  • Run devtools::document() so all .Rd files in the man folder and the NAMESPACE file in the project root are updated appropriately
  • Run pkgdown::build_site() and check that all affected examples are displayed correctly and that all new functions occur on the "Reference" page.
  • Update NEWS.md if the changes pertain to a user-facing function (i.e. it has an @export tag) or documentation aimed at users (rather than developers)
  • Address any updates needed for vignettes and/or templates
  • Run R CMD check locally and address all errors and warnings - devtools::check()
  • Link the issue so that it closes after successful merging.
  • Address all merge conflicts and resolve appropriately
  • Pat yourself on the back for a job well done! Much love to your accomplishment!

@nicholas-masel nicholas-masel changed the title refactor: split log_write approved tests and update approved vignette Add option for yaml for approved use Aug 24, 2026
Comment thread tests/testthat/test-log.R Outdated
Comment thread R/utils-approved.R
#'
#' Default: `"block"`
#'
#' @return If `file` is NULL, a tibble with two columns (library, function) and

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the user get a message saying the file was written successfully?

Comment thread R/utils-approved.R
#' Normalize a yaml approved list to a tibble
#'
#' Accepts keys as bare package names (e.g. `base`) or prefixed
#' (e.g. `package:base`). Values of `"all"`, `"All"`, or `"_all_"` are expanded

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wondering on the all option? why is that in here?

Comment thread tests/testthat/test-log.R
@@ -1,3 +1,35 @@
test_that("log_write reads approved list from yaml", {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we have a test for a corrupted or poorly filled out yaml file?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I second this suggestion if possible, definitely something I thought about while looking through the code is what happens if the yaml or other source can't be read

Comment thread NEWS.md
## Documentation

- Updated `axecute()` documentation to correctly reflect return behavior (#288)
- Updated `axecute()` documentation to describe behaviour when a log.rx environment already exists

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Updated `axecute()` documentation to describe behaviour when a log.rx environment already exists
- Updated `axecute()` documentation to describe behaviour when a log.rx environment already exists (#276)

Comment thread NEWS.md

- Updated `axecute()` documentation to correctly reflect return behavior (#288)
- Updated `axecute()` documentation to describe behaviour when a log.rx environment already exists
- Updated `build_approved()` documentation to reflect YAML support and new arguments

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Updated `build_approved()` documentation to reflect YAML support and new arguments
- Updated `build_approved()` documentation to reflect YAML support and new arguments (#199)

@bms63 bms63 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had some minor questions, but looks great to me. IS this something J&J is using or requested by a user?

…nitr

Co-authored-by: bms63 <10111024+bms63@users.noreply.github.com>
Copilot AI requested a review from bms63 August 29, 2026 18:54
@bms63

bms63 commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

@copilot how to we ignore urls with urlchecker in our link check - https://pharmar.org/white-paper/ is legit link but for some reasons is failing the checker.

Co-authored-by: bms63 <10111024+bms63@users.noreply.github.com>

Copilot AI commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

@copilot how to we ignore urls with urlchecker in our link check - https://pharmar.org/white-paper/ is legit link but for some reasons is failing the checker.

urlchecker supports a .urlignore file (like .gitignore) for exactly this — URLs that can't be reliably checked automatically. I've added one at the repo root listing https://www.pharmar.org/white-paper/, so url_check() will skip it instead of flagging it. Added in the latest commit.

@bms63

bms63 commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

@nicholas-masel copilot fixed the link checker

Comment thread inst/WORDLIST
tidylog
tidyr
unintrusive
behaviour

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason for the fun spelling of "behavior"? I don't think we'll need it in our WORDLIST if we spell it the other way

@kodesiba
kodesiba self-requested a review September 14, 2026 20:23

This branch has not been deployed

No deployments
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.

Feature Request: List approved packages and functions in yaml file

4 participants