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.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/ci/catalog/components_project.rb b/app/models/ci/catalog/components_project.rb
index 2bc33a6f050..02593d41bc2 100644
--- a/app/models/ci/catalog/components_project.rb
+++ b/app/models/ci/catalog/components_project.rb
@@ -9,7 +9,8 @@ module Ci
TEMPLATE_FILE = 'template.yml'
TEMPLATES_DIR = 'templates'
- TEMPLATE_PATH_REGEX = '^templates\/\w+\-?\w+(?:\/template)?\.yml$'
+ TEMPLATE_PATH_REGEX = '^templates\/[\w-]+(?:\/template)?\.yml$'
+ COMPONENTS_LIMIT = 10
ComponentData = Struct.new(:content, :path, keyword_init: true)
@@ -18,8 +19,8 @@ module Ci
@sha = sha
end
- def fetch_component_paths(sha)
- project.repository.search_files_by_regexp(TEMPLATE_PATH_REGEX, sha)
+ def fetch_component_paths(sha, limit: COMPONENTS_LIMIT)
+ project.repository.search_files_by_regexp(TEMPLATE_PATH_REGEX, sha, limit: limit)
end
def extract_component_name(path)