Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorwendy0402 <wendykurniawan92@gmail.com>2017-02-14 05:28:45 +0300
committerwendy0402 <wendykurniawan92@gmail.com>2017-02-14 05:32:25 +0300
commit79ce7579bb7dad3dba344893fb20c2f1346c84a0 (patch)
tree132ae368420580585df9e25fcbac1824b7393a49 /lib/api
parente5f446b7ca4bc54ffaf527e4c57dea2bee2f79f6 (diff)
Make it possible to pass coverage value to commit status API
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/commit_statuses.rb4
-rw-r--r--lib/api/entities.rb2
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