Commit 22545899 authored by Nick Thomas's avatar Nick Thomas

Merge branch '326886-feature-flag-rollout-of-ci_pipeline_ensure_iid_on_drop' into 'master'

Resolve "[Feature flag] Rollout of `ci_pipeline_ensure_iid_on_drop `" [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!59626
parents b40ca001 63f53da0
---
title: Ensure the project iid is set before dropping pipeline
merge_request: 59626
author:
type: performance
---
name: ci_pipeline_ensure_iid_on_drop
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57783
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/326886
milestone: '13.11'
type: development
group: group::code review
default_enabled: false
......@@ -31,12 +31,10 @@ module Gitlab
return if pipeline.readonly?
if drop_reason && command.save_incompleted
if Feature.enabled?(:ci_pipeline_ensure_iid_on_drop, pipeline.project, default_enabled: :yaml)
# Project iid must be called outside a transaction, so we ensure it is set here
# otherwise it may be set within the state transition transaction of the drop! call
# which it will lock the InternalId row for the whole transaction
pipeline.ensure_project_iid!
end
# Project iid must be called outside a transaction, so we ensure it is set here
# otherwise it may be set within the state transition transaction of the drop! call
# which it will lock the InternalId row for the whole transaction
pipeline.ensure_project_iid!
pipeline.drop!(drop_reason)
else
......
......@@ -57,14 +57,5 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Helpers do
end
end
end
context 'when the ci_pipeline_ensure_iid_on_drop feature flag is false' do
it 'does not ensure the project iid' do
stub_feature_flags(ci_pipeline_ensure_iid_on_drop: false)
expect(pipeline).to receive(:ensure_project_iid!).once
subject.error(message, config_error: true)
end
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