This vignette provides brief summaries of the endpoints of the roreviewapi
package. These are encoded within the identical R/plumber.R
and inst/plumber.R
files. All endpoints respond only to GET
calls.
This is the main endpoint called by the ropensci-review-bot
in response to package submission. The call itself is configured as part of an external service call in `ropensci-org/buffy, which passes the parameters specified there of:
repo
The GitHub repository from where the call originates, generally ropensci/software-review
;issue_id
as the number of the issue in repo
describing the software submission; andrepourl
as specified in the submission template, and specifying the GitHub repository of the software being submitted, also in the format <org>/<repo>
.This endpoint implements the following steps:
roreviewapi::check_issue_template()
to check the existence and format of HTML variables included within the submission template. This function returns an empty string if the template is okay; otherwise a descriptive error message. The return value also includes a binary attribute, "proceed_with_checks"
, which is set to FALSE
only if repourl
is improperly specified. In this case the function returns immediately with a text string describing the error. Otherwise the string is carried through to the next step:pkgcheck::pkgcheck()
function is started as a background process, dumping both stdout
and stderr
messages to specified logfiles (see stdlogs
endpoint, below).All messages, and the results of the pkgcheck::pkgcheck()
process, are dumped to the specified issue_id
in the specified repo
.
The editorcheck_contents
endpoint implements the main check functionality of the editorcheck
endpoint without dumping any results to the specified issue. It is primarily intended to aid debugging any issues arising within checks, through the use of the stdlogs
endpoint described below. This endpoint accepts the single argument of repourl
only.
A simple mean
endpoint can be used to confirm that the server is running. It accepts a single integer value of n
, and returns the value of mean(rnorm(n))
.
This endpoint is used by the bot to extract the stats badge from those issues which have one, in the form "6\approved-bronze-v0.0.1"
. This is used in turn by the bot to respond to mint
commands used to change badge grades.
The log
endpoint accepts a single parameter, n
, specifying the number of latest log entries to retrieve. An example of the log entry for this submission follows:
#> [1] "INFO [2021-10-07 16:48:14] 3.236.83.25 \"Faraday v1.7.1\" <ip>:8000 GET /editorcheck ?bot_name=ropensci-review-bot&issue_author=ewallace&issue_id=470&repo=ropensci%2Fsoftware-review&repourl=https%3A%2F%2Fgithub.com%2Fewallace%2Ftidyqpcr&sender=ewallace 200 1.964"
Each entry contains the following information:
roreviewapi
instance);http
method for the call (always GET
for all endpoints encoded here);The 7th item of parameters submitted along with the call is particularly useful for debugging purposes; and is specified in this line of the R/api.R
file.
This endpoint can be used to clear the server’s cache whenever desired or required. This cache is mainly used to store the results of calls to pkgcheck::pkgcheck()
. The only effect of clearing the cache will be extra time taken to regenerate any calls which were previously cached.
This is the most important endpoint for debugging problems within the pkgcheck
process itself. The endpoint accepts the single parameter of repourl
, and will return the results of both stdout
and stderr
connections produced during pkgcheck
. These checks are hashed with the latest git head, ensuring that the endpoint returns checks for the latest commit.