Skip to content

Prepare chef package for CRAN submission by removing non-compliant dependencies, fixing validation errors, and adding documentation examples.#43

Open
NNcino wants to merge 16 commits into
mainfrom
feature/CRAN_submission
Open

Prepare chef package for CRAN submission by removing non-compliant dependencies, fixing validation errors, and adding documentation examples.#43
NNcino wants to merge 16 commits into
mainfrom
feature/CRAN_submission

Conversation

@NNcino

@NNcino NNcino commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Changes

  • Remove testr dependency: Replace with standard testthat/withr equivalents to meet CRAN requirements (no Remotes field allowed)
  • Fix CRAN check errors:
    • Add R (>= 4.1.0) to Depends for native pipe syntax support
    • Fix data.table column assignment in expand_over_endpoints
    • Wrap evaluate_criteria example in \dontrun{} (requires pipeline context)
    • Update test infrastructure for usethis 3.2.1 compatibility
  • Update dependencies: Remove unused pryr; add qs2 for data serialization
  • Add examples: Document built-in functions with usage examples
  • Fix tests: Address directory structure assumptions and update test assertions

Testing

All CRAN checks pass. Tests updated to work with current dependencies and usethis requirements.

NNcino added 4 commits March 27, 2026 10:58
Replace testr with withr/testthat equivalents to enable CRAN submission.
CRAN prohibits packages with Remotes fields.

- Replace testr::create_local_project() → withr temp dir pattern
- Replace testr::skip_on_devops() → testthat::skip_on_ci()
- Remove testr from Suggests and delete Remotes field
- Delete helper-skip-on-devops.R
  - Add R (>= 4.1.0) to Depends: package uses native pipe |> syntax
  - Remove unused pryr/qs from Suggests; add qs2 which targets 1.12.0
    now requires for its default storage format
  - Fix expand_over_endpoints: assigning list() to endpoint_group_metadata
    was silently dropped by data.table — use [[ ]] assignment with
    vector("list", nrow(.)) to correctly add the column
  - Wrap evaluate_criteria example in \dontrun{}: the function requires
    criterion_wrapper from a targets pipeline context and cannot run standalone
  - Fix expand_over_endpoints example: load data before building endpoint_def
    and pass actual CMCLAS values; endpoint_group_filter/metadata are output
    columns and must not be included in the input
  - Fix use_chef tests: add usethis::local_project(force=TRUE) to all tests
    that call use_chef() from a temp dir — usethis 3.2.1 now requires a
    project marker and rejects plain temp directories
  - Fix test-check_duplicate_functions: add dir.create("R") before tests
    that write to R/ and expect the subdirectory to already exist
  - Fix test-filter_db_data: swap dat[[1]]/dat[[2]] assertions to match
    the actual digest-based key ordering of the analysis_data_container
@NNcino NNcino requested a review from matthew-phelps May 27, 2026 12:33
@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown

Test Results

  1 files   23 suites   53s ⏱️
126 tests 105 ✅ 21 💤 0 ❌
475 runs  454 ✅ 21 💤 0 ❌

Results for commit 827efcb.

♻️ This comment has been updated with latest results.

@NNcino NNcino marked this pull request as draft May 27, 2026 12:56
NNcino and others added 11 commits May 27, 2026 15:05
Helper script removes the Remotes: block from DESCRIPTION before R CMD build,
for symmetry with the sibling chef-ecosystem packages. chef itself has no
chef-ecosystem deps so the helper is a safe no-op here, but having the same
mechanism in every repo simplifies the CRAN submission workflow.

Also ignore tools/ and cran-plan.md from R CMD build.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The "filter_db_data works with >1 row in ep dataset" test hardcoded
dat[[1]] and dat[[2]] to specific custom_pop_filter values. The container's
row order is determined by setkey() on a digest()-derived hash, which can
differ between platforms or digest package versions. CI on Linux now
returns the opposite order from the local macOS run that the previous swap
was tuned for.

Match each expected dataset to whichever container row equals it instead
of hardcoding indices.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Code coverage

Name Coverage (%)
chef 89.25
R/add_event_index.R 100.00
R/add_id.R 100.00
R/apply_criterion.R 99.17
R/apply_stats.R 96.30
R/check_duplicate_functions.R 100.00
R/construct_data_filter_logic.R 95.24
R/eval_fn.R 86.11
R/evaluate_criteria.R 0.00
R/expand_endpoints.R 97.86
R/fetch_db_data.R 82.50
R/filter_db_data.R 100.00
R/global.R 0.00
R/group_ep_for_targets.R 100.00
R/handle_mk_fn.R 65.22
R/mk_endpoint_str.R 93.75
R/mk_userdef_fn_dt.R 73.33
R/parse_function_inputs.R 85.71
R/prepare_for_stats.R 99.27
R/try_and_validate.R 67.55
R/unnest_by_fns.R 100.00
R/unnest_endpoint_functions.R 90.91
R/use_chef.R 92.19
R/utils.R 100.00
R/validate_endpoints_def.R 77.50
R/validate_usr_fn_args.R 98.62

@github-actions

Copy link
Copy Markdown

Github pages

Review the pkgdown webpage for the PR here

@NNcino NNcino marked this pull request as ready for review May 28, 2026 07:53
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.

1 participant