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-06-14 17:40:47 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-14 17:40:47 +0300
commit2fc6ed6b8d0b371c1168116b7410bb71fc5a55d0 (patch)
tree7676ef5be63dbf1f58dff84cece7894d16436b9f
parent36295558c93dd7551cde7b1d110e3838165c07bb (diff)
Add latest changes from gitlab-org/gitlab@15-10-stable-ee15-10-stable
-rw-r--r--lib/gitlab/ci/config/entry/includes.rb14
-rw-r--r--spec/lib/gitlab/ci/config/entry/includes_spec.rb16
2 files changed, 19 insertions, 11 deletions
diff --git a/lib/gitlab/ci/config/entry/includes.rb b/lib/gitlab/ci/config/entry/includes.rb
index 24d0e27e3a7..671ecf4eac1 100644
--- a/lib/gitlab/ci/config/entry/includes.rb
+++ b/lib/gitlab/ci/config/entry/includes.rb
@@ -7,7 +7,7 @@ module Gitlab
##
# Entry that represents a list of include.
#
- class Includes < ::Gitlab::Config::Entry::Node
+ class Includes < ::Gitlab::Config::Entry::ComposableArray
include ::Gitlab::Config::Entry::Validatable
validations do
@@ -23,16 +23,8 @@ module Gitlab
end
end
- def self.aspects
- super.append -> do
- @config = Array.wrap(@config)
-
- @config.each_with_index do |config, i|
- @entries[i] = ::Gitlab::Config::Entry::Factory.new(Entry::Include)
- .value(config || {})
- .create!
- end
- end
+ def composable_class
+ Entry::Include
end
end
end
diff --git a/spec/lib/gitlab/ci/config/entry/includes_spec.rb b/spec/lib/gitlab/ci/config/entry/includes_spec.rb
new file mode 100644
index 00000000000..f1f28c24e70
--- /dev/null
+++ b/spec/lib/gitlab/ci/config/entry/includes_spec.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+require 'fast_spec_helper'
+require_dependency 'active_model'
+
+RSpec.describe ::Gitlab::Ci::Config::Entry::Includes, feature_category: :pipeline_composition do
+ subject(:include_entry) { described_class.new(config) }
+
+ describe '#initialize' do
+ let(:config) { 'test.yml' }
+
+ it 'does not increase aspects' do
+ 2.times { expect { described_class.new(config) }.not_to change { described_class.aspects.count } }
+ end
+ end
+end