Commit dab488f7 authored by Furkan Ayhan's avatar Furkan Ayhan

Merge branch 'cleanup-pipeline-looger-feature-flags' into 'master'

Cleanup pipeline logger feature flags

See merge request gitlab-org/gitlab!77973
parents 57cc047e ec525e62
...@@ -467,15 +467,11 @@ module Ci ...@@ -467,15 +467,11 @@ module Ci
end end
def tags_count def tags_count
if tag_counts_enabled? ActsAsTaggableOn::Tagging.where(taggable: builds).count
ActsAsTaggableOn::Tagging.where(taggable: builds).count
end
end end
def distinct_tags_count def distinct_tags_count
if tag_counts_enabled? ActsAsTaggableOn::Tagging.where(taggable: builds).count('distinct(tag_id)')
ActsAsTaggableOn::Tagging.where(taggable: builds).count('distinct(tag_id)')
end
end end
def stages_names def stages_names
...@@ -1352,12 +1348,6 @@ module Ci ...@@ -1352,12 +1348,6 @@ module Ci
::Gitlab::Ci::PipelineObjectHierarchy ::Gitlab::Ci::PipelineObjectHierarchy
.new(self.class.unscoped.where(id: id), options: options) .new(self.class.unscoped.where(id: id), options: options)
end end
def tag_counts_enabled?
strong_memoize(:tag_counts_enabled) do
::Feature.enabled?(:ci_pipeline_logger_tags_count, project, default_enabled: :yaml)
end
end
end end
end end
......
---
name: ci_pipeline_logger_sql_count
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77117
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/346246
milestone: '14.7'
type: development
group: group::pipeline execution
default_enabled: false
---
name: ci_pipeline_logger_tags_count
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77112
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/348967
milestone: '14.7'
type: development
group: group::pipeline execution
default_enabled: false
...@@ -38,8 +38,6 @@ module Gitlab ...@@ -38,8 +38,6 @@ module Gitlab
end end
def instrument_with_sql(operation, &block) def instrument_with_sql(operation, &block)
return instrument(operation, &block) unless sql_logging_enabled?
op_start_db_counters = current_db_counter_payload op_start_db_counters = current_db_counter_payload
result = instrument(operation, &block) result = instrument(operation, &block)
...@@ -131,12 +129,6 @@ module Gitlab ...@@ -131,12 +129,6 @@ module Gitlab
def current_db_counter_payload def current_db_counter_payload
::Gitlab::Metrics::Subscribers::ActiveRecord.db_counter_payload ::Gitlab::Metrics::Subscribers::ActiveRecord.db_counter_payload
end end
def sql_logging_enabled?
strong_memoize(:sql_logging_enabled) do
::Feature.enabled?(:ci_pipeline_logger_sql_count, project, default_enabled: :yaml)
end
end
end end
end end
end end
......
...@@ -4695,14 +4695,5 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do ...@@ -4695,14 +4695,5 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
it { expect(pipeline.tags_count).to eq(4) } it { expect(pipeline.tags_count).to eq(4) }
it { expect(pipeline.distinct_tags_count).to eq(3) } it { expect(pipeline.distinct_tags_count).to eq(3) }
end end
context 'with the FF disabled' do
before do
stub_feature_flags(ci_pipeline_logger_tags_count: false)
end
it { expect(pipeline.tags_count).to be_nil }
it { expect(pipeline.distinct_tags_count).to be_nil }
end
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