ListRepositoryCommits - 查询代码库提交列表

更新时间:
复制 MD 格式

查询代码库的提交历史信息,支持滚动分页。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求语法

GET /repository/{repositoryId}/commits HTTP/1.1

路径参数

名称

类型

必填

描述

示例值

repositoryId

integer

是

代码库 ID

2334743

请求参数

名称

类型

必填

描述

示例值

organizationId

string

是

企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】

60de7a6852743a5162b5f957

accessToken

string

否

个人访问令牌。 使用阿里云 AK+SK 或使用 STS 临时授权方式不需要传该字段

f0b1e61db5961df5975a93f9129d2513

refName

string

是

分支名称、标签名称或 CommitID,默认为代码库库默认分支

master 或 tag1.0或 sjjfssa

start

string

否

起始时间

2022-03-18 08:00:00

end

string

否

结束时间

2022-08-18 08:00:00

page

integer

否

页码 默认值为 1,从第 1 页开始

1

pageSize

integer

否

每页大小 默认值为 20,取值范围【1,100】

20

path

string

否

代码仓库内的文件路径,获取该路径下的文件目录,默认获取代码库文件树的全部结构

src/cpp/main.cpp

search

string

否

搜索关键字

search

showSignature

boolean

否

展示签名 默认值:false

false

showCommentsCount

boolean

否

展示评论数量 默认值:false

false

返回参数

名称

类型

描述

示例值

object

Schema of Response

requestId

string

请求 ID

F1138237-CF7F-56BF-95D4-9AA937CCE8E5

errorMessage

string

错误信息

""

errorCode

string

错误码

OpenApi.error

success

boolean

调用是否成功

true

total

integer

总记录数

重要 提交列表采用的是滚动分页,可做参考,不能作为准确的信息。

145

result

array<object>

返回结果列表

array<object>

返回结果

id

string

提交 ID

de02b625ba8488f92eb204bcb3773a40c1b4ddac

shortId

string

简短的提交 ID 例如: CommitID:ff4fb5ac6d1f44f452654336d2dba468ae6c8d04 ShortId:ff4fb5ac

de02b625

title

string

提交标题,提交的第一行内容

提交标题

authorName

string

作者姓名

test-codeup

authorEmail

string

作者邮箱

username@example.com

createdAt

string

创建时间,格式为 YYYY-MM-DD HH:mm:ss。

2022-03-18 14:24:54

message

string

提交内容

提交的具体内容

authoredDate

string

作者提交时间,格式为 YYYY-MM-DD HH:mm:ss。

2022-03-18 15:00:00

committedDate

string

提交人的提交时间,格式为 YYYY-MM-DD HH:mm:ss。

2022-03-18 16:00:00

committerEmail

string

提交人的邮箱

username@example.com

committerName

string

提交人的姓名

committer-codeup

parentIds

array

父提交 ID 列表

string

父提交 ID

ff4fb5ac6d1f44f452654336d2dba468ae6c8d04

author

object

作者信息

id

integer

Codeup 的用户 ID

7914

name

string

用户姓名

云效

username

string

用户昵称

nickname

state

string

状态 可选值:active / blocked,默认值 active

active

avatarUrl

string

头像地址

头像地址 https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100

websiteUrl

string

用户个人网页地址

""

email

string

用户邮箱

username@example.com

committer

object

提交者信息

id

integer

Codeup 用户 ID

41031

name

string

用户名称

committer-codeup

username

string

用户昵称

nickname

state

string

状态 可选值:active / blocked,默认值 active

active

avatarUrl

string

头像地址

https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100

websiteUrl

string

用户个人网页地址

""

email

string

用户邮箱

username@example.com

signature

object

签名信息

gpgKeyId

string

gpg 签名的 key id

”“

verificationStatus

string

gpg 校验状态

  • unverified:未校验

  • verified:gpg 公钥验证通过且邮箱一致

  • same_user_different_email:gpg 公钥验签通过,提交者邮箱属于当前用户,但与证书邮箱不一致

  • other_user:gpg 公钥验签通过,但提交者邮箱不属于 key 的用户

  • unverified_key:key 对应的邮箱,不在该用户的邮箱列表中

  • unknown_key:gpg key 不存在

verified

commentsCount

integer

评论数量

1

示例

正常返回示例

JSON格式

{
  "requestId": "F1138237-CF7F-56BF-95D4-9AA937CCE8E5",
  "errorMessage": "\"\"",
  "errorCode": "OpenApi.error",
  "success": true,
  "total": 145,
  "result": [
    {
      "id": "de02b625ba8488f92eb204bcb3773a40c1b4ddac",
      "shortId": "de02b625",
      "title": "提交标题",
      "authorName": "test-codeup",
      "authorEmail": "username@example.com",
      "createdAt": "2022-03-18 14:24:54",
      "message": "提交的具体内容",
      "authoredDate": "2022-03-18 15:00:00",
      "committedDate": "2022-03-18 16:00:00",
      "committerEmail": "username@example.com",
      "committerName": "committer-codeup",
      "parentIds": [
        "ff4fb5ac6d1f44f452654336d2dba468ae6c8d04 "
      ],
      "author": {
        "id": 7914,
        "name": "云效",
        "username": "nickname",
        "state": "active",
        "avatarUrl": "头像地址\n\nhttps://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
        "websiteUrl": "\"\"",
        "email": "username@example.com"
      },
      "committer": {
        "id": 41031,
        "name": "committer-codeup",
        "username": "nickname",
        "state": "active",
        "avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
        "websiteUrl": "\"\"",
        "email": "username@example.com"
      },
      "signature": {
        "gpgKeyId": "”“",
        "verificationStatus": "verified"
      },
      "commentsCount": 1
    }
  ]
}

错误码

HTTP status code

错误码

错误信息

描述

403 Forbidden.AccessDenied The user is not authorized to perform the operation. 用户无权限执行相关操作
403 Forbidden.UserNotInCurrentOrganization The user is not in the organization and is not authorized to perform the operation. 当前用户不在该企业中,无权进行操作。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。