Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify sitrep and check #2516

Merged
merged 5 commits into from
May 11, 2024
Merged

Unify sitrep and check #2516

merged 5 commits into from
May 11, 2024

Conversation

hadley
Copy link
Member

@hadley hadley commented May 7, 2024

  • Introduce new check_urls() function that reports on url problems with errors and call it in check_pkgdown()
  • pkgdown_sitrep() now calls the same functions as check_pkgdown() but wrapped in a helper to convert errors to messages
  • check_built() is a separate concern so it's moved to a separate file

Fixes #2463. Fixes #2380.

hadley added 2 commits May 7, 2024 13:48
* Introduce new `check_urls()` function that reports on url problems with errors and call it in `check_pkgdown()`
* `pkgdown_sitrep()` now calls the same functions as `check_pkgdown()` but wrapped in a helper to convert errors to messages
* `check_built()` is a separate concern so it's moved to a separate file

Fixes #2463. Fixes #2380.
@hadley hadley requested a review from jayhesselberth May 7, 2024 18:52
R/build.R Show resolved Hide resolved
Copy link

github-actions bot commented May 7, 2024

hadley added a commit that referenced this pull request May 8, 2024
Need to merge after #2518 (since the vignette will need a small update) and #2516 (since `check_built()` has moved).

Fixes #2357
@hadley
Copy link
Member Author

hadley commented May 10, 2024

@jayhesselberth do you think you might have time to take a look at this next week?

@jayhesselberth
Copy link
Collaborator

jayhesselberth commented May 10, 2024

with pkgdown_sitrep(), errors in the url and reference sections are infomative; errors in the articles section are not (I made one entry in each section a blank).

And the vignette link doesn't work, see below for the same issue.

# some misconfigured yaml
url: h

articles:
- title: Customise your site
  navbar: ~
  contents:
  - customise
  - linking
  -
  - metadata

reference:
- title: Build
  desc:  Build a complete site or one of its components.
  contents:
  - build_site
  - starts_with("build_")
  - -build_site_github_pages
  - init_site
  -
  - pkgdown_sitrep
── Sitrep ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✖ URLs not ok.
  DESCRIPTION URL lacks package url (h).
  See details in pkgdown::metadata.
✔ Open graph metadata ok.
✖ Articles metadata not ok.
  In index: 1.
✖ Reference metadata not ok.
  Section "Build": contents 5 is empty.
  Edit _pkgdown.yml to fix the problem.

@jayhesselberth
Copy link
Collaborator

jayhesselberth commented May 10, 2024

check_pkgdown() output looks good, but the vignette link doesn't work when I click it (maybe an issue with my local install)?

> pkgdown::check_pkgdown()
Error in `pkgdown::check_pkgdown()`:
! DESCRIPTION URL lacks package url (h).
ℹ See details in pkgdown::metadata.
Run `rlang::last_trace()` to see where the error occurred.
Error: vignette ‘metadata’ not found

Copy link
Collaborator

@jayhesselberth jayhesselberth left a comment

Choose a reason for hiding this comment

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

see comments

R/build.R Show resolved Hide resolved
@hadley
Copy link
Member Author

hadley commented May 10, 2024

I suspect the vignette link doesn't work because the package hasn't been installed from CRAN, and thus doesn't have a built vignette. That code comes from cli, so I think is reliable.

I'll take a look at the other issue; it's not directly related to the check/sitrep unification, but I might as well fix it while I'm here.

@hadley
Copy link
Member Author

hadley commented May 10, 2024

With latest changes you now see

✖ URLs not ok.
  _pkgdown.yml lacks url.
  See details in pkgdown::metadata.
✔ Open graph metadata ok.
✖ Articles metadata not ok.
  Section "Customise your site": contents 3 is empty.
  Edit _pkgdown.yml to fix the problem.
✖ Reference metadata not ok.
  Section "Build": contents 2 is empty.
  Edit _pkgdown.yml to fix the problem.

@jayhesselberth
Copy link
Collaborator

Looks good to merge.

@hadley hadley merged commit 6804aa4 into main May 11, 2024
13 checks passed
@hadley hadley deleted the sitrep-check branch May 11, 2024 13:10
SebKrantz pushed a commit to SebKrantz/pkgdown that referenced this pull request Jun 1, 2024
* Introduce new `check_urls()` function that reports on url problems with errors and call it in `check_pkgdown()`
* `pkgdown_sitrep()` now calls the same functions as `check_pkgdown()` but wrapped in a helper to convert errors to messages
* `check_built()` is a separate concern so it's moved to a separate file
* Improve articles checking by reusing reference checks.

Fixes r-lib#2463. Fixes r-lib#2380.
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.

Combine check_pkgdown() and pkgdown_sitrep() Run a pkgdown_sitrep() at the end of each build?
2 participants