diff --git a/app/docs/slate/source/includes/_pulls.md b/app/docs/slate/source/includes/_pulls.md index e7df64097..650ad8a0d 100644 --- a/app/docs/slate/source/includes/_pulls.md +++ b/app/docs/slate/source/includes/_pulls.md @@ -1,84 +1,127 @@ # Pulls -## Get a pull request +## 获取一个合并请求 获取合并请求详情接口 > 示例: ```shell -curl -X GET http://localhost:3000/api/Jasder/gitlink/pulls/88.json +curl -X GET http://localhost:3000/api/v1/yystopf/ceshi_commit/pulls/1.json ``` ```javascript -await octokit.request('GET /api/Jasder/gitlink/pulls/88.json') +await octokit.request('GET /api/v1/yystopf/ceshi_commit/pulls/1.json') ``` ### HTTP 请求 -`GET /api/:owner/:repo/pulls/:id.json` +`GET /api/v1/:owner/:repo/pulls/:index.json` ### 请求参数: 参数 | 必选 | 默认 | 类型 | 字段说明 --------- | ------- | ------- | -------- | ---------- |owner |是| |string |用户登录名 | |repo |是| |string |项目标识identifier | -|id |是| | integer | pull id值 | - +|index |是| | integer | pull 序号 | +### 返回字段说明: +参数 | 类型 | 字段说明 +--------- | ----------- | ----------- +|-|-|-| +|id |int|合并请求ID| +|head |int|合并请求源分支| +|base |int|合并请求目标分支| +|index |int|合并请求序号| +|status |string|合并请求状态,open: 开启的, merged: 合并的, closed: 关闭的| +|issue.id |int|疑修ID| +|issue.author |object|疑修作者| +|issue.priority |string|疑修优先级| +|issue.version |string|疑修里程碑| +|issue.journals_count |int|普通评论数量| +|issue.issue_tags |array|标记| +|journals_count |int|审查评论数量| +|merge_base |string|目标的commit ID| +|base_commit_sha |string|合并之后的第一个commit ID| +|head_commit_sha |string|源commit ID| +|commit_num |int|commit数量| +|changed_files |int|更改文件数量| +|is_locked |bool|| +|mergeable |bool|是否能合并| +|merged |bool|是否合并| +|merged_at |string|合并时间| +|merge_commit_sha |string|合并之后的第一个commit ID| +|merge_by |object|被谁合并了| +|last_review.id |int|最后一个审查的id| +|last_review.commit_id|string|最后一个审查对应的commit ID| +|last_review.content |string|最后一个审查的内容| +|last_review.status |string|最后一个审查的状态,common: 一般审查, approved: 通过, rejected: 拒绝通过| +|last_review.created_at|string|审查创建的时间| +|last_review.reviewer |object|审查创建人| +|conflict_files |array|有冲突的文件| > 返回的JSON示例: ```json { - "status": 0, - "message": "响应成功", - "project_name": "Gitlink", - "identifier": "forgeplus", - "project_identifier": "forgeplus", - "pr_time": "52分钟前", - "commits_count": 229, - "files_count": 328, - "comments_count": 0, - "comments_total_count": 0, - "pull_request": { - "id": 1189, - "base": "master", - "head": "develop", - "status": 0, - "fork_project_id": null, - "is_original": false, - "pull_request_staus": "open", - "fork_project_user": null, - "create_user": "jasder", - "mergeable": true, - "state": "open" - }, + "id": 168, + "head": "new_branch", + "base": "master", + "is_original": false, + "index": 5, + "status": "merged", "issue": { - "id": 51888, - "subject": "FIx release v3.2.0", - "description": null, - "is_private": false, - "branch_name": null, - "project_author_name": "Gitlink", - "closed_on": "", - "created_at": "2021-10-12 15:51", - "assign_user_name": "victor", - "assign_user_login": "moshenglv", - "author_name": "段甲生", - "author_login": "jasder", - "author_picture": "images/avatars/User/36480?t=1615520120", - "issue_status": "新增", - "priority": "正常", + "id": 265, + "author": { + "id": 2, + "type": "User", + "name": "heh", + "login": "yystopf", + "image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png" + }, + "priority": null, "version": null, + "journals_count": 1, "issue_tags": null }, + "journals_count": 0, + "merge_base": "4a277037093c1248e46d2946ee30b61cccdb9df9", + "base_commit_sha": "dbb510cd852a6bfd4d71a1f84921aa3170654590", + "head_commit_sha": "0f0e27918eb5deb8d514012d84d13db10eebe19a", + "commit_num": 1, + "changed_files": 1, + "is_locked": false, + "mergeable": true, + "merged": true, + "merged_at": 1658743004, + "merge_commit_sha": "dbb510cd852a6bfd4d71a1f84921aa3170654590", + "merge_by": { + "id": null, + "login": "yystopf", + "name": "yystopf", + "type": null, + "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png" + }, + "last_review": { + "id": 5, + "commit_id": null, + "content": "新建一个审查", + "status": "common", + "created_at": "2022-07-25 17:08", + "reviewer": { + "id": 2, + "type": "User", + "name": "heh", + "login": "yystopf", + "image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png" + } + }, "conflict_files": [] } ``` -## 获取pull request文件列表 -获取pull request文件列表 +## 获取合并请求文件列表 +获取合并请求文件列表 > 示例: @@ -204,8 +247,8 @@ await octokit.request('GET /api/jasder/gitlink/pulls/1/files.json') ``` -## 获取pull request的commits列表 -获取pull request的commits列表 +## 获取合并请求的commits列表 +获取合并请求的commits列表 > 示例: @@ -433,21 +476,21 @@ await octokit.request('GET /api/Jason/test-txt/compare/master...Jason/test-txt:d ``` -## List pull requests +## 获取合并请求列表 获取合并请求列表 > 示例: ```shell -curl -X GET http://localhost:3000/api/Jasder/gitlink/pulls.json +curl -X GET http://localhost:3000/api/v1/yystopf/ceshi_commit/pulls.json ``` ```javascript -await octokit.request('GET /api/Jasder/gitlink/pulls.json') +await octokit.request('GET /api/v1/yystopf/ceshi_commit/pulls.json') ``` ### HTTP 请求 -`GET /api/:owner/:repo/pulls.json` +`GET /api/v1/:owner/:repo/pulls.json` ### 请求参数: 参数 | 必选 | 默认 | 类型 | 字段说明 @@ -456,48 +499,86 @@ await octokit.request('GET /api/Jasder/gitlink/pulls.json') |repo |是| |string |项目标识identifier | - +### 返回字段说明: +参数 | 类型 | 字段说明 +--------- | ----------- | ----------- +|-|-|-| +|total_count |int|合并请求总数| +|id |int|合并请求ID| +|head |int|合并请求源分支| +|base |int|合并请求目标分支| +|index |int|合并请求序号| +|is_original |bool|是否为fork仓库发来的合并请求| +|status |string|合并请求状态,open: 开启的, merged: 合并的, closed: 关闭的| +|fork_project.id |int|fork仓库的id| +|fork_project.identifier|string|fork仓库的标识| +|fork_project.login |string|fork仓库拥有者的标识| +|issue.id |int|疑修ID| +|issue.author |object|疑修作者| +|issue.priority |string|疑修优先级| +|issue.version |string|疑修里程碑| +|issue.journals_count |int|普通评论数量| +|issue.issue_tags |array|标记| +|journals_count |int|审查评论数量| > 返回的JSON示例: ```json { - "status": 0, - "message": "响应成功", - "open_count": 4, - "close_count": 51, - "merged_issues_size": 123, - "search_count": 4, - "limit": null, - "user_admin_or_member": true, - "user_admin_or_developer": true, - "project_name": "Gitlink", - "project_author_name": "Gitlink", - "issues": [ - { - "pull_request_id": 1189, - "pull_request_status": 0, - "pull_request_head": "develop", - "pull_request_base": "master", - "pull_request_staus": "open", - "is_original": false, - "fork_project_id": null, - "fork_project_identifier": null, - "fork_project_user": null, - "id": 51888, - "name": "FIx release v3.2.0", - "pr_time": "59分钟前", - "assign_user_name": "victor", - "assign_user_login": "moshenglv", - "author_name": "段甲生", - "author_login": "jasder", - "avatar_url": "images/avatars/User/36480?t=1615520120", - "priority": "正常", - "version": null, - "journals_count": 0, - "issue_tags": null - } - ] + "total_count": 2, + "pulls": [ + { + "id": 167, + "head": "master", + "base": "master", + "is_original": true, + "index": 4, + "status": "open", + "fork_project": { + "id": 491, + "identifier": "ceshi_commit", + "login": "testforge1" + }, + "issue": { + "id": 264, + "author": { + "id": 4, + "type": "User", + "name": "tes tforge1", + "login": "testforge1", + "image_url": "system/lets/letter_avatars/2/T/238_117_19/120.png" + }, + "priority": null, + "version": null, + "journals_count": 0, + "issue_tags": null + }, + "journals_count": 0 + }, + { + "id": 165, + "head": "master_1", + "base": "master", + "is_original": false, + "index": 3, + "status": "open", + "issue": { + "id": 262, + "author": { + "id": 2, + "type": "User", + "name": "heh", + "login": "yystopf", + "image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png" + }, + "priority": null, + "version": null, + "journals_count": 0, + "issue_tags": null + }, + "journals_count": 0 + } + ] } ``` @@ -814,4 +895,112 @@ await octokit.request('GET /api/v1/yystopf/ceshi_commit/pulls/3/versions/33/diff "is_incomplete_line_too_long": false, "is_protected": false } -``` \ No newline at end of file +``` + +## 为合并请求创建一个审查 +合并请求创建一个审查 + +> 示例: + +```shell +curl -X POST \ +http://localhost:3000/api/v1/yystopf/ceshi/pulls/1/reviews.json +``` + +```javascript +await octokit.request('POST /api/v1/yystopf/ceshi/pulls/1/reviews.json') +``` + +### HTTP 请求 +`POST /api/v1/:owner/:repo/pulls/:index/reviews.json` + +### 请求参数: +参数 | 必选 | 默认 | 类型 | 字段说明 +--------- | ------- | ------- | -------- | ---------- +|owner |是| | string |用户登录名 | +|repo |是| | string |项目标识identifier | +|index |是| | integer|合并请求序号| +|content |否| | string |审查内容| +|commit_id |否| | string |当前合并请求的commit_id| +|status |是| | string |审查类型, common: 普通, approved: 通过, rejected: 拒绝| + +> 请求的JSON示例: + +```json +{ + "content": "新建一个审查", + "commit_id": "e506844b2467ce25a35dd46dad8236a1595a02da", + "status": "common" +} +``` + +### 返回字段说明: +参数 | 类型 | 字段说明 +--------- | ----------- | ----------- +|reviewer |object |审查者 | +|pull_request.id |integer|合并请求ID| +|pull_request.head |string|合并请求源分支| +|pull_request.base |string|合并请求目标分支| +|pull_request.is_original |string|合并请求是否从fork仓库所来| +|pull_request.fork_project.id |int|fork仓库的id| +|pull_request.fork_project.identifier|string|fork仓库的标识| +|pull_request.fork_project.login |string|fork仓库拥有者的标识| +|pull_request.index |string|合并请求的序号| +|pull_request.status |string|合并请求的状态,open: 打开的, merged: 合并的, closed: 关闭的| +|pull_request.issue.id |integer|合并请求下疑修的ID| +|pull_request.issue.author |object|合并请求以及疑修的创建着| +|pull_request.issue.priority |string|疑修的优先级| +|pull_request.issue.version |string|疑修的里程碑| +|pull_request.issue.journals_count|integer|普通评论数量| +|pull_request.issue.issue_tags |array|所属标记| +|pull_request.journals_count |integer|审查评论数量| +|id |integer|审查ID| +|commit_id |string|审查的commit ID| +|content |string|审查的内容| +|status |string|审查类型,common: 普通, approved: 通过,rejected: 拒绝通过| +|created_at |string|审查创建时间| + +> 返回的JSON示例: + +```json +{ + "reviewer": { + "id": 2, + "type": "User", + "name": "heh", + "login": "yystopf", + "image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png" + }, + "pull_request": { + "id": 163, + "head": "master_1", + "base": "master", + "is_original": false, + "index": 1, + "status": "closed", + "issue": { + "id": 260, + "author": { + "id": 2, + "type": "User", + "name": "heh", + "login": "yystopf", + "image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png" + }, + "priority": null, + "version": null, + "journals_count": 0, + "issue_tags": null + }, + "journals_count": 6 + }, + "id": 10, + "commit_id": "e506844b2467ce25a35dd46dad8236a1595a02da", + "content": "新建一个审查", + "status": "common", + "created_at": "2022-07-26 11:45" +} +``` + diff --git a/app/views/api/v1/projects/pulls/_simple_detail.json.jbuilder b/app/views/api/v1/projects/pulls/_simple_detail.json.jbuilder index e8c668c59..93cba2e47 100644 --- a/app/views/api/v1/projects/pulls/_simple_detail.json.jbuilder +++ b/app/views/api/v1/projects/pulls/_simple_detail.json.jbuilder @@ -18,8 +18,8 @@ json.issue do end json.priority issue&.priority.try(:name) json.version issue&.version.try(:name) - json.comments_count issue.journals.count + json.journals_count issue.journals.count json.issue_tags issue.get_issue_tags end -json.comments_count pull.journals.count \ No newline at end of file +json.journals_count pull.journals.count \ No newline at end of file diff --git a/app/views/api/v1/projects/pulls/show.json.jbuilder b/app/views/api/v1/projects/pulls/show.json.jbuilder index fce27e17f..2553629ee 100644 --- a/app/views/api/v1/projects/pulls/show.json.jbuilder +++ b/app/views/api/v1/projects/pulls/show.json.jbuilder @@ -26,4 +26,5 @@ json.last_review do else json.nil! end -end \ No newline at end of file +end +json.conflict_files @pull_request.conflict_files \ No newline at end of file diff --git a/public/docs/api.html b/public/docs/api.html index a6653b3f1..38bf220ed 100644 --- a/public/docs/api.html +++ b/public/docs/api.html @@ -615,19 +615,19 @@ Pulls
获取合并请求详情接口
-示例:
curl -X GET http://localhost:3000/api/Jasder/gitlink/pulls/88.json
-
await octokit.request('GET /api/Jasder/gitlink/pulls/88.json')
+curl -X GET http://localhost:3000/api/v1/yystopf/ceshi_commit/pulls/1.json
+
await octokit.request('GET /api/v1/yystopf/ceshi_commit/pulls/1.json')
HTTP 请求
-GET /api/:owner/:repo/pulls/:id.json
+GET /api/v1/:owner/:repo/pulls/:index.json
请求参数:
@@ -12353,11 +12356,175 @@ Success — a happy kitten is an authenticated kitten!
项目标识identifier
-id
+index
是
integer
-pull id值
+pull 序号
+
+
+返回字段说明:
+
+
+参数
+类型
+字段说明
+
+
+
+-
+-
+-
+
+
+id
+int
+合并请求ID
+
+
+head
+int
+合并请求源分支
+
+
+base
+int
+合并请求目标分支
+
+
+index
+int
+合并请求序号
+
+
+status
+string
+合并请求状态,open: 开启的, merged: 合并的, closed: 关闭的
+
+
+issue.id
+int
+疑修ID
+
+
+issue.author
+object
+疑修作者
+
+
+issue.priority
+string
+疑修优先级
+
+
+issue.version
+string
+疑修里程碑
+
+
+issue.journals_count
+int
+普通评论数量
+
+
+issue.issue_tags
+array
+标记
+
+
+journals_count
+int
+审查评论数量
+
+
+merge_base
+string
+目标的commit ID
+
+
+base_commit_sha
+string
+合并之后的第一个commit ID
+
+
+head_commit_sha
+string
+源commit ID
+
+
+commit_num
+int
+commit数量
+
+
+changed_files
+int
+更改文件数量
+
+
+is_locked
+bool
+
+
+
+mergeable
+bool
+是否能合并
+
+
+merged
+bool
+是否合并
+
+
+merged_at
+string
+合并时间
+
+
+merge_commit_sha
+string
+合并之后的第一个commit ID
+
+
+merge_by
+object
+被谁合并了
+
+
+last_review.id
+int
+最后一个审查的id
+
+
+last_review.commit_id
+string
+最后一个审查对应的commit ID
+
+
+last_review.content
+string
+最后一个审查的内容
+
+
+last_review.status
+string
+最后一个审查的状态,common: 一般审查, approved: 通过, rejected: 拒绝通过
+
+
+last_review.created_at
+string
+审查创建的时间
+
+
+last_review.reviewer
+object
+审查创建人
+
+
+conflict_files
+array
+有冲突的文件
@@ -12365,52 +12532,62 @@ Success — a happy kitten is an authenticated kitten!
返回的JSON示例:
{
- "status": 0,
- "message": "响应成功",
- "project_name": "Gitlink",
- "identifier": "forgeplus",
- "project_identifier": "forgeplus",
- "pr_time": "52分钟前",
- "commits_count": 229,
- "files_count": 328,
- "comments_count": 0,
- "comments_total_count": 0,
- "pull_request": {
- "id": 1189,
- "base": "master",
- "head": "develop",
- "status": 0,
- "fork_project_id": null,
- "is_original": false,
- "pull_request_staus": "open",
- "fork_project_user": null,
- "create_user": "jasder",
- "mergeable": true,
- "state": "open"
- },
+ "id": 168,
+ "head": "new_branch",
+ "base": "master",
+ "is_original": false,
+ "index": 5,
+ "status": "merged",
"issue": {
- "id": 51888,
- "subject": "FIx release v3.2.0",
- "description": null,
- "is_private": false,
- "branch_name": null,
- "project_author_name": "Gitlink",
- "closed_on": "",
- "created_at": "2021-10-12 15:51",
- "assign_user_name": "victor",
- "assign_user_login": "moshenglv",
- "author_name": "段甲生",
- "author_login": "jasder",
- "author_picture": "images/avatars/User/36480?t=1615520120",
- "issue_status": "新增",
- "priority": "正常",
+ "id": 265,
+ "author": {
+ "id": 2,
+ "type": "User",
+ "name": "heh",
+ "login": "yystopf",
+ "image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png"
+ },
+ "priority": null,
"version": null,
+ "journals_count": 1,
"issue_tags": null
},
+ "journals_count": 0,
+ "merge_base": "4a277037093c1248e46d2946ee30b61cccdb9df9",
+ "base_commit_sha": "dbb510cd852a6bfd4d71a1f84921aa3170654590",
+ "head_commit_sha": "0f0e27918eb5deb8d514012d84d13db10eebe19a",
+ "commit_num": 1,
+ "changed_files": 1,
+ "is_locked": false,
+ "mergeable": true,
+ "merged": true,
+ "merged_at": 1658743004,
+ "merge_commit_sha": "dbb510cd852a6bfd4d71a1f84921aa3170654590",
+ "merge_by": {
+ "id": null,
+ "login": "yystopf",
+ "name": "yystopf",
+ "type": null,
+ "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
+ },
+ "last_review": {
+ "id": 5,
+ "commit_id": null,
+ "content": "新建一个审查",
+ "status": "common",
+ "created_at": "2022-07-25 17:08",
+ "reviewer": {
+ "id": 2,
+ "type": "User",
+ "name": "heh",
+ "login": "yystopf",
+ "image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png"
+ }
+ },
"conflict_files": []
}
-
获取pull request文件列表
-获取pull request文件列表
+
获取合并请求文件列表
示例:
@@ -12448,7 +12625,7 @@ http://localhost:3000/api/Jason/gitlink/pulls/1/files.jsonpull request's id -返回字段说明:
+返回字段说明:
-
参数 @@ -12675,8 +12852,8 @@ http://localhost:3000/api/Jason/gitlink/pulls/1/files.json } ] } -获取pull request的commits列表
-获取pull request的commits列表
+获取合并请求的commits列表
+获取合并请求的commits列表
示例:
@@ -12713,7 +12890,7 @@ http://localhost:3000/api/Jason/gitlink/pulls/1/files.jsonpull request's id 返回字段说明:
+返回字段说明:
-
参数 @@ -12867,7 +13044,7 @@ http://localhost:3000/api/Jason/test-txt/compare/master...Jason/test-txt:developpull request's id 返回字段说明:
+返回字段说明:
-
参数 @@ -13183,16 +13360,16 @@ http://localhost:3000/api/Jason/test-txt/compare/master...Jason/test-txt:develop } ] } -List pull requests
+获取合并请求列表
获取合并请求列表
-示例:
curl -X GET http://localhost:3000/api/Jasder/gitlink/pulls.json -
await octokit.request('GET /api/Jasder/gitlink/pulls.json') +
curl -X GET http://localhost:3000/api/v1/yystopf/ceshi_commit/pulls.json +
await octokit.request('GET /api/v1/yystopf/ceshi_commit/pulls.json')
HTTP 请求
-+
GET /api/:owner/:repo/pulls.json
GET /api/v1/:owner/:repo/pulls.json
请求参数:
+
@@ -13218,47 +13395,164 @@ http://localhost:3000/api/Jason/test-txt/compare/master...Jason/test-txt:develop 项目标识identifier 返回字段说明:
++
+ + +参数 +类型 +字段说明 ++ +- +- +- ++ +total_count +int +合并请求总数 ++ +id +int +合并请求ID ++ +head +int +合并请求源分支 ++ +base +int +合并请求目标分支 ++ +index +int +合并请求序号 ++ +is_original +bool +是否为fork仓库发来的合并请求 ++ +status +string +合并请求状态,open: 开启的, merged: 合并的, closed: 关闭的 ++ +fork_project.id +int +fork仓库的id ++ +fork_project.identifier +string +fork仓库的标识 ++ +fork_project.login +string +fork仓库拥有者的标识 ++ +issue.id +int +疑修ID ++ +issue.author +object +疑修作者 ++ +issue.priority +string +疑修优先级 ++ +issue.version +string +疑修里程碑 ++ +issue.journals_count +int +普通评论数量 ++ +issue.issue_tags +array +标记 ++ +journals_count +int +审查评论数量 +返回的JSON示例:
{ - "status": 0, - "message": "响应成功", - "open_count": 4, - "close_count": 51, - "merged_issues_size": 123, - "search_count": 4, - "limit": null, - "user_admin_or_member": true, - "user_admin_or_developer": true, - "project_name": "Gitlink", - "project_author_name": "Gitlink", - "issues": [ - { - "pull_request_id": 1189, - "pull_request_status": 0, - "pull_request_head": "develop", - "pull_request_base": "master", - "pull_request_staus": "open", - "is_original": false, - "fork_project_id": null, - "fork_project_identifier": null, - "fork_project_user": null, - "id": 51888, - "name": "FIx release v3.2.0", - "pr_time": "59分钟前", - "assign_user_name": "victor", - "assign_user_login": "moshenglv", - "author_name": "段甲生", - "author_login": "jasder", - "avatar_url": "images/avatars/User/36480?t=1615520120", - "priority": "正常", - "version": null, - "journals_count": 0, - "issue_tags": null - } - ] + "total_count": 2, + "pulls": [ + { + "id": 167, + "head": "master", + "base": "master", + "is_original": true, + "index": 4, + "status": "open", + "fork_project": { + "id": 491, + "identifier": "ceshi_commit", + "login": "testforge1" + }, + "issue": { + "id": 264, + "author": { + "id": 4, + "type": "User", + "name": "tes tforge1", + "login": "testforge1", + "image_url": "system/lets/letter_avatars/2/T/238_117_19/120.png" + }, + "priority": null, + "version": null, + "journals_count": 0, + "issue_tags": null + }, + "journals_count": 0 + }, + { + "id": 165, + "head": "master_1", + "base": "master", + "is_original": false, + "index": 3, + "status": "open", + "issue": { + "id": 262, + "author": { + "id": 2, + "type": "User", + "name": "heh", + "login": "yystopf", + "image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png" + }, + "priority": null, + "version": null, + "journals_count": 0, + "issue_tags": null + }, + "journals_count": 0 + } + ] }
获取合并请求版本列表
获取合并请求版本列表
@@ -13302,7 +13596,7 @@ http://localhost:3000/api/Jason/test-txt/compare/master...Jason/test-txt:develop合并请求序号 返回字段说明:
+返回字段说明:
参数 @@ -13924,7 +14218,244 @@ http://localhost:3000/api/v1/yystopf/ceshi_commit/pulls/3/versions/33/diff.json "is_incomplete_line_too_long": false, "is_protected": false } -Issues
Organizations
Teams
Errors
+为合并请求创建一个审查
+合并请求创建一个审查
+ +++示例:
+curl -X POST \ +http://localhost:3000/api/v1/yystopf/ceshi/pulls/1/reviews.json +
await octokit.request('POST /api/v1/yystopf/ceshi/pulls/1/reviews.json') +
HTTP 请求
++
POST /api/v1/:owner/:repo/pulls/:index/reviews.json
请求参数:
++
+ ++ + +参数 +必选 +默认 +类型 +字段说明 ++ +owner +是 ++ string +用户登录名 ++ +repo +是 ++ string +项目标识identifier ++ +index +是 ++ integer +合并请求序号 ++ +content +否 ++ string +审查内容 ++ +commit_id +否 ++ string +当前合并请求的commit_id ++ +status +是 ++ string +审查类型, common: 普通, approved: 通过, rejected: 拒绝 +++请求的JSON示例:
+{ + "content": "新建一个审查", + "commit_id": "e506844b2467ce25a35dd46dad8236a1595a02da", + "status": "common" +} +
返回字段说明:
++
+ ++ + +参数 +类型 +字段说明 ++ +reviewer +object +审查者 ++ +pull_request.id +integer +合并请求ID ++ +pull_request.head +string +合并请求源分支 ++ +pull_request.base +string +合并请求目标分支 ++ +pull_request.is_original +string +合并请求是否从fork仓库所来 ++ +pull_request.fork_project.id +int +fork仓库的id ++ +pull_request.fork_project.identifier +string +fork仓库的标识 ++ +pull_request.fork_project.login +string +fork仓库拥有者的标识 ++ +pull_request.index +string +合并请求的序号 ++ +pull_request.status +string +合并请求的状态,open: 打开的, merged: 合并的, closed: 关闭的 ++ +pull_request.issue.id +integer +合并请求下疑修的ID ++ +pull_request.issue.author +object +合并请求以及疑修的创建着 ++ +pull_request.issue.priority +string +疑修的优先级 ++ +pull_request.issue.version +string +疑修的里程碑 ++ +pull_request.issue.journals_count +integer +普通评论数量 ++ +pull_request.issue.issue_tags +array +所属标记 ++ +pull_request.journals_count +integer +审查评论数量 ++ +id +integer +审查ID ++ +commit_id +string +审查的commit ID ++ +content +string +审查的内容 ++ +status +string +审查类型,common: 普通, approved: 通过,rejected: 拒绝通过 ++ +created_at +string +审查创建时间 +++返回的JSON示例:
++ +{ + "reviewer": { + "id": 2, + "type": "User", + "name": "heh", + "login": "yystopf", + "image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png" + }, + "pull_request": { + "id": 163, + "head": "master_1", + "base": "master", + "is_original": false, + "index": 1, + "status": "closed", + "issue": { + "id": 260, + "author": { + "id": 2, + "type": "User", + "name": "heh", + "login": "yystopf", + "image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png" + }, + "priority": null, + "version": null, + "journals_count": 0, + "issue_tags": null + }, + "journals_count": 6 + }, + "id": 10, + "commit_id": "e506844b2467ce25a35dd46dad8236a1595a02da", + "content": "新建一个审查", + "status": "common", + "created_at": "2022-07-26 11:45" +} +
Issues
Organizations
Teams
Errors