Commit ea45733e authored by Robert Speicher's avatar Robert Speicher

Merge branch 'kassio/dont-filter-relation-name-on-import-failures' into 'master'

Do not filter the relation name on import failures

See merge request gitlab-org/gitlab!48203
parents 3368e797 87e03ee8
......@@ -28,23 +28,26 @@ module Gitlab
end
def log_import_failure(source:, relation_key: nil, relation_index: nil, exception:, retry_count: 0)
extra = {
source: source,
relation_key: relation_key,
attributes = {
relation_index: relation_index,
retry_count: retry_count
source: source,
retry_count: retry_count,
importable_column_name => importable.id
}
extra[importable_column_name] = importable.id
Gitlab::ErrorTracking.track_exception(exception, extra)
attributes = {
exception_class: exception.class.to_s,
exception_message: exception.message.truncate(255),
correlation_id_value: Labkit::Correlation::CorrelationId.current_or_new_id
}.merge(extra)
ImportFailure.create(attributes)
Gitlab::ErrorTracking.track_exception(
exception,
attributes.merge(relation_name: relation_key)
)
ImportFailure.create(
attributes.merge(
exception_class: exception.class.to_s,
exception_message: exception.message.truncate(255),
correlation_id_value: Labkit::Correlation::CorrelationId.current_or_new_id,
relation_key: relation_key
)
)
end
private
......
......@@ -3,10 +3,10 @@
RSpec.shared_examples 'log import failure' do |importable_column|
it 'tracks error' do
extra = {
source: action,
relation_key: relation_key,
relation_index: relation_index,
retry_count: retry_count
source: action,
relation_name: relation_key,
relation_index: relation_index,
retry_count: retry_count
}
extra[importable_column] = importable.id
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment