summaryrefslogtreecommitdiff
path: root/lib/ci/api/entities.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-06-29 21:14:47 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-06-29 21:14:47 +0800
commitc6bed065339ff33c069225be7dc90268629d228e (patch)
treedf7498cbda881704a7c1a68a7fca8274508a4e63 /lib/ci/api/entities.rb
parent25f930fbb34f285c2c4bde97c1e85d57a9e771d3 (diff)
parent83ae38f6523c8628444de18e0a432349b6813909 (diff)
downloadgitlab-ce-c6bed065339ff33c069225be7dc90268629d228e.tar.gz
Merge remote-tracking branch 'upstream/master' into 30634-protected-pipeline
* upstream/master: (1168 commits) Job details won't scroll horizontally to show long lines Bring back branches badge to main project page Limit OpenGraph image size to 64x64 Improve changelog Split up MergeRequestsController Add parent_id back to the tests Make changelog more descriptive Improve tests text Rename members_count to members_count_with_descendants and expose only to group admins Fix a bug where an invalid sort param value was passed to Gitaly Drop default ORDER scope when calling a find method on a Sortable model Add tests for project import state transition: [:started] => [:finished] Add CHANGELOG Perform housekeeping only when an import of a fresh project is completed Strip trailing whitespace in relative submodule URL Adjust projects spec on namespace fields Add "members_count" and "parent_id" data on namespaces API Removes redundant pending delete checks Fix gitaly ref encoding bugs Add ProjectWiki#ensure_repository ...
Diffstat (limited to 'lib/ci/api/entities.rb')
-rw-r--r--lib/ci/api/entities.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/ci/api/entities.rb b/lib/ci/api/entities.rb
index 792ff628b09..6b82b2b4f13 100644
--- a/lib/ci/api/entities.rb
+++ b/lib/ci/api/entities.rb
@@ -45,7 +45,21 @@ module Ci
expose :artifacts_expire_at, if: ->(build, _) { build.artifacts? }
expose :options do |model|
- model.options
+ # This part ensures that output of old API is still the same after adding support
+ # for extended docker configuration options, used by new API
+ #
+ # I'm leaving this here, not in the model, because it should be removed at the same time
+ # when old API will be removed (planned for August 2017).
+ model.options.dup.tap do |options|
+ options[:image] = options[:image][:name] if options[:image].is_a?(Hash)
+ options[:services].map! do |service|
+ if service.is_a?(Hash)
+ service[:name]
+ else
+ service
+ end
+ end
+ end
end
expose :timeout do |model|