Skip to content

Fail check-all-examples on deprecation warnings only - #127

Merged
strengejacke merged 4 commits into
mainfrom
example-deprecation-warnings
Dec 2, 2026
Merged

strengejacke merged 4 commits into
mainfrom
example-deprecation-warnings

Conversation

@jmgirard

Copy link
Copy Markdown
Contributor

Part of #120.

check-all-examples.yaml sets options(warn = 2L), so every warning in an example becomes an error. On insight #1305, this failed the check on the ?is_converged example, whose glmer() model doesn't converge on purpose.

As asked in #120, the check now fails only on deprecation warnings. A warning counts as one if it has class deprecatedWarning (base R's .Deprecated()) or lifecycle_warning_deprecated (lifecycle), or if its message contains "deprecated" or "defunct". The text match is for easystats' own deprecation warnings, which insight::format_warning() raises as plain warnings. It also catches deprecations from other packages that an example uses.

Each deprecation warning shows up as an error annotation naming the Rd file. Other warnings show up as warning annotations and don't fail the check. The examples keep running after a warning, but run_examples() still stops at the first example that errors (#63). I updated the README row to match.

I ran the step's R code locally on small test packages. An example with an intentional warning fails on main and passes here with a warning annotation. Examples using .Deprecated(), lifecycle::deprecate_warn() and plain warnings mentioning "deprecated" or "defunct" each got an error annotation and failed the step, while a plain warning didn't. actionlint is clean.

I also pointed insight's check-all-examples caller at this branch from a test branch on my fork. All 115 example files ran and the check passed, with the ?is_converged convergence warnings and one in ?format_message shown as warning annotations: https://github.com/jmgirard/insight/actions/runs/46480608631

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified, and the workflow and documentation changes align with the intended warning-handling behavior.

No open issues 🎉

What changed in this PR

Updates the all-examples workflow so intentional non-deprecation warnings no longer fail CI, while deprecation warnings and example errors still do. The README documentation reflects the revised behavior.

Changes:

  • Classifies base R, lifecycle, and text-based deprecation warnings.
  • Emits GitHub warning and error annotations while allowing examples to continue after warnings.
  • Fails the workflow when deprecations or example errors are detected.
File Description
README.Rmd Updates the workflow description in the README source to document the revised warning and deprecation handling.
README.md Updates the rendered workflow description to match the revised warning and deprecation handling.
.github/​workflows/​check-all-examples.yaml Classifies warnings, emits GitHub annotations, and defers workflow failure for deprecations or example errors.

Review effort: Lite

@jmgirard jmgirard mentioned this pull request Dec 1, 2026
@strengejacke
strengejacke merged commit 640fe33 into main Dec 2, 2026
4 checks passed
@strengejacke
strengejacke deleted the example-deprecation-warnings branch December 2, 2026 06:16
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.

3 participants