Draft Diff Commit List Resource¶
Added in 4.0
Provides information on pending draft commits for a review request.
POSTing to this resource will update a review request draft with the provided diff.
Details¶
Name | draft_commits |
URI | /api/review-requests/{review_request_id}/draft/diffs/{diff_revision}/draft-commits/ |
Required Features |
|
Token Policy ID | draft_commit |
HTTP Methods | |
Parent Resource | Draft Diff Resource |
Child Resources |
Links¶
Name | Method | Resource |
---|---|---|
create | POST | Draft Diff Commit List Resource |
self | GET | Draft Diff Commit List Resource |
HTTP GET¶
Return the list of commits.
Request Parameters¶
counts-onlyBoolean | If specified, a single count field is returned with the number of results, instead of the results themselves. |
max-resultsInteger | The maximum number of results to return in this list. By default, this is 25. There is a hard limit of 200; if you need more than 200 results, you will need to make more than one request, using the “next” pagination link. |
startInteger | The 0-based index of the first result in the list. The start index is usually the previous start index plus the number of previous results. By default, this is 0. |
Errors¶
100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
105 - Invalid Form DataHTTP 400 - Bad Request | One or more fields had errors |
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
HTTP POST¶
Create a new commit.
A draft must exist and the review request must be created with history support in order to post to this resource.
Request Parameters¶
author_dateISO 8601 Date/Time | Required The date and time this commit was authored in ISO 8601 format (YYYY-MM-DD HH:MM:SS+ZZZZ). |
author_emailString | Required The e-mail address of the author of this commit. |
author_nameString | Required The name of the author of this commit. |
commit_idString | Required The ID of this commit. |
commit_messageString | Required The commit message. |
diffUploaded file | Required The corresponding diff for this commit. |
committer_dateString | The date and time this commit was committed in ISO 8601 format (YYYY-MM-DD HH:MM:SS+ZZZZ). If this field is specified, the “committer_name” and “committer_email” fields must also be specified. |
committer_emailString | The e-mail address of the committer of this commit. If this field is specified, the “committer_name” and “committer_date” fields must also be specified. |
committer_nameString | The name of the the committer of this commit, if applicable. If this field is specified, the “committer_date” and “committer_email” fields must also be specified. |
parent_diffUploaded file | The optional parent diff to upload. |
validation_infoString | Validation metadata from the DiffCommit validation resource. This is required for all but the first commit. |
Errors¶
100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
102 - Invalid AttributeHTTP 400 - Bad Request | Invalid attribute |
103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
105 - Invalid Form DataHTTP 400 - Bad Request | One or more fields had errors |
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
207 - Repository File Not FoundHTTP 400 - Bad Request | The file was not found in the repository. |
219 - Diff EmptyHTTP 400 - Bad Request | The specified diff file is empty. |
220 - Diff Too BigHTTP 400 - Bad Request | The specified diff file is too large. |
Examples¶
application/vnd.reviewboard.org.draft-commits+json¶
$ curl https://reviews.example.com/api/review-requests/10/draft/diffs/3/draft-commits/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 1260
Content-Type: application/vnd.reviewboard.org.draft-commits+json
ETag: 98c4f6f5bec791d76190036e139d20798108c7ed
Item-Content-Type: application/vnd.reviewboard.org.draft-commit+json
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"draft_commits": [
{
"author_date": "2011-03-05T19:46:54-06:00",
"author_email": "christian@beanbaginc.com",
"author_name": "Christian Hammond",
"commit_id": "224589cf334e9baafeac1165be5e5c04991fd65e",
"commit_message": "modified tests\n",
"committer_date": "2011-03-05T19:46:54-06:00",
"committer_email": "christian@beanbaginc.com",
"committer_name": "Christian Hammond",
"extra_data": {},
"filename": "diff",
"id": 4,
"links": {
"draft_files": {
"href": "https://reviews.example.com/api/review-requests/10/draft/diffs/3/files/?commit-id=224589cf334e9baafeac1165be5e5c04991fd65e",
"method": "GET"
},
"self": {
"href": "https://reviews.example.com/api/review-requests/10/draft/diffs/3/draft-commits/224589cf334e9baafeac1165be5e5c04991fd65e/",
"method": "GET"
},
"update": {
"href": "https://reviews.example.com/api/review-requests/10/draft/diffs/3/draft-commits/224589cf334e9baafeac1165be5e5c04991fd65e/",
"method": "PUT"
}
},
"parent_id": "e76c016e09c415d7afc4c004a8a290b3c51bff59"
}
],
"links": {
"create": {
"href": "https://reviews.example.com/api/review-requests/10/draft/diffs/3/draft-commits/",
"method": "POST"
},
"self": {
"href": "https://reviews.example.com/api/review-requests/10/draft/diffs/3/draft-commits/",
"method": "GET"
}
},
"stat": "ok",
"total_results": 1
}