diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-02 15:03:21 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-02 15:03:21 +0300 |
commit | 2179a9839120bca96127b49e2460ca4c1a509921 (patch) | |
tree | feb62c2d41a4707fc505872a8c62302546770223 /app/serializers | |
parent | f802aef98386161f2ddefd1e6fd76edb3ccf6cf4 (diff) | |
parent | a04e1d5e32f7ae1740ba8b9daaf3f71a5048126c (diff) |
Merge branch 'expose-mr-pipeline-parameters-for-merge-widget-ce' into 'master'
Backport: Expose merge request pipeline parameters for MR widget
See merge request gitlab-org/gitlab-ce!26826
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/merge_request_widget_entity.rb | 1 | ||||
-rw-r--r-- | app/serializers/pipeline_entity.rb | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/app/serializers/merge_request_widget_entity.rb b/app/serializers/merge_request_widget_entity.rb index 2142ceb6122..d673f8ae896 100644 --- a/app/serializers/merge_request_widget_entity.rb +++ b/app/serializers/merge_request_widget_entity.rb @@ -20,6 +20,7 @@ class MergeRequestWidgetEntity < IssuableEntity end expose :squash expose :target_branch + expose :target_branch_sha expose :target_project_id expose :target_project_full_path do |merge_request| merge_request.project&.full_path diff --git a/app/serializers/pipeline_entity.rb b/app/serializers/pipeline_entity.rb index fba72410217..8fe5df81e6c 100644 --- a/app/serializers/pipeline_entity.rb +++ b/app/serializers/pipeline_entity.rb @@ -59,6 +59,8 @@ class PipelineEntity < Grape::Entity end expose :commit, using: CommitEntity + expose :source_sha, if: -> (pipeline, _) { pipeline.merge_request_pipeline? } + expose :target_sha, if: -> (pipeline, _) { pipeline.merge_request_pipeline? } expose :yaml_errors, if: -> (pipeline, _) { pipeline.has_yaml_errors? } expose :failure_reason, if: -> (pipeline, _) { pipeline.failure_reason? } do |pipeline| |