r-lib / usethis

Set up commonly used 📦 components
https://usethis.r-lib.org/
Other
861 stars 285 forks source link

How to update badges #1594

Open jennybc opened 2 years ago

jennybc commented 2 years ago

The recommended badge snippet for GHA and Codecov has changed over time.

The dev version of usethis produces badges that match what GitHub's and Codecov's official badge helpers provide now.

If you have old badge syntax (which still seems to work, BTW), but you want to update, here's how.

Note that the Codecov badge update will be prompted by urlchecker::url_check(), i.e. you're going to have to do this one anyway, eventually.


This is a little fiddly, given how low impact it is. Our current/old badges do work, at least for the moment. But here's the deal anyway.

Reasons to update badges:

This requires dev usethis. The GHA update in question happened in https://github.com/r-lib/usethis/commit/aa510ec8d4d511ad74ecb15b63ab14febcdfa27c.

Pick one, to update GHA R-CMD-check badge:

To update a Codecov badge, you have to call an internal helper via ::::

Before committing new badges:

R-CMD-check badge: Old svg: ...OWNER/REPO/workflows/R-CMD-check/badge.svg New svg: ...OWNER/REPO/actions/workflows/R-CMD-check.yaml/badge.svg Old URL: ...OWNER/REPO/actions New URL: ...OWNER/REPO/actions/workflows/R-CMD-check.yaml

Codecov test coverage badge: Old svg: probably mentions master New svg: probably should mention main Old URL: https://codecov.io/gh/OWNER/REPO?branch=master New URL: https://app.codecov.io/gh/OWNER/REPO?branch=main

hadley commented 2 years ago

Should we wait on #1554 before doing this systematically?

jennybc commented 2 years ago

Sure. I don't see any urgency around this. (Although I have been doing it whenever I work on a package.)