2023-03-04 22:38:38 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
class Config
|
|
|
|
module External
|
|
|
|
class Mapper
|
|
|
|
# Base class for mapper classes
|
|
|
|
class Base
|
|
|
|
def initialize(context)
|
|
|
|
@context = context
|
|
|
|
end
|
|
|
|
|
2023-04-23 21:23:45 +05:30
|
|
|
def process(...)
|
2023-03-04 22:38:38 +05:30
|
|
|
context.logger.instrument(mapper_instrumentation_key) do
|
2023-04-23 21:23:45 +05:30
|
|
|
process_without_instrumentation(...)
|
2023-03-04 22:38:38 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
attr_reader :context
|
|
|
|
|
|
|
|
def process_without_instrumentation
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def mapper_instrumentation_key
|
|
|
|
"config_mapper_#{self.class.name.demodulize.downcase}".to_sym
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|