diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /lib/gitlab/ci/config/external/mapper.rb | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) | |
download | gitlab-ce-a7b3560714b4d9cc4ab32dffcd1f74a284b93580.tar.gz |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'lib/gitlab/ci/config/external/mapper.rb')
-rw-r--r-- | lib/gitlab/ci/config/external/mapper.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/gitlab/ci/config/external/mapper.rb b/lib/gitlab/ci/config/external/mapper.rb index a5bf066c81f..7f1de6ce1ab 100644 --- a/lib/gitlab/ci/config/external/mapper.rb +++ b/lib/gitlab/ci/config/external/mapper.rb @@ -19,7 +19,6 @@ module Gitlab Error = Class.new(StandardError) AmbigiousSpecificationError = Class.new(Error) - DuplicateIncludesError = Class.new(Error) TooManyIncludesError = Class.new(Error) def initialize(values, context) @@ -114,25 +113,22 @@ module Gitlab def verify_duplicates!(location) logger.instrument(:config_mapper_verify) do - verify_duplicates_without_instrumentation!(location) + verify_max_includes_and_add_location!(location) end end - def verify_duplicates_without_instrumentation!(location) + def verify_max_includes_and_add_location!(location) if expandset.count >= MAX_INCLUDES raise TooManyIncludesError, "Maximum of #{MAX_INCLUDES} nested includes are allowed!" end - # We scope location to context, as this allows us to properly support - # relative includes, and similarly looking relative in another project - # does not trigger duplicate error + # Scope location to context to allow support of + # relative includes scoped_location = location.merge( context_project: context.project, context_sha: context.sha) - unless expandset.add?(scoped_location) - raise DuplicateIncludesError, "Include `#{location.to_json}` was already included!" - end + expandset.add(scoped_location) end def select_first_matching(location) |