Get a pull request
Returns a pull or merge request with Hacktron’s review of its head commit. Send either its url, or repository_id from GET /repos with its number.
review is null when the head commit has no review. Otherwise its status is in_progress or completed, and its scan_id reads the review’s findings with GET /scans/{id}/findings. To start a review, call POST /pull-requests/review.
Request
GET /pull-requests/details
Send an API key with the read scope in the X-Api-Key header.
Query parameters
| Parameter | Description |
|---|---|
urlstring | The pull or merge request’s web link. Give this, or repository_id and number. |
repository_idstring (uuid) | Id from the repository list. |
numbernumber | The pull or merge request number in that repository. |
Responses
200 OK
| Field | Description |
|---|---|
repository_idstring (uuid), required | Id from the repository list. |
repositorystring, required | Repository full name. |
providerstring, required | One of github, gitlab, bitbucket, or azure. |
numbernumber, required | |
titlestring, required | |
urlstring, required | Web link to the pull request. |
authorstring, required, nullable | The author’s name on the provider. |
is_yoursboolean, required | Whether the caller opened it, matched through their linked source control accounts. |
draftboolean, required | |
source_branchstring, required | |
target_branchstring, required | |
updated_atstring, required, nullable | Last update, or creation where the provider reports no update time. |
statestring, required | One of open, closed, or merged. |
head_shastring, required, nullable | The commit at the head of the pull request; null when the provider reports none, such as a closed pull request whose fork is gone. |
reviewobject, required, nullable | Hacktron’s review of the head commit, running or finished; null when it has none. |
review.string (uuid), required, nullable | Scan id, for the scans routes. |
review.string, required | |
review.string, required | One of in_progress or completed. |
400 Bad Request
Not a pull request link, a repository not enabled for Hacktron, or a GitHub repository connected with a personal access token.
404 Not Found
The pull request, or its repository in the organization, wasn’t found.
503 Service Unavailable
The repository’s provider could not be read; try again later.