Skip to content

Fix R CMD check failures: error handler signature, example return(), vignette dependency, flow-typed resilience#98

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-reactlog-package-checks-again
Draft

Fix R CMD check failures: error handler signature, example return(), vignette dependency, flow-typed resilience#98
Copilot wants to merge 3 commits intomainfrom
copilot/fix-reactlog-package-checks-again

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 15, 2026

The check-depends-only CI job (which runs R CMD check with _R_CHECK_DEPENDS_ONLY_=TRUE) and the routine JS build job were both failing due to pre-existing bugs.

R code fixes (R/shinyModule.R)

  • test_shiny_version() error handler missing parametertryCatch error handlers must accept the condition object; error = function() caused unused argument (cond) whenever shiny wasn't installed:
    # Before
    }, error = function() { FALSE })
    # After
    }, error = function(e) { FALSE })
  • Top-level return() in examplereturn() outside a function body throws no function to return from. Restructured to positive guard:
    # Before
    if (!require("shiny")) { return() }
    # After
    if (requireNamespace("shiny", quietly = TRUE)) { ... }
  • assert_shiny_version() missing ()shiny_version_required was referenced as an object, not called; would print the function definition in error messages instead of the version string.

Vignette dependency (DESCRIPTION)

Moved rmarkdown from SuggestsImports. With _R_CHECK_DEPENDS_ONLY_=TRUE, only Depends/Imports packages are available. The vignette uses %\VignetteEngine{knitr::rmarkdown}, which requires rmarkdown at build time — causing an ERROR in the strict check.

JS build resilience (bin/postinstall.sh)

Added || true to yarn flow-typed install. flow-typed v2.5.1 uses a deprecated @octokit/rest API that throws uncaught errors when the GitHub API is unreachable, failing the entire routine job.

… and flow-typed

Agent-Logs-Url: https://github.com/rstudio/reactlog/sessions/abc2ff6b-f2f2-4b15-b89c-586e6ebdf029

Co-authored-by: karangattu <4220325+karangattu@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix automated checks for reactlog package on main Fix R CMD check failures: error handler signature, example return(), vignette dependency, flow-typed resilience Apr 15, 2026
Copilot AI requested a review from karangattu April 15, 2026 03:11
@karangattu karangattu requested a review from Copilot April 15, 2026 03:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes CI failures in strict R CMD check (R_CHECK_DEPENDS_ONLY) and improves robustness of the JS postinstall step.

Changes:

  • Fix tryCatch() error-handler signature and improve assert_shiny_version() message formatting.
  • Restructure roxygen examples to avoid top-level return() when shiny isn’t installed.
  • Make flow-typed install non-blocking in postinstall, and move rmarkdown to Imports for vignette builds under depends-only checks.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
bin/postinstall.sh Makes flow-typed install non-fatal to improve resilience during postinstall/build.
R/shinyModule.R Fixes Shiny version checks and roxygen examples that were failing R CMD check.
DESCRIPTION Ensures rmarkdown is available during depends-only vignette build/checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread R/shinyModule.R Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

Automated fix: reactlog package checks failing on main

3 participants