Use porcelain commit lookup method on CI::CreatePipelineService
Before we were using a "plumbing" Gitlab::Git method that does not go through Gitaly migration checking.
This commit is contained in:
parent
22fc4863d3
commit
04b8e00feb
3 changed files with 10 additions and 5 deletions
|
@ -65,7 +65,7 @@ module Ci
|
|||
project.pipelines
|
||||
.where(ref: pipeline.ref)
|
||||
.where.not(id: pipeline.id)
|
||||
.where.not(sha: project.repository.sha_from_ref(pipeline.ref))
|
||||
.where.not(sha: project.commit(pipeline.ref).try(:id))
|
||||
.created_or_pending
|
||||
end
|
||||
|
||||
|
|
5
changelogs/unreleased/ci-pipeline-commit-lookup.yml
Normal file
5
changelogs/unreleased/ci-pipeline-commit-lookup.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Use porcelain commit lookup method on CI::CreatePipelineService
|
||||
merge_request: 17911
|
||||
author:
|
||||
type: fixed
|
|
@ -516,10 +516,6 @@ module Gitlab
|
|||
end
|
||||
end
|
||||
|
||||
def sha_from_ref(ref)
|
||||
rev_parse_target(ref).oid
|
||||
end
|
||||
|
||||
# Return the object that +revspec+ points to. If +revspec+ is an
|
||||
# annotated tag, then return the tag's target instead.
|
||||
def rev_parse_target(revspec)
|
||||
|
@ -2409,6 +2405,10 @@ module Gitlab
|
|||
def rev_list_param(spec)
|
||||
spec == :all ? ['--all'] : spec
|
||||
end
|
||||
|
||||
def sha_from_ref(ref)
|
||||
rev_parse_target(ref).oid
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue