Skip to content

Add reusable workflow for R package reverse-dependency checks#42

Open
andrjohns wants to merge 7 commits into
stan-dev:masterfrom
andrjohns:revdeps
Open

Add reusable workflow for R package reverse-dependency checks#42
andrjohns wants to merge 7 commits into
stan-dev:masterfrom
andrjohns:revdeps

Conversation

@andrjohns

@andrjohns andrjohns commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@jgabry based on your comment on the rstan revdeps PR, I've updated the workflow to be reusable by any of the repos to be able to run the reverse-dependency checks for any of our R packages.

The checks are run in batches of 20, with no more than 5 batches in parallel at a time. The run normally takes ~1-1.5 hours (depending on the number of reverse dependencies), and a summary of the results in generated in the actions page. Downstream repos can also specify multiple packages to be checked in a single workflow, for example, here's the output from a run with all of our R packages: https://github.com/andrjohns/rstan/actions/runs/29706615778#summary-88255992246

The workflow supports specifying any combination of CRAN/github refs for the other Stan R packages when testing, so for testing the StanHeaders and rstan reverse dependency checks I would use:

---

name: Reverse Dependencies
run-name: Reverse Dependencies
on:
  workflow_dispatch:

jobs: 
  stanheaders-revdeps:
    uses: stan-dev/ci-scripts/.github/workflows/revdeps.yml@main
    with:
      package: StanHeaders
      stanheaders-source: v2.39.0
      rstantools-source: compat

  rstan-revdeps:
    uses: stan-dev/ci-scripts/.github/workflows/revdeps.yml@main
    with:
      package: rstan
      rstan-source: v2.39.0
      stanheaders-source: v2.39.0
      rstantools-source: compat

It's easy for the other R package repos to add their own workflow by calling this one, bayesplot for example:

  bayesplot-revdeps:
    uses: stan-dev/ci-scripts/.github/workflows/revdeps.yml@main
    with:
      package: bayesplot
      bayesplot-source: master

@jgabry

jgabry commented Jul 20, 2026

Copy link
Copy Markdown
Member

This is awesome, thanks @andrjohns! One question (might have more later). When I check the summary of the loo results (but same pattern is true for the others) it says there were 71 reverse dependencies. However, if I check revdepcheck::cran_revdeps("loo") there are 109. Do you know where that difference is coming from?

@andrjohns

Copy link
Copy Markdown
Contributor Author

This is awesome, thanks @andrjohns! One question (might have more later). When I check the summary of the loo results (but same pattern is true for the others) it says there were 71 reverse dependencies. However, if I check revdepcheck::cran_revdeps("loo") there are 109. Do you know where that difference is coming from?

Ahhh good catch! The current workflow is only testing reverse Imports, whereas revdepcheck::cran_revdeps also lists reverse Suggests - I'll add that

@jgabry

jgabry commented Jul 20, 2026

Copy link
Copy Markdown
Member

Thanks!

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.

2 participants