mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
merge from develop
This commit is contained in:
@@ -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
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
## 为合并请求创建一个审查
|
||||
合并请求创建一个审查
|
||||
|
||||
> 示例:
|
||||
|
||||
```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"
|
||||
}
|
||||
```
|
||||
<aside class="success">
|
||||
Success Data.
|
||||
</aside>
|
||||
|
||||
Reference in New Issue
Block a user