Skip to content

fix(ci): Exempt deprecation warnings from the roxygenize warning gate - #114

Merged
krlmlr merged 1 commit into
mainfrom
claude/cran-package-repos-setup-oygwom
Sep 13, 2026
Merged

fix(ci): Exempt deprecation warnings from the roxygenize warning gate#114
krlmlr merged 1 commit into
mainfrom
claude/cran-package-repos-setup-oygwom

Conversation

@krlmlr

@krlmlr krlmlr commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

What this does

#111 wrapped roxygen2::roxygenize() in a withCallingHandlers() that collects every warning and then fails the step. This PR carves deprecation warnings out of that gate. They are still echoed to the job log as ::warning:: annotations, so they stay visible and can be chased upstream, but they no longer fail the step. Every other warning fails it exactly as before — the gate itself stays.

Why deprecation warnings are different

The gate asks the consumer repo to fix what roxygen2 reports. That is the right ask for a malformed tag or a missing @param, but not for a deprecation warning raised inside a third-party roclet package. When a roclet calls a roxygen2 function that roxygen2 has since deprecated, the call site is in the roclet, not in the package being documented. There is nothing to fix in the consumer repo, so the gate is a false positive there — and it is a false positive for every repo on the kit that uses that roclet, not just one.

In igraph/rigraph the gate turned twelve pre-existing warnings into a red main. Eleven are actionable in principle. The twelfth is a lifecycle deprecation from devtag calling roxygen2's deprecated tag_words_line(). That one cannot be fixed in rigraph at all, so under the current gate rigraph could never get back to green by its own effort.

How the match is made

On the condition class, never on the message text. The classes were checked against R 4.5.3 rather than recalled:

  • lifecycle::deprecate_warn()lifecycle_warning_deprecated, rlang_warning, warning, condition
  • .Deprecated()deprecatedWarning, warning, condition
  • warning()simpleWarning, warning, condition

So deprecatedWarning and lifecycle_warning_deprecated separate the two deprecation paths from an ordinary warning, and both are matched.

Test

The handler logic from the action was run verbatim against the three inputs, plus the mixed case that matches the rigraph situation:

=== (a) lifecycle::deprecate_warn() ===
roxygen2 emitted 1 deprecation warning(s), these do not fail the step:
* `tag_words_line()` was deprecated in roxygen2 7.3.0.
::warning title=roxygen2 deprecation::`tag_words_line()` was deprecated in roxygen2 7.3.0.
roxygen2 emitted no warnings that fail the step.
--> PASS -- step succeeds

=== (b) base .Deprecated() ===
roxygen2 emitted 1 deprecation warning(s), these do not fail the step:
* 'old_roclet' is deprecated.
Use 'new_roclet' instead.
See help("Deprecated")
::warning title=roxygen2 deprecation::'old_roclet' is deprecated.%0AUse 'new_roclet' instead.%0ASee help("Deprecated")
roxygen2 emitted no warnings that fail the step.
--> PASS -- step succeeds

=== (c) plain warning() ===
roxygen2 emitted 1 warning(s):
* boom
::warning title=roxygen2::boom
--> FAIL -- step aborts: Fix the roxygen2 warnings above.

=== (d) mixed: two deprecations + one ordinary warning ===
roxygen2 emitted 2 deprecation warning(s), these do not fail the step:
* `tag_words_line()` was deprecated in roxygen2 7.3.0.
* 'f' is deprecated.
Use 'new_roclet' instead.
See help("Deprecated")
::warning title=roxygen2 deprecation::`tag_words_line()` was deprecated in roxygen2 7.3.0.
::warning title=roxygen2 deprecation::'f' is deprecated.%0AUse 'new_roclet' instead.%0ASee help("Deprecated")
roxygen2 emitted 1 warning(s):
* @param x missing
::warning title=roxygen2::@param x missing
--> FAIL -- step aborts (exit code 1)

All three kinds are echoed to the log. The two deprecation kinds pass the gate, the ordinary warning still fails it, and a deprecation alongside an ordinary warning does not mask the failure.

Note on the diff

escape() moved out of the else branch to the top level of the script, because the deprecation annotations need it too. It is otherwise unchanged. The "no warnings" message now reads "no warnings that fail the step", since deprecations may have been reported just above it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Hcbd7RdNjqre33JRgc86j8


Generated by Claude Code

The gate added in #111 fails the roxygenize step on any warning from
`roxygen2::roxygenize()`.
That catches deprecation warnings raised inside third-party roclets,
which a consumer package cannot act on:
in rigraph, `devtag` calls roxygen2's deprecated `tag_words_line()`,
and the resulting `lifecycle` warning turned `main` red
with no fix available in the repo.

Deprecation warnings are now collected separately.
They are still echoed as `::warning::` annotations, so they stay visible
and can be chased in the roclet that raises them,
but they no longer fail the step.
Every other warning fails it exactly as before.

The match is on the condition class, not the message text:
`.Deprecated()` signals a `deprecatedWarning`
and `lifecycle::deprecate_warn()` a `lifecycle_warning_deprecated`,
while an ordinary `warning()` is a bare `simpleWarning`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hcbd7RdNjqre33JRgc86j8
@krlmlr
krlmlr merged commit 7d5675b into main Sep 13, 2026
6 checks passed
@krlmlr
krlmlr deleted the claude/cran-package-repos-setup-oygwom branch September 13, 2026 06:48
krlmlr added a commit to cynkra/munch that referenced this pull request Sep 13, 2026
krlmlr added a commit to cynkra/indiedown that referenced this pull request Sep 13, 2026
krlmlr added a commit to cynkra/constructive that referenced this pull request Sep 13, 2026
krlmlr added a commit to igraph/igraphdata that referenced this pull request Sep 13, 2026
krlmlr added a commit to cynkra/dd that referenced this pull request Sep 13, 2026
krlmlr added a commit to cynkra/fledge that referenced this pull request Sep 13, 2026
krlmlr added a commit to cynkra/dm that referenced this pull request Sep 13, 2026
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request Sep 13, 2026
krlmlr added a commit to cynkra/lazytest that referenced this pull request Sep 13, 2026
krlmlr added a commit to krlmlr/bindr that referenced this pull request Sep 13, 2026
krlmlr added a commit to krlmlr/duckdbneo that referenced this pull request Sep 13, 2026
krlmlr added a commit to igraph/rigraph that referenced this pull request Sep 13, 2026
krlmlr added a commit to krlmlr/mockr that referenced this pull request Sep 13, 2026
krlmlr added a commit to krlmlr/bindrcpp that referenced this pull request Sep 13, 2026
krlmlr added a commit to mlfit/mlfit that referenced this pull request Sep 13, 2026
krlmlr added a commit to krlmlr/kimisc that referenced this pull request Sep 13, 2026
krlmlr added a commit to krlmlr/utf8 that referenced this pull request Sep 13, 2026
krlmlr added a commit to krlmlr/wrswoR that referenced this pull request Sep 13, 2026
krlmlr added a commit to moodymudskipper/boomer that referenced this pull request Sep 13, 2026
krlmlr added a commit to moodymudskipper/powerjoin that referenced this pull request Sep 13, 2026
krlmlr added a commit to moodymudskipper/nakedpipe that referenced this pull request Sep 13, 2026
krlmlr added a commit to moodymudskipper/flow that referenced this pull request Sep 13, 2026
krlmlr added a commit to moodymudskipper/unglue that referenced this pull request Sep 13, 2026
krlmlr added a commit to moodymudskipper/tricks that referenced this pull request Sep 13, 2026
krlmlr added a commit to moodymudskipper/typed that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-dbi/adbi that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-dbi/DBI that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-dbi/DBItest that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-dbi/dblog that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-lib/here that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-dbi/RKazam that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-lib/pillar that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-dbi/RSQLite that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-lib/roxygen2md that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-dbi/RMariaDB that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-dbi/RPostgres that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-prof/procmaps that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-lib/rprojroot that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-prof/profile that referenced this pull request Sep 13, 2026
krlmlr added a commit to renkun-ken/formattable that referenced this pull request Sep 13, 2026
krlmlr added a commit to tidyverse/blob that referenced this pull request Sep 13, 2026
krlmlr added a commit to r-prof/winch that referenced this pull request Sep 13, 2026
krlmlr added a commit to tidyverse/hms that referenced this pull request Sep 13, 2026
krlmlr added a commit to tidyverse/tibble that referenced this pull request Sep 13, 2026
krlmlr added a commit to tidyverse/duckplyr that referenced this pull request Sep 13, 2026
krlmlr added a commit to krlmlr/duckdb-r that referenced this pull request Sep 13, 2026
…cynkra/cynkratemplate#114)

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 1b871c9)
krlmlr added a commit to krlmlr/duckdb-r that referenced this pull request Sep 13, 2026
…cynkra/cynkratemplate#114)

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 1b871c9)
krlmlr added a commit to krlmlr/duckdb-r that referenced this pull request Sep 13, 2026
…cynkra/cynkratemplate#114)

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 1b871c9)
krlmlr added a commit to krlmlr/duckdb-r that referenced this pull request Sep 13, 2026
…cynkra/cynkratemplate#114)

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 1b871c9)
krlmlr added a commit to krlmlr/duckdb-r that referenced this pull request Sep 13, 2026
…cynkra/cynkratemplate#114)

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 1b871c9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants