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>2020-03-18 15:09:13 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-18 15:09:13 +0300
commit1363ca12f1f07c634647cf55c4c16b7401098673 (patch)
treed932caf09c8148322edb51ae954ed159ff7d00f8 /app/models/project.rb
parent6763d2787670bc03a36a8eb601703e88fc70dece (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb14
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