RMI-PACTA / pacta.sit.rep

A simple situation report of the overall code health of the PACTA ecosystem.
Other
0 stars 0 forks source link

upkeep: improve error handling #11

Closed jdhoffa closed 5 months ago

jdhoffa commented 5 months ago

This PR slightly improves the error handling of generate_package_table(). I'm still not totally happy with this set-up, but it's better than nothing.

Note: There are no checks for existence of the R CMD check badges, since I am just using glue to create that link, and not fetching anything using gh. However, if it doesn't exist, the default behaviour seems fine as it just renders as a broken link, see reprex below.

Relates to https://github.com/RMI-PACTA/pacta.sit.rep/pull/6#issuecomment-2022588015 (No related issue)

library(pacta.sit.rep)
library(knitr)

# good urls
repos <- c("RMI-PACTA/r2dii.data", "RMI-PACTA/r2dii.match")

repos |> 
  generate_package_table() |> 
  kable()
Repo Lifecycle Status Latest_SHA Maintainer
r2dii.data Lifecycle R-CMD-check bff9bad @jdhoffa
r2dii.match Lifecycle R-CMD-check 41b878a @jdhoffa

# using an old repo that has almost nothing
repos <- c("RMI-PACTA/2dii-climateworks")

repos |> 
  generate_package_table() |> 
  kable()
Repo Lifecycle Status Latest_SHA Maintainer
2dii-climateworks No lifecycle badge found. R-CMD-check main branch not found. No maintainer found.

Created on 2024-03-27 with reprex v2.1.0