summaryrefslogtreecommitdiff
path: root/db/fixtures
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-17 11:33:21 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-17 11:33:21 +0000
commit7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch)
tree5bdc2229f5198d516781f8d24eace62fc7e589e9 /db/fixtures
parent185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff)
downloadgitlab-ce-7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0.tar.gz
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'db/fixtures')
-rw-r--r--db/fixtures/development/17_cycle_analytics.rb7
-rw-r--r--db/fixtures/development/98_gitlab_instance_administration_project.rb7
-rw-r--r--db/fixtures/production/998_gitlab_instance_administration_project.rb4
3 files changed, 12 insertions, 6 deletions
diff --git a/db/fixtures/development/17_cycle_analytics.rb b/db/fixtures/development/17_cycle_analytics.rb
index 8e9952e9ba1..4f6bfc5c82a 100644
--- a/db/fixtures/development/17_cycle_analytics.rb
+++ b/db/fixtures/development/17_cycle_analytics.rb
@@ -2,6 +2,7 @@
require './spec/support/sidekiq_middleware'
require './spec/support/helpers/test_env'
+require 'active_support/testing/time_helpers'
# Usage:
#
@@ -18,6 +19,8 @@ require './spec/support/helpers/test_env'
# VSA_SEED_PROJECT_ID=10 FILTER=cycle_analytics SEED_VSA=1 bundle exec rake db:seed_fu
class Gitlab::Seeder::CycleAnalytics
+ include ActiveSupport::Testing::TimeHelpers
+
attr_reader :project, :issues, :merge_requests, :developers
FLAG = 'SEED_VSA'
@@ -104,7 +107,7 @@ class Gitlab::Seeder::CycleAnalytics
def seed_test_stage!
merge_requests.each do |merge_request|
- pipeline = FactoryBot.create(:ci_pipeline, :success, project: project)
+ pipeline = FactoryBot.create(:ci_pipeline, :success, project: project, partition_id: Ci::Pipeline.current_partition_value)
build = FactoryBot.create(:ci_build, pipeline: pipeline, project: project, user: developers.sample)
# Required because seeds run in a transaction and these are now
@@ -133,7 +136,7 @@ class Gitlab::Seeder::CycleAnalytics
def create_issues!
@issue_count.times do
- Timecop.travel start_time + rand(5).days do
+ travel_to(start_time + rand(5).days) do
title = "#{FFaker::Product.brand}-#{suffix}"
@issues << Issue.create!(project: project, title: title, author: developers.sample)
end
diff --git a/db/fixtures/development/98_gitlab_instance_administration_project.rb b/db/fixtures/development/98_gitlab_instance_administration_project.rb
index 3338f2bd2fc..35bc3edbd70 100644
--- a/db/fixtures/development/98_gitlab_instance_administration_project.rb
+++ b/db/fixtures/development/98_gitlab_instance_administration_project.rb
@@ -2,14 +2,17 @@
response = Sidekiq::Worker.skipping_transaction_check do
result = ::Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService.new.execute
+
+ next result unless result[:status] == :success
+
AuthorizedProjectUpdate::ProjectRecalculateService.new(result[:project]).execute
result
end
if response[:status] == :success
- puts "Successfully created self monitoring project."
+ puts "Successfully created self-monitoring project."
else
- puts "Could not create self monitoring project due to error: '#{response[:message]}'"
+ puts "Could not create self-monitoring project due to error: '#{response[:message]}'"
puts "Check logs for more details."
end
diff --git a/db/fixtures/production/998_gitlab_instance_administration_project.rb b/db/fixtures/production/998_gitlab_instance_administration_project.rb
index 8be707ffb08..d935832aea6 100644
--- a/db/fixtures/production/998_gitlab_instance_administration_project.rb
+++ b/db/fixtures/production/998_gitlab_instance_administration_project.rb
@@ -3,8 +3,8 @@
response = ::Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService.new.execute
if response[:status] == :success
- puts "Successfully created self monitoring project."
+ puts "Successfully created self-monitoring project."
else
- puts "Could not create self monitoring project due to error: '#{response[:message]}'"
+ puts "Could not create self-monitoring project due to error: '#{response[:message]}'"
puts "Check logs for more details."
end