diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2016-11-02 17:23:46 +0300 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2016-11-04 16:59:53 +0300 |
commit | 6a9fb20fe157fba158a79d645742239796239124 (patch) | |
tree | 72eb61086598f61da6f60b4a04ceaf910f2fe77b /lib/gitlab/github_import | |
parent | a3cc2f1e8dfcfb2f3e181fa570ed2ba245f9a069 (diff) |
Fix applying GitHub-imported labels when importing job is interrupted
Closes #24075
Diffstat (limited to 'lib/gitlab/github_import')
-rw-r--r-- | lib/gitlab/github_import/importer.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gitlab/github_import/importer.rb b/lib/gitlab/github_import/importer.rb index ecc28799737..bdabc71194d 100644 --- a/lib/gitlab/github_import/importer.rb +++ b/lib/gitlab/github_import/importer.rb @@ -59,6 +59,8 @@ module Gitlab end end end + + ensure_labels_are_cached end def import_milestones @@ -234,6 +236,14 @@ module Gitlab end end + def ensure_labels_are_cached + return unless @labels.empty? + + project.labels.select(:id, :title).find_each do |label| + @labels[label.title] = label.id + end + end + def fetch_resources(resource_type, *opts) return if imported?(resource_type) |