ADD build status with killed

This commit is contained in:
Jasder 2020-08-25 17:01:03 +08:00
parent 66efdcc1b6
commit 5375c3ec71
3 changed files with 3 additions and 1 deletions

View File

@ -2745,7 +2745,7 @@ http://localhost:3000/api/Jason/forge/builds | jq
|repo |是|string |项目identifier | |repo |是|string |项目identifier |
|page |否|string |页数,第几页 | |page |否|string |页数,第几页 |
|limit |否|string |每页多少条数据默认20条 | |limit |否|string |每页多少条数据默认20条 |
|search |是|string |构建状态条件过滤; 值说明pending: 准备中failure: 构建失败running: 运行中error构建失败(.trustie-pipeline.yml文件错误)success: 构建成功 | |search |是|string |构建状态条件过滤; 值说明pending: 准备中failure: 构建失败running: 运行中error构建失败(.trustie-pipeline.yml文件错误)success: 构建成功killed: 撤销构建 |
*返回参数说明:* *返回参数说明:*

View File

@ -9,5 +9,6 @@ class Ci::Build < Ci::RemoteBase
scope :running, -> { by_status('running') } scope :running, -> { by_status('running') }
scope :errored, -> { by_status('error') } scope :errored, -> { by_status('error') }
scope :pending, -> { by_status('pending') } scope :pending, -> { by_status('pending') }
scope :killed, -> { by_status('killed') }
scope :by_status, ->(status) { where(build_status: status) } scope :by_status, ->(status) { where(build_status: status) }
end end

View File

@ -20,6 +20,7 @@ class Ci::Builds::ListQuery < ApplicationQuery
when 'error' then scope.errored when 'error' then scope.errored
when 'running' then scope.running when 'running' then scope.running
when 'failure' then scope.failed when 'failure' then scope.failed
when 'killed' then scope.killed
else else
scope scope
end end