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-04-14 21:09:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-14 21:09:54 +0300
commitf697dc5e76dfc5894df006d53b2b7e751653cf05 (patch)
tree1387cd225039e611f3683f96b318bb17d4c422cb /lib/gitlab/jira_import
parent874ead9c3a50de4c4ca4551eaf5b7eb976d26b50 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/jira_import')
-rw-r--r--lib/gitlab/jira_import/labels_importer.rb17
1 files changed, 4 insertions, 13 deletions
diff --git a/lib/gitlab/jira_import/labels_importer.rb b/lib/gitlab/jira_import/labels_importer.rb
index 142a2da5be9..35c434e48a4 100644
--- a/lib/gitlab/jira_import/labels_importer.rb
+++ b/lib/gitlab/jira_import/labels_importer.rb
@@ -11,28 +11,19 @@ module Gitlab
end
def execute
- create_import_label(project)
+ cache_import_label(project)
import_jira_labels
end
private
- def create_import_label(project)
- label = Labels::CreateService.new(build_label_attrs(project)).execute(project: project)
- raise Projects::ImportService::Error, _('Failed to create import label for jira import.') unless label
+ def cache_import_label(project)
+ label = project.jira_imports.by_jira_project_key(jira_project_key).last.label
+ raise Projects::ImportService::Error, _('Failed to find import label for jira import.') unless label
JiraImport.cache_import_label_id(project.id, label.id)
end
- def build_label_attrs(project)
- import_start_time = project&.import_state&.last_update_started_at || Time.now
- title = "jira-import-#{import_start_time.strftime('%Y-%m-%d-%H-%M-%S')}"
- description = "Label for issues that were imported from jira on #{import_start_time.strftime('%Y-%m-%d %H:%M:%S')}"
- color = "#{Label.color_for(title)}"
-
- { title: title, description: description, color: color }
- end
-
def import_jira_labels
# todo: import jira labels, see https://gitlab.com/gitlab-org/gitlab/-/issues/212651
job_waiter