Commit b6e82971 authored by mfluharty's avatar mfluharty

Use super to avoid duplication

In associated_file_types_for
and batch_lookup_report_artifact_for_file_type
parent 785a6201
...@@ -61,13 +61,17 @@ module EE ...@@ -61,13 +61,17 @@ module EE
scope :coverage_fuzzing, -> do scope :coverage_fuzzing, -> do
with_file_types(COVERAGE_FUZZING_REPORT_TYPES) with_file_types(COVERAGE_FUZZING_REPORT_TYPES)
end end
end
class_methods do
extend ::Gitlab::Utils::Override
def self.associated_file_types_for(file_type) override :associated_file_types_for
return unless file_types.include?(file_type) def associated_file_types_for(file_type)
return LICENSE_SCANNING_REPORT_FILE_TYPES if LICENSE_SCANNING_REPORT_FILE_TYPES.include?(file_type) return LICENSE_SCANNING_REPORT_FILE_TYPES if LICENSE_SCANNING_REPORT_FILE_TYPES.include?(file_type)
return BROWSER_PERFORMANCE_REPORT_FILE_TYPES if BROWSER_PERFORMANCE_REPORT_FILE_TYPES.include?(file_type) return BROWSER_PERFORMANCE_REPORT_FILE_TYPES if BROWSER_PERFORMANCE_REPORT_FILE_TYPES.include?(file_type)
[file_type] super
end end
end end
......
...@@ -94,11 +94,7 @@ module EE ...@@ -94,11 +94,7 @@ module EE
def batch_lookup_report_artifact_for_file_type(file_type) def batch_lookup_report_artifact_for_file_type(file_type)
return unless available_licensed_report_type?(file_type) return unless available_licensed_report_type?(file_type)
latest_report_artifacts super
.values_at(*::Ci::JobArtifact.associated_file_types_for(file_type.to_s))
.flatten
.compact
.last
end end
def expose_license_scanning_data? def expose_license_scanning_data?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment