summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-04-12 07:12:30 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-04-12 07:12:30 +0000
commitd59f48987baceb25aa87dc6d87551f68af4bb1ed (patch)
treebbbc18a83496d2d701014b7cb3b0ec37557df26f
parenta62ae94d9c5940e87679b1ce8a0aee8b82b4d59e (diff)
parent3bc114a7c173ecf03fe5348bbf12e270dfe94a2b (diff)
downloadgitlab-ce-d59f48987baceb25aa87dc6d87551f68af4bb1ed.tar.gz
Merge branch 'bb_save_trace' into 'master'
[BB Importer] Save the error trace and the whole raw document See merge request !9604
-rw-r--r--changelogs/unreleased/bb_save_trace.yml5
-rw-r--r--lib/bitbucket/representation/base.rb6
-rw-r--r--lib/gitlab/bitbucket_import/importer.rb4
3 files changed, 9 insertions, 6 deletions
diff --git a/changelogs/unreleased/bb_save_trace.yml b/changelogs/unreleased/bb_save_trace.yml
new file mode 100644
index 00000000000..6ff31f4f111
--- /dev/null
+++ b/changelogs/unreleased/bb_save_trace.yml
@@ -0,0 +1,5 @@
+---
+title: "[BB Importer] Save the error trace and the whole raw document to debug problems
+ easier"
+merge_request:
+author:
diff --git a/lib/bitbucket/representation/base.rb b/lib/bitbucket/representation/base.rb
index 94adaacc9b5..800d5a075c6 100644
--- a/lib/bitbucket/representation/base.rb
+++ b/lib/bitbucket/representation/base.rb
@@ -1,6 +1,8 @@
module Bitbucket
module Representation
class Base
+ attr_reader :raw
+
def initialize(raw)
@raw = raw
end
@@ -8,10 +10,6 @@ module Bitbucket
def self.decorate(entries)
entries.map { |entry| new(entry)}
end
-
- private
-
- attr_reader :raw
end
end
end
diff --git a/lib/gitlab/bitbucket_import/importer.rb b/lib/gitlab/bitbucket_import/importer.rb
index f4efa20374a..5a6d9ae99a0 100644
--- a/lib/gitlab/bitbucket_import/importer.rb
+++ b/lib/gitlab/bitbucket_import/importer.rb
@@ -149,7 +149,7 @@ module Gitlab
description += @formatter.author_line(pull_request.author) unless find_user_id(pull_request.author)
description += pull_request.description
- merge_request = project.merge_requests.create(
+ merge_request = project.merge_requests.create!(
iid: pull_request.iid,
title: pull_request.title,
description: description,
@@ -168,7 +168,7 @@ module Gitlab
import_pull_request_comments(pull_request, merge_request) if merge_request.persisted?
rescue StandardError => e
- errors << { type: :pull_request, iid: pull_request.iid, errors: e.message }
+ errors << { type: :pull_request, iid: pull_request.iid, errors: e.message, trace: e.backtrace.join("\n"), raw_response: pull_request.raw }
end
end
end