diff options
author | wendy0402 <wendykurniawan92@gmail.com> | 2017-02-14 05:28:45 +0300 |
---|---|---|
committer | wendy0402 <wendykurniawan92@gmail.com> | 2017-02-14 05:32:25 +0300 |
commit | 79ce7579bb7dad3dba344893fb20c2f1346c84a0 (patch) | |
tree | 132ae368420580585df9e25fcbac1824b7393a49 /lib/api | |
parent | e5f446b7ca4bc54ffaf527e4c57dea2bee2f79f6 (diff) |
Make it possible to pass coverage value to commit status API
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/commit_statuses.rb | 4 | ||||
-rw-r--r-- | lib/api/entities.rb | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/commit_statuses.rb b/lib/api/commit_statuses.rb index b6e6820c3f4..0b6076bd28c 100644 --- a/lib/api/commit_statuses.rb +++ b/lib/api/commit_statuses.rb @@ -46,6 +46,7 @@ module API optional :description, type: String, desc: 'A short description of the status' optional :name, type: String, desc: 'A string label to differentiate this status from the status of other systems. Default: "default"' optional :context, type: String, desc: 'A string label to differentiate this status from the status of other systems. Default: "default"' + optional :coverage, type: Float, desc: 'The total code coverage' end post ':id/statuses/:sha' do authorize! :create_commit_status, user_project @@ -75,7 +76,8 @@ module API name: name, ref: ref, target_url: params[:target_url], - description: params[:description] + description: params[:description], + coverage: params[:coverage] ) render_validation_error!(status) if status.invalid? diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 2a071e649fa..d4234ffe818 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -367,7 +367,7 @@ module API class CommitStatus < Grape::Entity expose :id, :sha, :ref, :status, :name, :target_url, :description, - :created_at, :started_at, :finished_at, :allow_failure + :created_at, :started_at, :finished_at, :allow_failure, :coverage expose :author, using: Entities::UserBasic end |