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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-12-07 21:07:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-12-07 21:07:33 +0300
commit1bdc6c89c32a7380a81598629b9ad05ba9a2a94f (patch)
tree778f1dc16130b3138ab3b641e664038648046a40 /app/models/ci
parent9a940dabf04df126e7978c0ab4b8770b86dcaaa8 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/ci')
-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