Closed xuanxu closed 3 years ago
@xuanxu The endpoint is stats_badge
with 2 parameters of:
repo
in org/repo
form (like ropensci/software-review
), which should always be the repo from which a call is madeissue_num
of review issue, which should always be the issue from which a call is madeport <- 8000L
repo <- "ropenscilabs/statistical-software-review"
issue_num <- 10
library (httr)
sprintf ("http://<server-IP-address>:%s/stats_badge?repo=%s&issue_num=%s",
as.integer (port), repo, issue_num) |>
GET () |>
content ()
#> [[1]]
#> [1] "6\approved-bronze-v0.0.1"
Created on 2021-08-23 by the reprex package (v2.0.0.9000)
There are 3 issues it can be tested with here, here, and here, which should respectively return bronze, silver, and gold. Let me know if there's anything that should be done here. Thanks!
Edit: The <server-IP-address>
is in current settings-production.yml
for the editorcheck
endpoint.
As mentioned here, in order to get the latest versioned stats label, an external service is needed.
It should receive the grade (bronze/silver/gold) and the repo + issue number and should label that issue with the correct versioned label, for example:
6/approved-bronze-v0.0.1
Once it's ready, we can change the ApproveResponder to use it.