diff --git a/.gitlab/ci/dev-fixtures.gitlab-ci.yml b/.gitlab/ci/dev-fixtures.gitlab-ci.yml index eed1bf9aa10543adf809f10151f3c0f6448adfec..711e5d27858d8ef78539213012d8866d3768439b 100644 --- a/.gitlab/ci/dev-fixtures.gitlab-ci.yml +++ b/.gitlab/ci/dev-fixtures.gitlab-ci.yml @@ -14,6 +14,7 @@ SEED_CUSTOMIZABLE_CYCLE_ANALYTICS: "true" SEED_CI_CD_ANALYTICS: "true" SEED_AI_USAGE_STATS: "true" + SEED_PIPELINE_METRICS: "true" VSA_ISSUE_COUNT: 1 DISABLE_WEBMOCK: "true" SIZE: 0 # number of external projects to fork, requires network connection diff --git a/ee/db/fixtures/development/98_pipeline_metrics.rb b/ee/db/fixtures/development/98_pipeline_metrics.rb index 5fc65e757632763630945f5a490b292bfa69d3c1..33247a098872de71e94288c45fc37c361c8b1544 100644 --- a/ee/db/fixtures/development/98_pipeline_metrics.rb +++ b/ee/db/fixtures/development/98_pipeline_metrics.rb @@ -57,34 +57,35 @@ def suffix def create_project_with_group Gitlab::ExclusiveLease.skipping_transaction_check do - Sidekiq::Testing.inline! do - group = Group.new( - name: "Pipeline metrics Group #{suffix}", - path: "p-metrics-group-#{suffix}", - description: FFaker::Lorem.sentence, - organization: Organizations::Organization.default_organization - ) - - group.save! - group.add_owner(user) - group.create_namespace_settings - - # Set group traversal ids inline to avoid - # authorization issues on next steps. - group.update!(traversal_ids: [group.id]) - - ::Namespaces::ProcessSyncEventsWorker.new.perform # Ensure NamespaceMirror is created - - FactoryBot.create( - :project, - :public, - :repository, - name: "Pipeline metrics Project #{suffix}", - path: "p-metrics-project-#{suffix}", - creator: user, - group: group - ).tap(&:create_repository) + group = Group.new( + name: "Pipeline metrics Group #{suffix}", + path: "p-metrics-group-#{suffix}", + description: FFaker::Lorem.sentence, + organization: Organizations::Organization.default_organization + ) + + group.save! + group.add_owner(user) + group.create_namespace_settings + + # Set group traversal ids inline to avoid + # authorization issues on next steps. + group.update!(traversal_ids: [group.id]) + + # Ensure NamespaceMirror is created + group.sync_events.each do |event| + ::Ci::NamespaceMirror.sync!(event) end + + FactoryBot.create( + :project, + :public, + :repository, + name: "Pipeline metrics Project #{suffix}", + path: "p-metrics-project-#{suffix}", + creator: user, + group: group + ).tap(&:create_repository) end end @@ -131,9 +132,10 @@ def seed_pipeline_analytics end Gitlab::Seeder.quiet do - feature_available = ::Gitlab::ClickHouse.globally_enabled_for_analytics? + # Environment variable used on CI to to allow requests to ClickHouse container + WebMock.allow_net_connect! if Rails.env.test? && ENV['DISABLE_WEBMOCK'] - unless feature_available + unless ::Gitlab::ClickHouse.configured? puts " WARNING: To use this seed file, you need to make sure that ClickHouse is configured and enabled with your GDK.