Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/ci/components/fetch_service.rb')
-rw-r--r--app/services/ci/components/fetch_service.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/app/services/ci/components/fetch_service.rb b/app/services/ci/components/fetch_service.rb
index 45abb415174..4f09d47b530 100644
--- a/app/services/ci/components/fetch_service.rb
+++ b/app/services/ci/components/fetch_service.rb
@@ -5,8 +5,6 @@ module Ci
class FetchService
include Gitlab::Utils::StrongMemoize
- TEMPLATE_FILE = 'template.yml'
-
COMPONENT_PATHS = [
::Gitlab::Ci::Components::InstancePath
].freeze
@@ -23,11 +21,16 @@ module Ci
reason: :unsupported_path)
end
- component_path = component_path_class.new(address: address, content_filename: TEMPLATE_FILE)
- content = component_path.fetch_content!(current_user: current_user)
+ component_path = component_path_class.new(address: address)
+ result = component_path.fetch_content!(current_user: current_user)
- if content.present?
- ServiceResponse.success(payload: { content: content, path: component_path })
+ if result
+ ServiceResponse.success(payload: {
+ content: result.content,
+ path: result.path,
+ project: component_path.project,
+ sha: component_path.sha
+ })
else
ServiceResponse.error(message: "#{error_prefix} content not found", reason: :content_not_found)
end