Commit 0702fa6c authored by Dylan Griffith's avatar Dylan Griffith Committed by Alex Kalderimis

Remove unused Vulnerability::Finding.for_pipelines_with_sha

Usages for this scope appear to have been removed in
https://gitlab.com/gitlab-org/gitlab/-/commit/44a31d8bd8991f94c12dce3a6b695c7c38cc3a52 .

This method is cross-joining between `ci_*` and non `ci_*` tables and as
such it will not be possible when `ci_*` tables are moved to a separate
database.
parent 434f40f4
......@@ -95,12 +95,6 @@ module Vulnerabilities
scope :scoped_project, -> { where('vulnerability_occurrences.project_id = projects.id') }
scope :eager_load_vulnerability_flags, -> { includes(:vulnerability_flags) }
def self.for_pipelines_with_sha(pipelines)
joins(:pipelines)
.where(ci_pipelines: { id: pipelines })
.select("vulnerability_occurrences.*, ci_pipelines.sha")
end
def self.for_pipelines(pipelines)
joins(:finding_pipelines)
.where(vulnerability_occurrence_pipelines: { pipeline_id: pipelines })
......
......@@ -129,21 +129,6 @@ RSpec.describe Vulnerabilities::Finding do
end
end
describe '.for_pipelines_with_sha' do
let(:project) { create(:project) }
let(:pipeline) { create(:ci_pipeline, :success, project: project) }
before do
create(:vulnerabilities_finding, pipelines: [pipeline], project: project)
end
subject(:findings) { described_class.for_pipelines_with_sha([pipeline]) }
it 'sets the sha' do
expect(findings.first.sha).to eq(pipeline.sha)
end
end
describe '.by_report_types' do
let!(:vulnerability_sast) { create(:vulnerabilities_finding, report_type: :sast) }
let!(:vulnerability_secret_detection) { create(:vulnerabilities_finding, report_type: :secret_detection) }
......
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