Commit 038bab40 authored by Imre Farkas's avatar Imre Farkas

Merge branch 'id-remove-latest-for-shas' into 'master'

Remove Ci::Pipeline#latest_for_shas cause it's not used

See merge request gitlab-org/gitlab!20720
parents 27843532 558e6026
......@@ -299,11 +299,6 @@ module Ci
end
end
def self.latest_for_shas(shas)
max_id_per_sha = for_sha(shas).group(:sha).select("max(id)")
where(id: max_id_per_sha)
end
def self.latest_successful_ids_per_project
success.group(:project_id).select('max(id) as id')
end
......
......@@ -1725,17 +1725,6 @@ describe Ci::Pipeline, :mailer do
end
end
describe '.latest_for_shas' do
let(:sha) { 'abc' }
it 'returns latest pipeline for sha' do
create(:ci_pipeline, sha: sha)
pipeline2 = create(:ci_pipeline, sha: sha)
expect(described_class.latest_for_shas(sha)).to contain_exactly(pipeline2)
end
end
describe '.latest_successful_ids_per_project' do
let(:projects) { create_list(:project, 2) }
let!(:pipeline1) { create(:ci_pipeline, :success, project: projects[0]) }
......
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