Commit b89eb733 authored by Tetiana Chupryna's avatar Tetiana Chupryna Committed by Robert Speicher

Disable cop for service

We use this service to unify method of report fetching
for both License Compliance and Dependency List
that's why we need to use this service in the model
parent e596e2da
......@@ -48,7 +48,7 @@ module SCA
def pipeline
strong_memoize(:pipeline) do
project.all_pipelines.latest_successful_for_ref(project.default_branch)
project.latest_pipeline_with_reports(::Ci::JobArtifact.license_management_reports)
end
end
......
......@@ -184,5 +184,12 @@ RSpec.describe SCA::LicenseCompliance do
it { expect(subject.latest_build_for_default_branch).to be_nil }
end
context "when latest pipeline doesn't contain license job" do
let!(:pipeline1) { create(:ci_pipeline, :success, project: project, builds: [license_scan_build]) }
let!(:pipeline2) { create(:ci_pipeline, :success, project: project, builds: [regular_build]) }
it { expect(subject.latest_build_for_default_branch).to eq(license_scan_build) }
end
end
end
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