diff --git a/app/workers/click_house/concerns/consistency_worker.rb b/app/workers/click_house/concerns/consistency_worker.rb index c4a38c82bfc9c92d82df9eee30ca25584e587c7b..23914a8ad9e783f229f21caf136e75af63005e20 100644 --- a/app/workers/click_house/concerns/consistency_worker.rb +++ b/app/workers/click_house/concerns/consistency_worker.rb @@ -66,7 +66,7 @@ def click_house_each_batch end def enabled? - Gitlab::ClickHouse.globally_enabled_for_analytics? && Feature.enabled?(:event_sync_worker_for_click_house) + Gitlab::ClickHouse.globally_enabled_for_analytics? end def runtime_limiter diff --git a/config/feature_flags/development/clickhouse_data_collection.yml b/config/feature_flags/development/clickhouse_data_collection.yml deleted file mode 100644 index 1887c4afc855905921e8f8d9655afecbb08e152d..0000000000000000000000000000000000000000 --- a/config/feature_flags/development/clickhouse_data_collection.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: clickhouse_data_collection -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/127435 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/420257 -milestone: '16.3' -type: development -group: group::optimize -default_enabled: false diff --git a/config/feature_flags/development/event_sync_worker_for_click_house.yml b/config/feature_flags/development/event_sync_worker_for_click_house.yml deleted file mode 100644 index 7461d0a9da2d07cd6bfdc1ac763d49208fc3b27d..0000000000000000000000000000000000000000 --- a/config/feature_flags/development/event_sync_worker_for_click_house.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: event_sync_worker_for_click_house -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128628 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/421184 -milestone: '16.3' -type: development -group: group::optimize -default_enabled: false diff --git a/doc/administration/analytics.md b/doc/administration/analytics.md index 2d6d8148a1f140e4a907dc3aa2a707a5f44ddca1..3e013b044839bf26a6d3dc20c0d6ee367ca2cbe1 100644 --- a/doc/administration/analytics.md +++ b/doc/administration/analytics.md @@ -11,6 +11,7 @@ DETAILS: **Offering:** GitLab.com, Self-managed > - ClickHouse data collector [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/414610) in GitLab 16.3 [with a flag](../administration/feature_flags.md) named `clickhouse_data_collection`. Disabled by default. +> - Feature flag `clickhouse_data_collection` removed in GitLab 17.0 and replaced with an application setting. The [contribution analytics](../user/group/contribution_analytics/index.md) report and [Value Streams Dashboard](../user/analytics/value_streams_dashboard.md#dashboard-metrics-and-drill-down-reports) contributors count metric can use ClickHouse as a data source. diff --git a/doc/user/analytics/value_streams_dashboard.md b/doc/user/analytics/value_streams_dashboard.md index 66548b458840c5ff40d2147a8048def99adb1531..d70ca3259aee96d4e3f476fd6b128301e69662ad 100644 --- a/doc/user/analytics/value_streams_dashboard.md +++ b/doc/user/analytics/value_streams_dashboard.md @@ -65,7 +65,7 @@ The sparkline color ranges from blue to green, where green indicates a positive Sparklines help you identify patterns in metric trends (such as seasonal changes) over time. NOTE: -The contributor count metric is available only on GitLab.com at the group-level. To view this metric in the comparison panel, you must [set up ClickHouse](../../integration/clickhouse.md), and enable the [feature flags](../../administration/feature_flags.md) `clickhouse_data_collection` and `event_sync_worker_for_click_house`. +The contributor count metric is available only on GitLab.com at the group-level. To view this metric in the comparison panel, you must [set up ClickHouse](../../integration/clickhouse.md). ### DORA Performers score panel diff --git a/ee/app/services/click_house/sync_strategies/event_sync_strategy.rb b/ee/app/services/click_house/sync_strategies/event_sync_strategy.rb index 7c9ad021c732cadd1feb11555bc6814c14e62baa..d6bdd0e5094019be88cec4150277589618b7ce57 100644 --- a/ee/app/services/click_house/sync_strategies/event_sync_strategy.rb +++ b/ee/app/services/click_house/sync_strategies/event_sync_strategy.rb @@ -55,9 +55,7 @@ def model_class end def enabled? - super && - Gitlab::ClickHouse.globally_enabled_for_analytics? && - Feature.enabled?(:event_sync_worker_for_click_house) + super && Gitlab::ClickHouse.globally_enabled_for_analytics? end end end diff --git a/ee/app/views/admin/application_settings/_analytics.html.haml b/ee/app/views/admin/application_settings/_analytics.html.haml index b8455b45d64cdc81333ceff285e62f8e2ec9bb37..a358f52c039e8db6934e06df3d99634b3a3c9f4c 100644 --- a/ee/app/views/admin/application_settings/_analytics.html.haml +++ b/ee/app/views/admin/application_settings/_analytics.html.haml @@ -1,4 +1,3 @@ -- return unless Feature.enabled?(:clickhouse_data_collection) - expanded = integration_expanded?('use_clickhouse_') %section.settings.no-animate#js-analytics-settings{ class: ('expanded' if expanded) } diff --git a/ee/db/fixtures/development/94_ai_usage_stats.rb b/ee/db/fixtures/development/94_ai_usage_stats.rb index b3ef6dae33e3c4908cf6a8cd2dfabd98360d7ec1..b3c7bd3752aaf139e7fd6325d686e452e98794a9 100644 --- a/ee/db/fixtures/development/94_ai_usage_stats.rb +++ b/ee/db/fixtures/development/94_ai_usage_stats.rb @@ -64,8 +64,6 @@ def sync_to_click_house Gitlab::Seeder.quiet do feature_available = ::Gitlab::ClickHouse.globally_enabled_for_analytics? && - Feature.enabled?(:clickhouse_data_collection) && - Feature.enabled?(:event_sync_worker_for_click_house) && Feature.enabled?(:code_suggestion_events_in_click_house) unless feature_available @@ -80,8 +78,6 @@ def sync_to_click_house Gitlab::CurrentSettings.current_application_settings.update(use_clickhouse_for_analytics: true) - Feature.enable(:clickhouse_data_collection) - Feature.enable(:event_sync_worker_for_click_house) Feature.enable(:code_suggestion_events_in_click_house) " break diff --git a/ee/lib/ee/gitlab/click_house.rb b/ee/lib/ee/gitlab/click_house.rb index 93108c5c6cfc738c54f701dabd2acf092d5aec83..019304c2321d837004c40e458b200c24a071ac95 100644 --- a/ee/lib/ee/gitlab/click_house.rb +++ b/ee/lib/ee/gitlab/click_house.rb @@ -6,8 +6,8 @@ module ClickHouse extend ActiveSupport::Concern class_methods do - def enabled_for_analytics?(group = nil) - globally_enabled_for_analytics? && ::Feature.enabled?(:clickhouse_data_collection, group) + def enabled_for_analytics?(_group = nil) + globally_enabled_for_analytics? end def globally_enabled_for_analytics? diff --git a/ee/spec/features/admin/admin_settings_spec.rb b/ee/spec/features/admin/admin_settings_spec.rb index 576b14c827edaa08d2680055dc83e0877e6c8759..db78043531a348792fd641a45c2f9044f2d70c54 100644 --- a/ee/spec/features/admin/admin_settings_spec.rb +++ b/ee/spec/features/admin/admin_settings_spec.rb @@ -585,7 +585,6 @@ describe 'Analytics reports settings', feature_category: :value_stream_management do before do - stub_feature_flags(clickhouse_data_collection: true) allow(Gitlab::ClickHouse).to receive(:configured?).and_return(true) end @@ -613,18 +612,6 @@ end end end - - context 'when clickhouse_data_collection feature flag is disabled' do - before do - stub_feature_flags(clickhouse_data_collection: false) - end - - it 'does not render analytics section' do - visit general_admin_application_settings_path - - expect(page).not_to have_selector('#js-analytics-settings') - end - end end def current_settings diff --git a/ee/spec/lib/ee/gitlab/click_house_spec.rb b/ee/spec/lib/ee/gitlab/click_house_spec.rb index 890240f522cc3abfa524943855b47a5823ab4772..bde513e6caefad61eb9bfe3bf9504980b3522171 100644 --- a/ee/spec/lib/ee/gitlab/click_house_spec.rb +++ b/ee/spec/lib/ee/gitlab/click_house_spec.rb @@ -4,10 +4,6 @@ RSpec.describe Gitlab::ClickHouse, feature_category: :database do describe '.enabled_for_analytics?' do - before do - stub_feature_flags(clickhouse_data_collection: true) - end - context 'when ClickHouse is configured' do before do allow(described_class).to receive(:configured?).and_return(true) @@ -21,14 +17,6 @@ end it { is_expected.to be_enabled_for_analytics } - - context 'and clickhouse_data_collection feature flag is disabled ' do - before do - stub_feature_flags(clickhouse_data_collection: false) - end - - it { is_expected.not_to be_enabled_for_analytics } - end end end diff --git a/ee/spec/lib/gitlab/contribution_analytics/data_collector_spec.rb b/ee/spec/lib/gitlab/contribution_analytics/data_collector_spec.rb index d968c85bb09f7bdcd78b589eafbe9ca143c05be6..4dfe5c80616778836523cd6e488279ba1364bfda 100644 --- a/ee/spec/lib/gitlab/contribution_analytics/data_collector_spec.rb +++ b/ee/spec/lib/gitlab/contribution_analytics/data_collector_spec.rb @@ -63,7 +63,6 @@ end describe 'data retrieval' do - # clickhouse_data_collection is disabled by default, but enabled for this annotation context 'when ClickHouse is enabled for analytics', :click_house do before do allow(::Gitlab::ClickHouse).to receive(:enabled_for_analytics?).and_return(true) diff --git a/ee/spec/services/click_house/sync_strategies/event_sync_strategy_spec.rb b/ee/spec/services/click_house/sync_strategies/event_sync_strategy_spec.rb index 4721681c1fd4aa7baba31c4286c5bcfd14534569..5a53168a3ff0b6c92578572673a744ef0afd3aa2 100644 --- a/ee/spec/services/click_house/sync_strategies/event_sync_strategy_spec.rb +++ b/ee/spec/services/click_house/sync_strategies/event_sync_strategy_spec.rb @@ -116,7 +116,6 @@ context 'when the clickhouse database is configured the feature flag is enabled' do before do allow(Gitlab::ClickHouse).to receive(:configured?).and_return(true) - stub_feature_flags(event_sync_worker_for_click_house: true) end it 'returns true' do @@ -133,17 +132,6 @@ expect(strategy.send(:enabled?)).to be_falsey end end - - context 'when the feature flag is disabled' do - before do - allow(Gitlab::ClickHouse).to receive(:configured?).and_return(true) - stub_feature_flags(event_sync_worker_for_click_house: false) - end - - it 'returns false' do - expect(strategy.send(:enabled?)).to be_falsey - end - end end end end diff --git a/ee/spec/workers/click_house/event_authors_consistency_cron_worker_spec.rb b/ee/spec/workers/click_house/event_authors_consistency_cron_worker_spec.rb index 03c6a6c80470777a86a6fe401d2264b8f301fd69..029174944dfc19b5259066bbc3aecae80c51581b 100644 --- a/ee/spec/workers/click_house/event_authors_consistency_cron_worker_spec.rb +++ b/ee/spec/workers/click_house/event_authors_consistency_cron_worker_spec.rb @@ -32,17 +32,6 @@ end end - context 'when the event_sync_worker_for_click_house feature flag is off' do - it 'does nothing' do - allow(Gitlab::ClickHouse).to receive(:configured?).and_return(true) - stub_feature_flags(event_sync_worker_for_click_house: false) - - expect(worker).not_to receive(:log_extra_metadata_on_done) - - worker.perform - end - end - context 'when ClickHouse is available', :click_house do let_it_be(:connection) { ClickHouse::Connection.new(:main) } let_it_be_with_reload(:user1) { create(:user) } diff --git a/ee/spec/workers/click_house/event_paths_consistency_cron_worker_spec.rb b/ee/spec/workers/click_house/event_paths_consistency_cron_worker_spec.rb index c76c313a46ea28cc36397ea04b691bf1da60ff65..460519e81f7f380607a2eebba8c226909a15ef0d 100644 --- a/ee/spec/workers/click_house/event_paths_consistency_cron_worker_spec.rb +++ b/ee/spec/workers/click_house/event_paths_consistency_cron_worker_spec.rb @@ -32,20 +32,6 @@ end end - context 'when the event_sync_worker_for_click_house feature flag is off' do - before do - stub_feature_flags(event_sync_worker_for_click_house: false) - end - - it 'does nothing' do - allow(ClickHouse::Client).to receive(:database_configured?).and_return(true) - - expect(worker).not_to receive(:log_extra_metadata_on_done) - - worker.perform - end - end - context 'when ClickHouse is available', :click_house do let_it_be(:connection) { ClickHouse::Connection.new(:main) } let_it_be_with_reload(:namespace1) { create(:group) } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ae5c242fc19b7b42263c60fd7def22acd93faf22..9fabaa8568d9c72518d6457196fe5458fd3ff348 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -319,9 +319,6 @@ # Keep-around refs should only be turned off for specific projects/repositories. stub_feature_flags(disable_keep_around_refs: false) - # Postgres is the primary data source, and ClickHouse only when enabled in certain cases. - stub_feature_flags(clickhouse_data_collection: false) - # The Vue version of the merge request list app is missing a lot of information # disabling this for now whilst we work on it across multiple merge requests stub_feature_flags(vue_merge_request_list: false)