Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3d26c7f6
Commit
3d26c7f6
authored
Oct 20, 2020
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tolerate logging with a nil project
parent
76f4a6fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
app/models/concerns/project_services_loggable.rb
app/models/concerns/project_services_loggable.rb
+2
-2
changelogs/unreleased/247870-nomethoderror-saving-jira-integration-with-invalid-credentials.yml
...rror-saving-jira-integration-with-invalid-credentials.yml
+5
-0
spec/models/service_spec.rb
spec/models/service_spec.rb
+19
-0
No files found.
app/models/concerns/project_services_loggable.rb
View file @
3d26c7f6
...
@@ -16,8 +16,8 @@ module ProjectServicesLoggable
...
@@ -16,8 +16,8 @@ module ProjectServicesLoggable
def
build_message
(
message
,
params
=
{})
def
build_message
(
message
,
params
=
{})
{
{
service_class:
self
.
class
.
name
,
service_class:
self
.
class
.
name
,
project_id:
project
.
id
,
project_id:
project
&
.
id
,
project_path:
project
.
full_path
,
project_path:
project
&
.
full_path
,
message:
message
message:
message
}.
merge
(
params
)
}.
merge
(
params
)
end
end
...
...
changelogs/unreleased/247870-nomethoderror-saving-jira-integration-with-invalid-credentials.yml
0 → 100644
View file @
3d26c7f6
---
title
:
Fix exception when saving Jira integration info for an instance
merge_request
:
45718
author
:
type
:
fixed
spec/models/service_spec.rb
View file @
3d26c7f6
...
@@ -843,5 +843,24 @@ RSpec.describe Service do
...
@@ -843,5 +843,24 @@ RSpec.describe Service do
service
.
log_error
(
test_message
,
additional_argument:
'some argument'
)
service
.
log_error
(
test_message
,
additional_argument:
'some argument'
)
end
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
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment