Commit b4ce0f30 authored by Stan Hu's avatar Stan Hu

Merge branch 'craigf/fix-logging-schema-inconsistency' into 'master'

Fix a log schema inconsistency

Closes gitlab-com/gl-infra/infrastructure#8931

See merge request gitlab-org/gitlab!25419
parents c626c6a5 557c3a59
......@@ -229,7 +229,15 @@ class JiraService < IssueTrackerService
jira_issue_transition_id.scan(Gitlab::Regex.jira_transition_id_regex).each do |transition_id|
issue.transitions.build.save!(transition: { id: transition_id })
rescue => error
log_error("Issue transition failed", error: error.message, client_url: client_url)
log_error(
"Issue transition failed",
error: {
exception_class: error.class.name,
exception_message: error.message,
exception_backtrace: Gitlab::BacktraceCleaner.clean_backtrace(error.backtrace)
},
client_url: client_url
)
return false
end
end
......@@ -354,7 +362,7 @@ class JiraService < IssueTrackerService
error: {
exception_class: error.class.name,
exception_message: error.message,
exception_backtrace: error.backtrace.join("\n")
exception_backtrace: Gitlab::BacktraceCleaner.clean_backtrace(error.backtrace)
}
)
nil
......
......@@ -489,7 +489,14 @@ describe JiraService do
@jira_service.close_issue(resource, ExternalIssue.new('JIRA-123', project))
expect(@jira_service).to have_received(:log_error).with("Issue transition failed", error: "Bad Request", client_url: "http://jira.example.com")
expect(@jira_service).to have_received(:log_error).with(
"Issue transition failed",
error: hash_including(
exception_class: 'StandardError',
exception_message: "Bad Request"
),
client_url: "http://jira.example.com"
)
end
it 'calls the api with jira_issue_transition_id' do
......
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