2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
class Config
|
|
|
|
module Entry
|
|
|
|
##
|
|
|
|
# Entry that represents a configuration of job artifacts.
|
|
|
|
#
|
2019-02-15 15:39:39 +05:30
|
|
|
class Reports < ::Gitlab::Config::Entry::Node
|
2022-05-07 20:08:51 +05:30
|
|
|
include ::Gitlab::Config::Entry::Configurable
|
2019-02-15 15:39:39 +05:30
|
|
|
include ::Gitlab::Config::Entry::Validatable
|
|
|
|
include ::Gitlab::Config::Entry::Attributable
|
2018-11-18 11:00:15 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
ALLOWED_KEYS =
|
2020-06-23 00:09:42 +05:30
|
|
|
%i[junit codequality sast secret_detection dependency_scanning container_scanning
|
2021-09-04 01:27:46 +05:30
|
|
|
dast performance browser_performance load_performance license_scanning metrics lsif
|
2022-07-16 23:28:13 +05:30
|
|
|
dotenv terraform accessibility
|
2022-05-07 20:08:51 +05:30
|
|
|
requirements coverage_fuzzing api_fuzzing cluster_image_scanning
|
2022-08-27 11:52:29 +05:30
|
|
|
coverage_report cyclonedx].freeze
|
2018-11-18 11:00:15 +05:30
|
|
|
|
|
|
|
attributes ALLOWED_KEYS
|
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
entry :coverage_report, Reports::CoverageReport, description: 'Coverage report configuration.'
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
validations do
|
|
|
|
validates :config, type: Hash
|
|
|
|
validates :config, allowed_keys: ALLOWED_KEYS
|
|
|
|
|
|
|
|
with_options allow_nil: true do
|
|
|
|
validates :junit, array_of_strings_or_string: true
|
2021-01-03 14:25:43 +05:30
|
|
|
validates :api_fuzzing, array_of_strings_or_string: true
|
2020-07-28 23:09:34 +05:30
|
|
|
validates :coverage_fuzzing, array_of_strings_or_string: true
|
|
|
|
validates :sast, array_of_strings_or_string: true
|
2018-12-05 23:21:45 +05:30
|
|
|
validates :sast, array_of_strings_or_string: true
|
2020-06-23 00:09:42 +05:30
|
|
|
validates :secret_detection, array_of_strings_or_string: true
|
2018-12-05 23:21:45 +05:30
|
|
|
validates :dependency_scanning, array_of_strings_or_string: true
|
|
|
|
validates :container_scanning, array_of_strings_or_string: true
|
2021-09-30 23:02:18 +05:30
|
|
|
validates :cluster_image_scanning, array_of_strings_or_string: true
|
2018-12-05 23:21:45 +05:30
|
|
|
validates :dast, array_of_strings_or_string: true
|
2018-12-13 13:39:08 +05:30
|
|
|
validates :performance, array_of_strings_or_string: true
|
2020-07-28 23:09:34 +05:30
|
|
|
validates :browser_performance, array_of_strings_or_string: true
|
|
|
|
validates :load_performance, array_of_strings_or_string: true
|
2020-03-13 15:44:24 +05:30
|
|
|
validates :license_scanning, array_of_strings_or_string: true
|
2019-07-07 11:18:12 +05:30
|
|
|
validates :metrics, array_of_strings_or_string: true
|
2020-03-13 15:44:24 +05:30
|
|
|
validates :lsif, array_of_strings_or_string: true
|
2020-04-08 14:13:33 +05:30
|
|
|
validates :dotenv, array_of_strings_or_string: true
|
2020-04-22 19:07:51 +05:30
|
|
|
validates :terraform, array_of_strings_or_string: true
|
2020-05-24 23:13:21 +05:30
|
|
|
validates :accessibility, array_of_strings_or_string: true
|
2020-06-23 00:09:42 +05:30
|
|
|
validates :requirements, array_of_strings_or_string: true
|
2022-08-27 11:52:29 +05:30
|
|
|
validates :cyclonedx, array_of_strings_or_string: true
|
2018-11-18 11:00:15 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def value
|
2022-05-07 20:08:51 +05:30
|
|
|
@config.transform_values do |value|
|
|
|
|
if value.is_a?(Hash)
|
|
|
|
value
|
|
|
|
else
|
|
|
|
Array(value)
|
|
|
|
end
|
|
|
|
end
|
2018-11-18 11:00:15 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|