Skip to content

ci+fix: strict lifecycle deprecations, idiom review guidance, bot-skip review#244

Merged
d-morrison merged 2 commits into
mainfrom
ci/review-config-strict-lifecycle
Jun 8, 2026
Merged

ci+fix: strict lifecycle deprecations, idiom review guidance, bot-skip review#244
d-morrison merged 2 commits into
mainfrom
ci/review-config-strict-lifecycle

Conversation

@d-morrison

Copy link
Copy Markdown
Member

Why

On #240, a reviewer (d-morrison) caught .data data-masking used in a tidy-selection context in R/calc_fit_mod.R — and none of the AI review workflows flagged it. Root cause: it's a soft deprecation (silent in installed-package test runs, so options(warn = 2) never catches it), and the @claude/Copilot reviewers were optimizing for "does the fix work," not idiom. This PR closes both gaps and cleans up the existing offenders.

What

  1. Strict lifecycle deprecations in teststests/testthat/setup.R sets options(lifecycle_verbosity = "error"), which overrides soft-deprecation suppression so lifecycle deprecations (incl. .data-in-tidyselect) fail the suite. (Scope: all test runs.)
  2. De-deprecate calc_fit_mod() — the only file on main using .data in tidyselect contexts. Converted select(), .by, and pivot_wider(names_from/values_from) to all_of() / string selection. Data-masking .data$ in summarize()/mutate() expressions left as-is. No behavior/output change.
  3. Skip-not-fail Claude review on bot commitsclaude-code-review.yml gains a job-level if: that skips when github.event.sender.type == 'Bot' (or actor is *[bot]). Ports the pattern already used in gdl/asaurl/bcs/rme/serocalculator. main is not branch-protected, so a skipped check doesn't block merge.
  4. Idiom review guidance for all AIs — new CLAUDE.md (the file @claude looks for) + an expanded Code Style / "Review focus" section in .github/copilot-instructions.md. Directs reviewers to flag data-masking-in-tidyselect, if/else that only varies columns, and base merge() over dplyr joins, citing the lab-manual coding-style chapter.

Validation

  • spelling::spell_check_package() → no errors (added deprecations, lifecycle to WORDLIST).
  • lintr::lint() on calc_fit_mod.R and setup.R → no lints.
  • Isolated check under lifecycle_verbosity = "error": the new all_of() forms pass; the old .data-in-select() form errors — confirming both that the option catches the issue and that the fix resolves it.
  • Full JAGS test suite not runnable locally (arch mismatch) — relying on CI.

Note on #240

This touches R/calc_fit_mod.R, which #240 is concurrently rewriting. Per discussion, @sschildhauer to resolve the merge conflict on the #240 branch after this lands. #240's idiomatic rewrite (the any_of() + join restructuring from the inline review) supersedes this minimal de-deprecation.

🤖 Generated with Claude Code

…p review

Make non-idiomatic / soon-to-be-removed tidyverse usage fail loudly and
steer reviewers (human + AI) to flag it, prompted by a data-masking-in-
tidyselect issue that slipped through every review on PR #240.

- tests/testthat/setup.R: set options(lifecycle_verbosity = "error") so
  lifecycle deprecations -- including *soft* ones like the .data pronoun
  in a tidy-selection context, which never warn in an installed-package
  test run -- fail the suite instead of passing silently.
- R/calc_fit_mod.R: convert the four tidyselect-context .data uses
  (select(), .by, pivot_wider names_from/values_from) to all_of()/string
  selection so the suite is green under the stricter option. Data-masking
  .data uses in summarize()/mutate() expressions are left as-is. No change
  to behavior or output. (Collides with the concurrent rewrite on #240;
  Sam to resolve conflicts on that branch.)
- .github/workflows/claude-code-review.yml: skip (don't fail) the review
  job when github.event.sender.type == 'Bot' (or actor is *[bot]'), so a
  commit pushed by @claude or Copilot no longer red-Xes a review.
- CLAUDE.md (new) + .github/copilot-instructions.md: add an idiomatic-code
  review focus -- flag data-masking in tidyselect, if/else that only
  varies columns, base merge() over dplyr joins -- citing the lab-manual
  coding-style chapter as the canonical authority.
- NEWS.md / DESCRIPTION / inst/WORDLIST: changelog, version bump, wordlist.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
R/calc_fit_mod.R 100.00% <100.00%> (ø)

R CMD check (run with error_on = "note") flagged CLAUDE.md as a
non-standard top-level file, failing all platforms. Add it to
.Rbuildignore so it ships as repo guidance only, not package contents.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@d-morrison d-morrison merged commit 0875741 into main Jun 8, 2026
14 of 15 checks passed
@d-morrison d-morrison deleted the ci/review-config-strict-lifecycle branch June 8, 2026 22:49
@d-morrison d-morrison mentioned this pull request Jun 8, 2026
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