diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-09-02 02:37:11 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-09-04 21:55:26 +0900 |
commit | 3ae2038176b27673b06a040873fdbe19c94d67d3 (patch) | |
tree | b06366ef67123713f55e462f9dd57e5a12c60c48 /app/presenters | |
parent | d614c431055286eaab3b82e810186ac19a2c4fd7 (diff) | |
download | gitlab-ce-3ae2038176b27673b06a040873fdbe19c94d67d3.tar.gz |
Remove ci_trigger_request_with_variables
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/ci/build_presenter.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/presenters/ci/build_presenter.rb b/app/presenters/ci/build_presenter.rb index c495c3f39bb..531ccd39cf2 100644 --- a/app/presenters/ci/build_presenter.rb +++ b/app/presenters/ci/build_presenter.rb @@ -17,5 +17,16 @@ module Ci "Job is redundant and is auto-canceled by Pipeline ##{auto_canceled_by_id}" end end + + def old_or_new_trigger_variables + return @old_or_new_trigger_variables if defined?(@old_or_new_trigger_variables) + + if build.pipeline.variables.any? + @old_or_new_trigger_variables = + build.pipeline.variables&.map { |v| { v.key => v.value } } &.reduce({}, :merge) + else + @old_or_new_trigger_variables = build.trigger_request.variables + end + end end end |