debian-mirror-gitlab/lib/gitlab/ci/config/entry/reports.rb

45 lines
1.6 KiB
Ruby
Raw Normal View History

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
include ::Gitlab::Config::Entry::Validatable
include ::Gitlab::Config::Entry::Attributable
2018-11-18 11:00:15 +05:30
2020-03-09 13:42:32 +05:30
ALLOWED_KEYS = %i[junit codequality sast dependency_scanning container_scanning dast performance license_management license_scanning metrics lsif].freeze
2018-11-18 11:00:15 +05:30
attributes ALLOWED_KEYS
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
2018-12-05 23:21:45 +05:30
validates :codequality, array_of_strings_or_string: true
validates :sast, array_of_strings_or_string: true
validates :dependency_scanning, array_of_strings_or_string: true
validates :container_scanning, array_of_strings_or_string: true
validates :dast, array_of_strings_or_string: true
2018-12-13 13:39:08 +05:30
validates :performance, array_of_strings_or_string: true
validates :license_management, array_of_strings_or_string: true
2020-03-09 13:42:32 +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-09 13:42:32 +05:30
validates :lsif, array_of_strings_or_string: true
2018-11-18 11:00:15 +05:30
end
end
def value
@config.transform_values { |v| Array(v) }
end
end
end
end
end
end