diff options
Diffstat (limited to 'db/fixtures/development')
6 files changed, 59 insertions, 27 deletions
diff --git a/db/fixtures/development/044_add_security_training_providers.rb b/db/fixtures/development/044_add_security_training_providers.rb new file mode 100644 index 00000000000..6fbd9f66127 --- /dev/null +++ b/db/fixtures/development/044_add_security_training_providers.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +Gitlab::Seeder.quiet do + ::Gitlab::DatabaseImporters::Security::TrainingProviders::Importer.upsert_providers +end diff --git a/db/fixtures/development/14_pipelines.rb b/db/fixtures/development/14_pipelines.rb index e8fa3ee2110..8f63ce3dbfe 100644 --- a/db/fixtures/development/14_pipelines.rb +++ b/db/fixtures/development/14_pipelines.rb @@ -60,7 +60,7 @@ class Gitlab::Seeder::Pipelines ::Ci::ProcessPipelineService.new(pipeline).execute end - ::Gitlab::Seeder::Ci::DailyBuildGroupReportResult.new(@project).seed if @project.last_pipeline + ::Gitlab::Seeders::Ci::DailyBuildGroupReportResult.new(@project).seed if @project.last_pipeline end private @@ -129,7 +129,7 @@ class Gitlab::Seeder::Pipelines end def setup_artifacts(build) - return unless build.stage == "build" + return unless build.stage_name == "build" artifacts_cache_file(artifacts_archive_path) do |file| build.job_artifacts.build(project: build.project, file_type: :archive, file_format: :zip, file: file) @@ -141,7 +141,7 @@ class Gitlab::Seeder::Pipelines end def setup_test_reports(build) - return unless build.stage == "test" && build.name == "rspec:osx" + return unless build.stage_name == "test" && build.name == "rspec:osx" if build.ref == build.project.default_branch artifacts_cache_file(test_reports_pass_path) do |file| diff --git a/db/fixtures/development/17_cycle_analytics.rb b/db/fixtures/development/17_cycle_analytics.rb index fa19775a571..8e9952e9ba1 100644 --- a/db/fixtures/development/17_cycle_analytics.rb +++ b/db/fixtures/development/17_cycle_analytics.rb @@ -154,6 +154,8 @@ class Gitlab::Seeder::CycleAnalytics @developers << user end + + AuthorizedProjectUpdate::ProjectRecalculateService.new(project).execute end def create_new_vsm_project diff --git a/db/fixtures/development/24_forks.rb b/db/fixtures/development/24_forks.rb index 536d9f9e2ba..a3db84ab1b7 100644 --- a/db/fixtures/development/24_forks.rb +++ b/db/fixtures/development/24_forks.rb @@ -24,6 +24,8 @@ Sidekiq::Testing.inline! do # the `after_commit` queue to ensure the job is run now. fork_project.send(:_run_after_commit_queue) fork_project.import_state.send(:_run_after_commit_queue) + # We should also force-run the project authorizations refresh job for the created project. + AuthorizedProjectUpdate::ProjectRecalculateService.new(fork_project).execute # Expire repository cache after import to ensure # valid_repo? call below returns a correct answer diff --git a/db/fixtures/development/33_triage_ops.rb b/db/fixtures/development/33_triage_ops.rb index b2dd3861169..14832ee4af9 100644 --- a/db/fixtures/development/33_triage_ops.rb +++ b/db/fixtures/development/33_triage_ops.rb @@ -7,6 +7,42 @@ class Gitlab::Seeder::TriageOps WEBHOOK_URL = 'http://0.0.0.0:$PORT$' WEBHOOK_TOKEN = "triage-ops-webhook-token" + WORK_TYPE_LABELS = %w( + bug::availability + bug::mobile + bug::performance + bug::vulnerability + feature::addition + feature::consolidation + feature::enhancement + feature::removal + maintenance::dependency + maintenance::pipelines + maintenance::refactor + maintenance::test-gap + maintenance::usability + maintenance::workflow + type::bug + type::feature + type::maintenance + ) + + WORKFLOW_LABELS = %w( + workflow::blocked + workflow::design + workflow::in dev + workflow::in review + workflow::planning breakdown + workflow::production + workflow::ready + workflow::ready for design + workflow::ready for development + workflow::ready for review + workflow::refinement + workflow::validation backlog + workflow::verification + ) + def seed! puts "Updating settings to allow web hooks to localhost" ApplicationSetting.current_without_cache.update!(allow_local_requests_from_web_hooks_and_services: true) @@ -33,8 +69,12 @@ class Gitlab::Seeder::TriageOps ensure_webhook_for('gitlab-org') puts "Ensuring work type labels" - ensure_work_type_labels_for('gitlab-com') - ensure_work_type_labels_for('gitlab-org') + ensure_labels_for(WORK_TYPE_LABELS, 'gitlab-com') + ensure_labels_for(WORK_TYPE_LABELS, 'gitlab-org') + + puts "Ensuring workflow type labels" + ensure_labels_for(WORKFLOW_LABELS, 'gitlab-com') + ensure_labels_for(WORKFLOW_LABELS, 'gitlab-org') end end end @@ -89,27 +129,7 @@ class Gitlab::Seeder::TriageOps puts "Hook with url '#{hook.url}' and token '#{hook.token}' for '#{group_path}' is present now." end - def ensure_work_type_labels_for(group_path) - label_titles = [ - 'bug::availability', - 'bug::mobile', - 'bug::performance', - 'bug::vulnerability', - 'feature::addition', - 'feature::consolidation', - 'feature::enhancement', - 'feature::removal', - 'maintenance::dependency', - 'maintenance::pipelines', - 'maintenance::refactor', - 'maintenance::test-gap', - 'maintenance::usability', - 'maintenance::workflow', - 'type::bug', - 'type::feature', - 'type::maintenance', - ] - + def ensure_labels_for(label_titles, group_path) group = Group.find_by_full_path(group_path) label_titles.each do |label_title| diff --git a/db/fixtures/development/98_gitlab_instance_administration_project.rb b/db/fixtures/development/98_gitlab_instance_administration_project.rb index 9f50ce6a7e4..3338f2bd2fc 100644 --- a/db/fixtures/development/98_gitlab_instance_administration_project.rb +++ b/db/fixtures/development/98_gitlab_instance_administration_project.rb @@ -1,7 +1,10 @@ # frozen_string_literal: true response = Sidekiq::Worker.skipping_transaction_check do - ::Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService.new.execute + result = ::Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService.new.execute + AuthorizedProjectUpdate::ProjectRecalculateService.new(result[:project]).execute + + result end if response[:status] == :success |