Commit f15d0f5d authored by Sean McGivern's avatar Sean McGivern

Merge branch '247870-nomethoderror-saving-jira-integration-with-invalid-credentials' into 'master'

NoMethodError - Saving Jira integration with invalid credentials

See merge request gitlab-org/gitlab!45718
parents 066d6d4a 3d26c7f6
......@@ -16,8 +16,8 @@ module ProjectServicesLoggable
def build_message(message, params = {})
{
service_class: self.class.name,
project_id: project.id,
project_path: project.full_path,
project_id: project&.id,
project_path: project&.full_path,
message: message
}.merge(params)
end
......
---
title: Fix exception when saving Jira integration info for an instance
merge_request: 45718
author:
type: fixed
......@@ -843,5 +843,24 @@ RSpec.describe Service do
service.log_error(test_message, additional_argument: 'some argument')
end
context 'when project is nil' do
let(:project) { nil }
let(:arguments) do
{
service_class: service.class.name,
project_path: nil,
project_id: nil,
message: test_message,
additional_argument: 'some argument'
}
end
it 'logs info messages using json logger' do
expect(Gitlab::JsonLogger).to receive(:info).with(arguments)
service.log_info(test_message, additional_argument: 'some argument')
end
end
end
end
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