diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-05-06 15:20:20 +0200 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-05-24 10:04:05 +0100 |
commit | 412a38570245003b6509bf20cff2cce206ec8aa7 (patch) | |
tree | 1a2714b97251472f8d0287d49ef65ab76d9f53f9 /app/serializers/build_details_entity.rb | |
parent | 1052f64c3cf90694443487f3485d6f9ae26a5ab8 (diff) | |
download | gitlab-ce-412a38570245003b6509bf20cff2cce206ec8aa7.tar.gz |
Do not serialize a deployment commit showing a job
Diffstat (limited to 'app/serializers/build_details_entity.rb')
-rw-r--r-- | app/serializers/build_details_entity.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/serializers/build_details_entity.rb b/app/serializers/build_details_entity.rb index 30c3246b05b..f391b6f8a1b 100644 --- a/app/serializers/build_details_entity.rb +++ b/app/serializers/build_details_entity.rb @@ -13,7 +13,11 @@ class BuildDetailsEntity < JobEntity expose :deployment_status, if: -> (*) { build.starts_environment? } do expose :deployment_status, as: :status - expose :persisted_environment, as: :environment, with: EnvironmentEntity + expose :persisted_environment, as: :environment do |build, options| + options.merge(except: [{ last_deployment: [:commit] }]).yield_self do |opts| + EnvironmentEntity.represent(build.persisted_environment, opts) + end + end end expose :artifact, if: -> (*) { can?(current_user, :read_build, build) } do |