Commit 8bf11824 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch...

Merge branch '12690-use-all-pipelines-instead-of-ci-pipelines-in-security-dashboard-code' into 'master'

Use `all_pipelines` instead of `ci_pipelines` in Security Dashboard

Closes #12690

See merge request gitlab-org/gitlab-ee!14854
parents 40fb7ca5 a91b5d44
......@@ -153,8 +153,8 @@ module EE
end
def latest_pipeline_with_security_reports
ci_pipelines.newest_first(ref: default_branch).with_reports(::Ci::JobArtifact.security_reports).first ||
ci_pipelines.newest_first(ref: default_branch).with_legacy_security_reports.first
all_pipelines.newest_first(ref: default_branch).with_reports(::Ci::JobArtifact.security_reports).first ||
all_pipelines.newest_first(ref: default_branch).with_legacy_security_reports.first
end
def environments_for_scope(scope)
......
......@@ -7,7 +7,7 @@ module API
helpers do
def vulnerability_occurrences_by(params)
pipeline = if params[:pipeline_id]
params[:project].ci_pipelines.find_by(id: params[:pipeline_id]) # rubocop:disable CodeReuse/ActiveRecord
params[:project].all_pipelines.find_by(id: params[:pipeline_id]) # rubocop:disable CodeReuse/ActiveRecord
else
params[:project].latest_pipeline_with_security_reports
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