Skip to content
Snippets Groups Projects
Unverified Commit 05b4762c authored by Avielle Wolfe's avatar Avielle Wolfe
Browse files

Remove omit_commit_sha feature flag

The ci_pipeline_status_omit_commit_sha_in_cache_key feature flag was
introduced in 13.2 and is now ready for removal.

Changelog: removed
parent 80b03c73
No related branches found
No related tags found
No related merge requests found
---
name: ci_pipeline_status_omit_commit_sha_in_cache_key
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33712
rollout_issue_url:
milestone: '13.2'
type: development
group: group::pipeline execution
default_enabled: true
Loading
Loading
@@ -50,8 +50,6 @@ def has_status?
def load_status
return if loaded?
 
return unless Gitlab::Ci::Features.pipeline_status_omit_commit_sha_in_cache_key?(project) || commit
if has_cache?
load_from_cache
else
Loading
Loading
@@ -119,11 +117,7 @@ def loaded?
end
 
def cache_key
if Gitlab::Ci::Features.pipeline_status_omit_commit_sha_in_cache_key?(project)
"#{Gitlab::Redis::Cache::CACHE_NAMESPACE}:project:#{project.id}:pipeline_status"
else
"#{Gitlab::Redis::Cache::CACHE_NAMESPACE}:project:#{project.id}:pipeline_status:#{commit&.sha}"
end
"#{Gitlab::Redis::Cache::CACHE_NAMESPACE}:project:#{project.id}:pipeline_status"
end
 
def commit
Loading
Loading
Loading
Loading
@@ -14,10 +14,6 @@ def self.pipeline_latest?
::Feature.enabled?(:ci_pipeline_latest, default_enabled: true)
end
 
def self.pipeline_status_omit_commit_sha_in_cache_key?(project)
Feature.enabled?(:ci_pipeline_status_omit_commit_sha_in_cache_key, project, default_enabled: true)
end
# NOTE: The feature flag `disallow_to_create_merge_request_pipelines_in_target_project`
# is a safe switch to disable the feature for a particular project when something went wrong,
# therefore it's not supposed to be enabled by default.
Loading
Loading
Loading
Loading
@@ -83,24 +83,8 @@
expect(pipeline_status).not_to be_has_cache
end
 
context 'ci_pipeline_status_omit_commit_sha_in_cache_key is enabled' do
before do
stub_feature_flags(ci_pipeline_status_omit_commit_sha_in_cache_key: project)
end
it 'makes a Gitaly call' do
expect { pipeline_status.load_status }.to change { Gitlab::GitalyClient.get_request_count }.by(1)
end
end
context 'ci_pipeline_status_omit_commit_sha_in_cache_key is disabled' do
before do
stub_feature_flags(ci_pipeline_status_omit_commit_sha_in_cache_key: false)
end
it 'makes a Gitaly calls' do
expect { pipeline_status.load_status }.to change { Gitlab::GitalyClient.get_request_count }.by(1)
end
it 'makes a Gitaly call' do
expect { pipeline_status.load_status }.to change { Gitlab::GitalyClient.get_request_count }.by(1)
end
end
 
Loading
Loading
@@ -111,24 +95,8 @@
expect(pipeline_status).to be_has_cache
end
 
context 'ci_pipeline_status_omit_commit_sha_in_cache_key is enabled' do
before do
stub_feature_flags(ci_pipeline_status_omit_commit_sha_in_cache_key: project)
end
it 'makes no Gitaly calls' do
expect { pipeline_status.load_status }.to change { Gitlab::GitalyClient.get_request_count }.by(0)
end
end
context 'ci_pipeline_status_omit_commit_sha_in_cache_key is disabled' do
before do
stub_feature_flags(ci_pipeline_status_omit_commit_sha_in_cache_key: false)
end
it 'makes a Gitaly calls' do
expect { pipeline_status.load_status }.to change { Gitlab::GitalyClient.get_request_count }.by(1)
end
it 'makes no Gitaly calls' do
expect { pipeline_status.load_status }.to change { Gitlab::GitalyClient.get_request_count }.by(0)
end
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment