diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-01-08 22:57:42 +0100 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-01-08 22:57:42 +0100 |
commit | 1eb7b5ee8d5afeeea74ccbd5627e5a235dffe9fd (patch) | |
tree | e1e1ee70ffbdac92531fdfb713c502d176a5a384 /lib/api/entities.rb | |
parent | 549a2fa7873366b52e9ba3caa849073b7b958b73 (diff) | |
download | gitlab-ce-1eb7b5ee8d5afeeea74ccbd5627e5a235dffe9fd.tar.gz |
Modify entities for builds API
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index f21da54b8fc..cb00b392db9 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -366,16 +366,8 @@ module API expose :id, :variables end - class CiCommit < Grape::Entity + class Runner < Grape::Entity expose :id - expose :ref - expose :sha - expose :committed_at - end - - class CiRunner < Grape::Entity - expose :id - expose :token expose :description expose :active expose :is_shared @@ -383,16 +375,23 @@ module API end class Build < Grape::Entity - expose :id - expose :status - expose :stage - expose :name - expose :ref - expose :commit, with: CiCommit - expose :runner, with: CiRunner - expose :created_at - expose :started_at - expose :finished_at + expose :id, :status, :stage, :name, :ref, :tag, :coverage, :user + expose :created_at, :started_at, :finished_at + expose :download_url do |repo_obj, options| + if options[:user_can_download_artifacts] + repo_obj.download_url + else + nil + end + end + expose :commit, with: RepoCommit do |repo_obj, _options| + if repo_obj.respond_to?(:commit) + repo_obj.commit.commit_data + else + nil + end + end + expose :runner, with: Runner end end end |