Commit 81c37f85 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch...

Merge branch '209783-follow-up-from-resolve-notifications-for-when-pipelines-are-fixed' into 'master'

Correctly send notification on pipeline retry

Closes #209783

See merge request gitlab-org/gitlab!26803
parents c427666d ac7dd2d8
......@@ -22,7 +22,7 @@ module Ci
begin
retry_optimistic_lock(ref) do
next false if ref.persisted? &&
(ref.last_updated_by_pipeline_id || 0) >= pipeline.id
(ref.last_updated_by_pipeline_id || 0) > pipeline.id
ref.update(status: next_status(ref.status, pipeline.status),
last_updated_by_pipeline: pipeline)
......
---
title: Correctly send notification on pipeline retry
merge_request: 26803
author: Jacopo Beschi @jacopo-beschi
type: fixed
......@@ -119,6 +119,14 @@ describe Ci::UpdateCiRefStatusService do
it_behaves_like 'does a noop'
end
context 'pipeline is retried' do
before do
ci_ref.update!(last_updated_by_pipeline: pipeline)
end
it_behaves_like 'updates ci_ref'
end
context 'ref is stale' do
let(:pipeline1) { create(:ci_pipeline, :success, project: ci_ref.project, ref: ci_ref.ref, tag: ci_ref.tag) }
let(:pipeline2) { create(:ci_pipeline, :success, project: ci_ref.project, ref: ci_ref.ref, tag: ci_ref.tag) }
......
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