Commit 5091d431 authored by Michael Kozono's avatar Michael Kozono

Merge branch 'rename-comparer' into 'master'

Rename comparer file for generic use

See merge request gitlab-org/gitlab-ee!15133
parents 8ad7a165 b3f090e0
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Ci module Ci
class CompareContainerScanningReportsService < ::Ci::CompareReportsBaseService class CompareContainerScanningReportsService < ::Ci::CompareReportsBaseService
def comparer_class def comparer_class
Gitlab::Ci::Reports::Security::ContainerScanningReportsComparer Gitlab::Ci::Reports::Security::VulnerabilityReportsComparer
end end
def serializer_class def serializer_class
......
...@@ -4,13 +4,13 @@ module Gitlab ...@@ -4,13 +4,13 @@ module Gitlab
module Ci module Ci
module Reports module Reports
module Security module Security
class ContainerScanningReportsComparer class VulnerabilityReportsComparer
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
attr_reader :base_report, :head_report attr_reader :base_report, :head_report
def initialize(base_report, head_report) def initialize(base_report, head_report)
@base_report = base_report || ::Gitlab::Ci::Reports::Security::Report.new('container_scanning', '') @base_report = base_report || ::Gitlab::Ci::Reports::Security::Report.new(head_report&.type, '')
@head_report = head_report @head_report = head_report
end end
......
...@@ -7,7 +7,7 @@ describe Vulnerabilities::OccurrenceReportsComparerEntity do ...@@ -7,7 +7,7 @@ describe Vulnerabilities::OccurrenceReportsComparerEntity do
let!(:head_pipeline) { create(:ee_ci_pipeline, :with_container_scanning_feature_branch) } let!(:head_pipeline) { create(:ee_ci_pipeline, :with_container_scanning_feature_branch) }
let(:base_report) { base_pipeline.security_reports.get_report('container_scanning')} let(:base_report) { base_pipeline.security_reports.get_report('container_scanning')}
let(:head_report) { head_pipeline.security_reports.get_report('container_scanning')} let(:head_report) { head_pipeline.security_reports.get_report('container_scanning')}
let(:comparer) { Gitlab::Ci::Reports::Security::ContainerScanningReportsComparer.new(base_report, head_report) } let(:comparer) { Gitlab::Ci::Reports::Security::VulnerabilityReportsComparer.new(base_report, head_report) }
let(:entity) { described_class.new(comparer) } let(:entity) { described_class.new(comparer) }
before do before do
......
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