diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-07 21:07:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-07 21:07:33 +0300 |
commit | 1bdc6c89c32a7380a81598629b9ad05ba9a2a94f (patch) | |
tree | 778f1dc16130b3138ab3b641e664038648046a40 /app/models/ci | |
parent | 9a940dabf04df126e7978c0ab4b8770b86dcaaa8 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/ci')
-rw-r--r-- | app/models/ci/catalog/components_project.rb | 17 |
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 |