Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-09-28 01:36:15 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-09-28 01:36:15 +0300
commit7bcb9f25dad089706e8aaef5c87cb42ab804b827 (patch)
treeb30bc0adbaa9d1103dad002b5387d13983c0d422 /lib/gitlab/import_export/project/relation_factory.rb
parent5b91f2a1e51c291fb84ea60766791684fa982f22 (diff)
Add latest changes from gitlab-org/security/gitlab@16-4-stable-ee
Diffstat (limited to 'lib/gitlab/import_export/project/relation_factory.rb')
-rw-r--r--lib/gitlab/import_export/project/relation_factory.rb35
1 files changed, 27 insertions, 8 deletions
diff --git a/lib/gitlab/import_export/project/relation_factory.rb b/lib/gitlab/import_export/project/relation_factory.rb
index 840621a94a2..78d0735bbb5 100644
--- a/lib/gitlab/import_export/project/relation_factory.rb
+++ b/lib/gitlab/import_export/project/relation_factory.rb
@@ -98,6 +98,7 @@ module Gitlab
when :'ProtectedBranch::PushAccessLevel' then setup_protected_branch_access_level
when :ApprovalProjectRulesProtectedBranch then setup_merge_approval_protected_branch
when :releases then setup_release
+ when :merge_requests, :MergeRequest, :merge_request then setup_merge_request
end
update_project_references
@@ -148,22 +149,30 @@ module Gitlab
end
def setup_pipeline
+ @relation_hash['status'] = transform_status(@relation_hash['status'])
+
@relation_hash.fetch('stages', []).each do |stage|
+ stage.status = transform_status(stage.status)
+
# old export files have statuses
- stage.statuses.each do |status|
- status.pipeline = imported_object
+ stage.statuses.each do |job|
+ job.status = transform_status(job.status)
+ job.pipeline = imported_object
end
- stage.builds.each do |status|
- status.pipeline = imported_object
+ stage.builds.each do |job|
+ job.status = transform_status(job.status)
+ job.pipeline = imported_object
end
- stage.bridges.each do |status|
- status.pipeline = imported_object
+ stage.bridges.each do |job|
+ job.status = transform_status(job.status)
+ job.pipeline = imported_object
end
- stage.generic_commit_statuses.each do |status|
- status.pipeline = imported_object
+ stage.generic_commit_statuses.each do |job|
+ job.status = transform_status(job.status)
+ job.pipeline = imported_object
end
end
end
@@ -187,6 +196,10 @@ module Gitlab
@relation_hash['active'] = false
end
+ def setup_merge_request
+ @relation_hash['merge_when_pipeline_succeeds'] = false
+ end
+
def setup_protected_branch_access_level
return if root_group_owner?
return if @relation_hash['access_level'] == Gitlab::Access::NO_ACCESS
@@ -226,6 +239,12 @@ module Gitlab
@relation_name == :'Ci::Trigger' && @relation_hash['owner_id'].nil?
end
+ def transform_status(status)
+ return 'canceled' if ::Ci::HasStatus::COMPLETED_STATUSES.exclude?(status)
+
+ status
+ end
+
def preload_keys(object, references, value)
return object unless value