diff options
author | Steve Azzopardi <steveazz@outlook.com> | 2018-08-20 16:15:53 +0300 |
---|---|---|
committer | Steve Azzopardi <steveazz@outlook.com> | 2018-09-13 18:30:20 +0300 |
commit | 3bc5f7113350096263d615de07afe143f602659d (patch) | |
tree | 2533c44e97e9b15abf9ba3fc8d658cddb202a2e4 /app/serializers/build_details_entity.rb | |
parent | c7d1eef671dbf598814a6c2ff1f81b924583ae8a (diff) |
Add deployment information in job API
closes https://gitlab.com/gitlab-org/gitlab-ce/issues/50460
Diffstat (limited to 'app/serializers/build_details_entity.rb')
-rw-r--r-- | app/serializers/build_details_entity.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/serializers/build_details_entity.rb b/app/serializers/build_details_entity.rb index 6f8194d9856..ab9861c58c4 100644 --- a/app/serializers/build_details_entity.rb +++ b/app/serializers/build_details_entity.rb @@ -1,12 +1,26 @@ # frozen_string_literal: true class BuildDetailsEntity < JobEntity + include EnvironmentHelper + include RequestAwareEntity + include CiStatusHelper + expose :coverage, :erased_at, :duration expose :tag_list, as: :tags expose :user, using: UserEntity expose :runner, using: RunnerEntity expose :pipeline, using: PipelineEntity + expose :deployment_status, if: -> (*) { build.has_environment? } do + expose :deployment_status, as: :status + + expose :icon do |build| + ci_label_for_status(build.status) + end + + expose :persisted_environment, as: :environment, with: EnvironmentEntity + end + expose :metadata, using: BuildMetadataEntity expose :artifact, if: -> (*) { can?(current_user, :read_build, build) } do |