|
|
@ -89,6 +89,23 @@ func GetCommitStatuses(ctx *context.APIContext) { |
|
|
|
// description: sha of the commit
|
|
|
|
// description: sha of the commit
|
|
|
|
// type: string
|
|
|
|
// type: string
|
|
|
|
// required: true
|
|
|
|
// required: true
|
|
|
|
|
|
|
|
// - name: page
|
|
|
|
|
|
|
|
// in: query
|
|
|
|
|
|
|
|
// description: page number of results
|
|
|
|
|
|
|
|
// type: integer
|
|
|
|
|
|
|
|
// required: false
|
|
|
|
|
|
|
|
// - name: sort
|
|
|
|
|
|
|
|
// in: query
|
|
|
|
|
|
|
|
// description: type of sort
|
|
|
|
|
|
|
|
// type: string
|
|
|
|
|
|
|
|
// enum: [oldest, recentupdate, leastupdate, leastindex, highestindex]
|
|
|
|
|
|
|
|
// required: false
|
|
|
|
|
|
|
|
// - name: state
|
|
|
|
|
|
|
|
// in: query
|
|
|
|
|
|
|
|
// description: type of state
|
|
|
|
|
|
|
|
// type: string
|
|
|
|
|
|
|
|
// enum: [pending, success, error, failure, warning]
|
|
|
|
|
|
|
|
// required: false
|
|
|
|
// responses:
|
|
|
|
// responses:
|
|
|
|
// "200":
|
|
|
|
// "200":
|
|
|
|
// "$ref": "#/responses/StatusList"
|
|
|
|
// "$ref": "#/responses/StatusList"
|
|
|
@ -118,6 +135,23 @@ func GetCommitStatusesByRef(ctx *context.APIContext) { |
|
|
|
// description: name of branch/tag/commit
|
|
|
|
// description: name of branch/tag/commit
|
|
|
|
// type: string
|
|
|
|
// type: string
|
|
|
|
// required: true
|
|
|
|
// required: true
|
|
|
|
|
|
|
|
// - name: page
|
|
|
|
|
|
|
|
// in: query
|
|
|
|
|
|
|
|
// description: page number of results
|
|
|
|
|
|
|
|
// type: integer
|
|
|
|
|
|
|
|
// required: false
|
|
|
|
|
|
|
|
// - name: sort
|
|
|
|
|
|
|
|
// in: query
|
|
|
|
|
|
|
|
// description: type of sort
|
|
|
|
|
|
|
|
// type: string
|
|
|
|
|
|
|
|
// enum: [oldest, recentupdate, leastupdate, leastindex, highestindex]
|
|
|
|
|
|
|
|
// required: false
|
|
|
|
|
|
|
|
// - name: state
|
|
|
|
|
|
|
|
// in: query
|
|
|
|
|
|
|
|
// description: type of state
|
|
|
|
|
|
|
|
// type: string
|
|
|
|
|
|
|
|
// enum: [pending, success, error, failure, warning]
|
|
|
|
|
|
|
|
// required: false
|
|
|
|
// responses:
|
|
|
|
// responses:
|
|
|
|
// "200":
|
|
|
|
// "200":
|
|
|
|
// "$ref": "#/responses/StatusList"
|
|
|
|
// "$ref": "#/responses/StatusList"
|
|
|
@ -131,11 +165,13 @@ func getCommitStatuses(ctx *context.APIContext, sha string) { |
|
|
|
} |
|
|
|
} |
|
|
|
repo := ctx.Repo.Repository |
|
|
|
repo := ctx.Repo.Repository |
|
|
|
|
|
|
|
|
|
|
|
page := ctx.ParamsInt("page") |
|
|
|
statuses, _, err := models.GetCommitStatuses(repo, sha, &models.CommitStatusOptions{ |
|
|
|
|
|
|
|
Page: ctx.QueryInt("page"), |
|
|
|
statuses, err := models.GetCommitStatuses(repo, sha, page) |
|
|
|
SortType: ctx.QueryTrim("sort"), |
|
|
|
|
|
|
|
State: ctx.QueryTrim("state"), |
|
|
|
|
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
ctx.Error(500, "GetCommitStatuses", fmt.Errorf("GetCommitStatuses[%s, %s, %d]: %v", repo.FullName(), sha, page, err)) |
|
|
|
ctx.Error(500, "GetCommitStatuses", fmt.Errorf("GetCommitStatuses[%s, %s, %d]: %v", repo.FullName(), sha, ctx.QueryInt("page"), err)) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -180,6 +216,11 @@ func GetCombinedCommitStatusByRef(ctx *context.APIContext) { |
|
|
|
// description: name of branch/tag/commit
|
|
|
|
// description: name of branch/tag/commit
|
|
|
|
// type: string
|
|
|
|
// type: string
|
|
|
|
// required: true
|
|
|
|
// required: true
|
|
|
|
|
|
|
|
// - name: page
|
|
|
|
|
|
|
|
// in: query
|
|
|
|
|
|
|
|
// description: page number of results
|
|
|
|
|
|
|
|
// type: integer
|
|
|
|
|
|
|
|
// required: false
|
|
|
|
// responses:
|
|
|
|
// responses:
|
|
|
|
// "200":
|
|
|
|
// "200":
|
|
|
|
// "$ref": "#/responses/Status"
|
|
|
|
// "$ref": "#/responses/Status"
|
|
|
@ -190,7 +231,7 @@ func GetCombinedCommitStatusByRef(ctx *context.APIContext) { |
|
|
|
} |
|
|
|
} |
|
|
|
repo := ctx.Repo.Repository |
|
|
|
repo := ctx.Repo.Repository |
|
|
|
|
|
|
|
|
|
|
|
page := ctx.ParamsInt("page") |
|
|
|
page := ctx.QueryInt("page") |
|
|
|
|
|
|
|
|
|
|
|
statuses, err := models.GetLatestCommitStatus(repo, sha, page) |
|
|
|
statuses, err := models.GetLatestCommitStatus(repo, sha, page) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|