Skip to content

Fix vignette read.dcf failure under R CMD check; bump checkout; clean up test gates#155

Merged
HDash merged 9 commits into
masterfrom
dev2
May 6, 2026
Merged

Fix vignette read.dcf failure under R CMD check; bump checkout; clean up test gates#155
HDash merged 9 commits into
masterfrom
dev2

Conversation

@HDash

@HDash HDash commented May 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Vignettes & templates: Replace read.dcf("../DESCRIPTION", ...) with utils::packageDescription("rworkflows", ...) in all five vignettes, and use a __PKG__ placeholder in inst/templates/{templateR,docker}.Rmd that use_vignette_* substitutes at write time. The previous pattern failed under R CMD check's tools::checkVignettes(), which tangles each vignette to a .R file and sources it from a temp working directory where ../DESCRIPTION does not resolve.
  • Generators: use_vignette_getstarted() / use_vignette_docker() now raise a clear error when package is NULL/empty (previously they silently produced a malformed file). The rworkflows.Rmd use_vignette_docker demo now passes package = "mypackage" for consistency with the use_vignette_getstarted demo above it.
  • Workflows: Bump actions/checkout from @v4 to @v6 in action.yml and rworkflows_static.yml; bump the bundled example workflow from @v3. v5 moved to Node.js 24 (requires runner ≥ v2.327.1, satisfied by all GitHub-hosted runners); v6 persists git auth credentials to a separate .gitauth file rather than .git/config. Neither change affects this action's post-checkout steps.
  • Tests: Replace bare is_gha() gates with host-specific skip_if_offline(host=...) against the actual remote each test contacts (bioconductor.org, github.com, raw.githubusercontent.com, ghcr.io, conda.anaconda.org), then wrap each skip_if_offline in if (!is_gha()) so CI always runs the network tests regardless of the offline probe and only local runs without network skip. is_gha() gates that weren't about offline (infer_biocviews, two equality checks in get_description/get_hex, the construct_conda_yml OS guard) are removed and the assertions run unconditionally. All 195 tests pass locally with 0 skips and 0 failures.
  • NEWS: Entries added under the existing 1.0.12 section.

Test plan

  • R CMD build . then R CMD check rworkflows_*.tar.gz --no-manual returns Status: OK (verified locally with pandoc on PATH).
  • devtools::test() passes with 0 failures and 0 skips when network is available.
  • use_vignette_getstarted(package = "mypackage", save_dir = tempdir(), force_new = TRUE) and use_vignette_docker(package = "mypackage", docker_org = "neurogenomics", save_dir = tempdir(), force_new = TRUE) produce vignettes containing "mypackage" (no residual __PKG__ or read.dcf).
  • CI runs actions/checkout@v6 end-to-end (rworkflows_static.yml).

🤖 Generated with Claude Code

HDash added 4 commits May 5, 2026 15:36
…ption

R CMD check tangles each vignette to a .R file and sources it from a temp
working directory, where ../DESCRIPTION does not resolve. Use
utils::packageDescription("rworkflows", ...) in the package's own vignettes,
and a __PKG__ placeholder in inst/templates/{templateR,docker}.Rmd that
use_vignette_getstarted()/use_vignette_docker() substitute at write time.

Also guard those generators against a NULL/empty `package` (the previous
default silently produced a malformed file) and update the use_vignette_docker
demo in rworkflows.Rmd to pass package = "mypackage" so the chunk no longer
relies on a discoverable DESCRIPTION at vignette runtime.
action.yml and rworkflows_static.yml were on v4; the bundled example
was on v3. v6.0.2 is the current latest.

v5 moved the action onto Node.js 24 (requires runner >= v2.327.1, which
all GitHub-hosted runners satisfy). v6 (PR actions/checkout#2286) writes
git auth credentials to a separate .gitauth file instead of .git/config.
Neither change affects this action — post-checkout we only run
`git config --global --add safe.directory '*'` and pass GITHUB_TOKEN
through the env, not from .git/config.
Replace `if(!is_gha()) skip_if_offline()` with `skip_if_offline(host=X)`
where X is the host the test actually contacts:
- bioconductor.org for bioc_r_versions / construct_runners / construct_cont /
  check_r_version / check_bioc_version
- github.com for get_description / get_authors / get_hex / use_badges /
  use_workflow / infer_deps / fill_description / get_yaml / url_exists
- raw.githubusercontent.com for gha_python_versions
- conda.anaconda.org for the construct_conda_yml conda_create block

For is_gha() gates that weren't about offline (infer_biocviews,
get_description d7 == d1 expectation, get_hex hex3 == hex1 expectation,
construct_conda_yml OS guard) the gate is removed and the assertion runs
unconditionally; the get_description Bioc-repo block now skips on
bioconductor.org instead of requiring is_gha() | is_rstudio().

All 195 tests pass with 0 skips locally.
Add bullets under the existing 1.0.12 section for: the vignette read.dcf
fix and packageDescription/__PKG__ rewrite, the use_vignette_* package
guard, the actions/checkout v6 bump, and the test refactor that swapped
is_gha() gates for skip_if_offline(host=...).
@codecov

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 53.84615% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.89%. Comparing base (08f9c9a) to head (95e0757).

Files with missing lines Patch % Lines
R/use_vignette_docker.R 57.14% 3 Missing ⚠️
R/use_vignette_getstarted.R 50.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #155      +/-   ##
==========================================
+ Coverage   85.48%   89.89%   +4.40%     
==========================================
  Files          59       59              
  Lines        1206     1217      +11     
==========================================
+ Hits         1031     1094      +63     
+ Misses        175      123      -52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

HDash added 3 commits May 5, 2026 16:23
Restore the is_gha() guard on the construct_conda_yml conda env-creation
block that was dropped in ac61194. The block creates a real conda env
under ~/miniforge3/envs/testenv and is intentionally GHA-only — running
it on a developer machine leaves persistent state behind, and the
test's own `condaenv_exists()` cleanup misses orphaned env directories,
so subsequent runs fail with `prefix already exists`. is_gha() is the
right gate here because the test is genuinely targeting the GHA
environment (where setup-miniconda provides conda on PATH and the
runner is fresh).

Update the NEWS bullet to reflect that is_gha() is retained for this
single test; everywhere else the gates are now host-specific
skip_if_offline().
@HDash HDash self-assigned this May 5, 2026
@HDash HDash added bug Something isn't working enhancement New feature or request GitHub Actions Issue occurring on GitHub Actions CRAN Issue related to the CRAN server labels May 5, 2026
HDash added 2 commits May 5, 2026 16:41
…R CMD check

here::here("DESCRIPTION") doesn't anchor to the package when R CMD check
copies it to a temp dir lacking project markers, causing get_description,
get_hex, and infer_biocviews tests to fail. system.file() works in both
devtools::test() (source tree) and R CMD check (installed copy).
@HDash HDash merged commit 6aaf493 into master May 6, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CRAN Issue related to the CRAN server enhancement New feature or request GitHub Actions Issue occurring on GitHub Actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant