Fix pkgBiocRevDeps(recursive = TRUE) leaking forward dependencies#82
Merged
Conversation
Recursing reverse dependencies over 'Suggests' / 'Enhances' edges explodes to nearly the entire repository (e.g. thousands of packages 'Suggests' knitr), which pulled in the queried package's own forward (non-reverse) dependencies. Restrict the recursion to strong dependencies so only genuine reverse dependencies are returned. For Rarr this reduces the recursive result from 25,613 packages to 4. Adds a regression test and bumps the version with a NEWS entry. Fixes #81 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ve-revdeps # Conflicts: # DESCRIPTION # NEWS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
pkgBiocRevDeps("Rarr", recursive = TRUE)returned 25,613 packages — essentially the entire CRAN+Bioconductor repository — including "Suggests" and "Enhances" dependencies of the queried package such ascurl,jsonlite,knitr, andrmarkdown.Fixes #81.
Root cause
The recursive branch passed
recursive = TRUEtotools::package_dependencies(). With the defaultwhich = "all", the reverse recursion followsSuggests/Enhancesedges. Those edges form a near-fully-connected graph (thousands of packagesSuggestsknitr/testthat/rmarkdown), so recursing reverse over them closes over almost the whole repository.Fix
Restrict the recursion to strong dependencies (
recursive = "strong"). Level-1 reverse deps still honor the user'swhich(a package that merelySuggeststhe target still counts), but recursion only propagates throughDepends/Imports/LinkingTo— the standard "what would break if this package broke" semantics.Test
Adds
tests/testthat/test-pkgBiocDeps.R, a regression test asserting the result is a small fraction of the repository.