summaryrefslogtreecommitdiff
path: root/app/serializers/build_details_entity.rb
diff options
context:
space:
mode:
authorSteve Azzopardi <steveazz@outlook.com>2018-09-04 09:51:00 +0200
committerSteve Azzopardi <steveazz@outlook.com>2018-09-12 11:00:39 +0200
commit1b388c798b01d950ad8692e34938a2a457c6ad0f (patch)
tree96471170bf1da744b6c043212a78c09df768a17d /app/serializers/build_details_entity.rb
parentf87809f78de9da04f38134ba5ce0cf9ddebf2f63 (diff)
downloadgitlab-ce-1b388c798b01d950ad8692e34938a2a457c6ad0f.tar.gz
Add trigger information for job API
Create new entity called TriggerVariablesEnitity for trigger variables, to aid reuseablity in the future. Update JSON schema to include trigger information in the response. Refactor rspec tests a bit to reduce duplication and for the `context` to make sense. closes https://gitlab.com/gitlab-org/gitlab-ce/issues/50989
Diffstat (limited to 'app/serializers/build_details_entity.rb')
-rw-r--r--app/serializers/build_details_entity.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/serializers/build_details_entity.rb b/app/serializers/build_details_entity.rb
index b107fc26f18..6f8194d9856 100644
--- a/app/serializers/build_details_entity.rb
+++ b/app/serializers/build_details_entity.rb
@@ -59,6 +59,12 @@ class BuildDetailsEntity < JobEntity
raw_project_job_path(project, build)
end
+ expose :trigger, if: -> (*) { build.trigger_request } do
+ expose :trigger_short_token, as: :short_token
+
+ expose :trigger_variables, as: :variables, using: TriggerVariableEntity
+ end
+
private
def build_failed_issue_options