Skip to content

Add pkgdown reference coverage check to CI#337

Merged
venpopov merged 4 commits intodevelopfrom
copilot/add-pkgdown-tests
Mar 2, 2026
Merged

Add pkgdown reference coverage check to CI#337
venpopov merged 4 commits intodevelopfrom
copilot/add-pkgdown-tests

Conversation

Copy link
Contributor

Copilot AI commented Mar 2, 2026

New public topics added to the package silently break the pkgdown website build because _pkgdown.yml coverage is only validated during site deployment, not on PRs.

Changes

  • tests/testthat/test-pkgdown.R — new test that parses all non-\keyword{internal} .Rd topics and verifies each is covered by _pkgdown.yml's reference section, including expansion of has_keyword("xxx") selectors. Skips gracefully when _pkgdown.yml is absent (i.e., inside the R CMD CHECK tarball, where it's excluded via .Rbuildignore). The test runs automatically as part of the existing R CMD CHECK workflow since tests are run from the source checkout.

  • _pkgdown.yml — adds pp_check.bmmfit to the "Fitting models" section; this was the only non-internal topic missing from the reference index.

  • DESCRIPTION — adds yaml to Suggests to resolve the R CMD CHECK warning about an undeclared :: import used in the new test.

  • .github/workflows/R-CMD-check.yaml — adds yaml to the extra-packages list so it is installed during CI runs.

Tests

  • Confirm that all tests passed
  • Confirm that devtools::check() produces no errors

Release notes

Internal: pkgdown reference completeness is now validated on every PR via the existing R-CMD-check workflow.

Original prompt

This section details on the original issue you should resolve

<issue_title>Include a test whether _pkgdown.yml contains all references to functions as part of github actions</issue_title>
<issue_description>We often forget to add new public functions to the pkgdown index and get failures like #335

This happens because we don't run the website build action on PRs and only that action detects the problem. We don't want to run it on PRs because it will update the website dev section even if the PR is not yet accepted. It also needs a long time.

The solution would be to find a way to check for missing topics from the _pkgdown.yml index as part of the regular CMD check existing actions. Since pkgdown clearly runs a check like that when building the website in order to give the error, we could find out how they check for it and implement just the check without having to try to build the website.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@venpopov
Copy link
Owner

venpopov commented Mar 2, 2026

The current failure is with the topic pp_check.bmmfit so that will be a good test case - whatever the solution is, it should current inform us that this is missing

…mmfit topic

Co-authored-by: venpopov <12783882+venpopov@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test for missing function references in _pkgdown.yml Add pkgdown reference coverage check to CI Mar 2, 2026
@venpopov venpopov marked this pull request as ready for review March 2, 2026 18:46
@venpopov venpopov self-requested a review March 2, 2026 18:46
Copy link
Owner

@venpopov venpopov left a comment

Choose a reason for hiding this comment

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

there was no need to modify the github action, tests already run automatically. Other than that, I tested it locally and it works nicely

@venpopov venpopov self-requested a review March 2, 2026 19:53
Copy link
Owner

@venpopov venpopov left a comment

Choose a reason for hiding this comment

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

cmd check fails:

Error: Error: R CMD check found WARNINGs
Duration: 2m 57.8s
Execution halted

❯ checking for unstated dependencies in ‘tests’ ... WARNING
'::' or ':::' import not declared from: ‘yaml’

…y warning

Co-authored-by: venpopov <12783882+venpopov@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 2, 2026

cmd check fails:

Error: Error: R CMD check found WARNINGs...

Fixed in 05dbe7f — added yaml to Suggests in DESCRIPTION and to the extra-packages list in the CI workflow so it gets installed during R CMD CHECK runs.

@venpopov venpopov merged commit baa4f8d into develop Mar 2, 2026
3 checks passed
@venpopov venpopov deleted the copilot/add-pkgdown-tests branch March 2, 2026 20:35
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.

Include a test whether _pkgdown.yml contains all references to functions as part of github actions

2 participants