diff options
author | Fabio Pitino <fpitino@gitlab.com> | 2019-07-15 11:31:12 +0200 |
---|---|---|
committer | Fabio Pitino <fpitino@gitlab.com> | 2019-07-15 15:05:22 +0200 |
commit | c2396ce036af518e7f397274643767d41bdf3bbc (patch) | |
tree | c84eccaca700e766a40ddf582daf1bf829d7e01f /lib | |
parent | 2397f171a35485c422a48e5dba50fb7fee4c76b4 (diff) | |
download | gitlab-ce-remove-support-for-legacy-pipeline-triggers.tar.gz |
Do not import legacy triggers from project JSONremove-support-for-legacy-pipeline-triggers
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/import_export/relation_factory.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/gitlab/import_export/relation_factory.rb b/lib/gitlab/import_export/relation_factory.rb index d7f788ce521..1b545b1d049 100644 --- a/lib/gitlab/import_export/relation_factory.rb +++ b/lib/gitlab/import_export/relation_factory.rb @@ -78,6 +78,9 @@ module Gitlab def create return if unknown_service? + # Do not import legacy triggers + return if !Feature.enabled?(:use_legacy_pipeline_triggers, @project) && legacy_trigger? + setup_models generate_imported_object @@ -278,6 +281,10 @@ module Gitlab !Object.const_defined?(parsed_relation_hash['type']) end + def legacy_trigger? + @relation_name == 'Ci::Trigger' && @relation_hash['owner_id'].nil? + end + def find_or_create_object! return relation_class.find_or_create_by(project_id: @project.id) if @relation_name == :project_feature |