diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ci/api/builds.rb | 4 | ||||
| -rw-r--r-- | lib/ci/api/entities.rb | 19 | 
2 files changed, 17 insertions, 6 deletions
| diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb index fb87637b94f..690bbf97a89 100644 --- a/lib/ci/api/builds.rb +++ b/lib/ci/api/builds.rb @@ -20,7 +20,7 @@ module Ci            if build              update_runner_info -            present build, with: Entities::Build +            present build, with: Entities::BuildDetails            else              not_found!            end @@ -111,7 +111,7 @@ module Ci            build.artifacts_metadata = metadata            if build.save -            present(build, with: Entities::Build) +            present(build, with: Entities::BuildDetails)            else              render_validation_error!(build)            end diff --git a/lib/ci/api/entities.rb b/lib/ci/api/entities.rb index e4ac0545ea2..835f8c97021 100644 --- a/lib/ci/api/entities.rb +++ b/lib/ci/api/entities.rb @@ -16,10 +16,19 @@ module Ci        end        class Build < Grape::Entity -        expose :id, :commands, :ref, :sha, :status, :project_id, :repo_url, -          :before_sha, :allow_git_fetch, :project_name - +        expose :id, :ref, :tag, :sha, :status          expose :name, :token, :stage +        expose :project_id +        expose :project_name +        expose :artifacts_file, using: ArtifactFile, if: lambda { |build, opts| build.artifacts_file.exists? } +      end + +      class BuildDetails < Build +        expose :commands +        expose :repo_url +        expose :before_sha +        expose :allow_git_fetch +        expose :token          expose :options do |model|            model.options @@ -30,7 +39,9 @@ module Ci          end          expose :variables -        expose :artifacts_file, using: ArtifactFile +        expose :dependencies do +          expose :depends_on_builds, as: :builds, using: Build +        end        end        class Runner < Grape::Entity | 
