diff options
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 4892c5310ec..7e006e734c5 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -868,6 +868,8 @@ class Project < ApplicationRecord elsif gitlab_project_import? # Do not retry on Import/Export until https://gitlab.com/gitlab-org/gitlab-foss/issues/26189 is solved. RepositoryImportWorker.set(retry: false).perform_async(self.id) + elsif jira_import? + Gitlab::JiraImport::Stage::StartImportWorker.perform_async(self.id) else RepositoryImportWorker.perform_async(self.id) end @@ -900,7 +902,7 @@ class Project < ApplicationRecord # This method is overridden in EE::Project model def remove_import_data - import_data&.destroy + import_data&.destroy unless jira_import? end def ci_config_path=(value) @@ -947,7 +949,7 @@ class Project < ApplicationRecord end def import? - external_import? || forked? || gitlab_project_import? || bare_repository_import? + external_import? || forked? || gitlab_project_import? || jira_import? || bare_repository_import? end def external_import? @@ -962,6 +964,14 @@ class Project < ApplicationRecord import_type == 'bare_repository' end + def jira_import? + import_type == 'jira' && Feature.enabled?(:jira_issue_import, self) + end + + def jira_force_import? + jira_import? && import_data&.becomes(JiraImportData)&.force_import? + end + def gitlab_project_import? import_type == 'gitlab_project' end |