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/models/ci/catalog/components_project.rb')
-rw-r--r--app/models/ci/catalog/components_project.rb17
1 files changed, 2 insertions, 15 deletions
diff --git a/app/models/ci/catalog/components_project.rb b/app/models/ci/catalog/components_project.rb
index 02593d41bc2..794cb70c126 100644
--- a/app/models/ci/catalog/components_project.rb
+++ b/app/models/ci/catalog/components_project.rb
@@ -45,6 +45,8 @@ module Ci
end
def fetch_component(component_name)
+ return ComponentData.new unless component_name.index('/').nil?
+
path = simple_template_path(component_name)
content = fetch_content(path)
@@ -53,11 +55,6 @@ module Ci
content = fetch_content(path)
end
- if content.nil?
- path = legacy_template_path(component_name)
- content = fetch_content(path)
- end
-
ComponentData.new(content: content, path: path)
end
@@ -71,9 +68,6 @@ module Ci
# A simple template consists of a single file
def simple_template_path(component_name)
- # TODO: Extract this line and move to fetch_content once we remove legacy fetching
- return unless component_name.index('/').nil?
-
File.join(TEMPLATES_DIR, "#{component_name}.yml")
end
@@ -81,15 +75,8 @@ module Ci
# Given a path like "my-org/sub-group/the-project/templates/component"
# returns the entry point path: "templates/component/template.yml".
def complex_template_path(component_name)
- # TODO: Extract this line and move to fetch_content once we remove legacy fetching
- return unless component_name.index('/').nil?
-
File.join(TEMPLATES_DIR, component_name, TEMPLATE_FILE)
end
-
- def legacy_template_path(component_name)
- File.join(component_name, TEMPLATE_FILE).delete_prefix('/')
- end
end
end
end