blob: 61b4d1ada10a17cda1a17a01300e993030354a05 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# frozen_string_literal: true
module Gitlab
module Ci
class Config
module External
class Mapper
include Gitlab::Utils::StrongMemoize
Error = Class.new(StandardError)
AmbigiousSpecificationError = Class.new(Error)
TooManyIncludesError = Class.new(Error)
def initialize(values, context)
@locations = Array.wrap(values.fetch(:include, [])).compact
@context = context
end
def process
return [] if @locations.empty?
context.logger.instrument(:config_mapper_process) do
process_without_instrumentation
end
end
private
attr_reader :context
delegate :expandset, :logger, to: :context
def process_without_instrumentation
locations = Normalizer.new(context).process(@locations)
locations = Filter.new(context).process(locations)
locations = LocationExpander.new(context).process(locations)
locations = VariablesExpander.new(context).process(locations)
files = Matcher.new(context).process(locations)
Verifier.new(context).process(files)
files
end
end
end
end
end
end
|