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
96598878
Commit
96598878
authored
May 24, 2020
by
Rajendra Kadam
Committed by
Peter Leitzen
May 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use appLogger in build and ssh host key
parent
0a066d83
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
4 deletions
+9
-4
app/models/ci/build.rb
app/models/ci/build.rb
+1
-1
app/models/ssh_host_key.rb
app/models/ssh_host_key.rb
+1
-1
changelogs/unreleased/rails-logger-cop-5.yml
changelogs/unreleased/rails-logger-cop-5.yml
+5
-0
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+2
-2
No files found.
app/models/ci/build.rb
View file @
96598878
...
@@ -352,7 +352,7 @@ module Ci
...
@@ -352,7 +352,7 @@ module Ci
begin
begin
Ci
::
Build
.
retry
(
build
,
build
.
user
)
Ci
::
Build
.
retry
(
build
,
build
.
user
)
rescue
Gitlab
::
Access
::
AccessDeniedError
=>
ex
rescue
Gitlab
::
Access
::
AccessDeniedError
=>
ex
Rails
.
logger
.
error
"Unable to auto-retry job
#{
build
.
id
}
:
#{
ex
}
"
# rubocop:disable Gitlab/RailsLogger
Gitlab
::
AppLogger
.
error
"Unable to auto-retry job
#{
build
.
id
}
:
#{
ex
}
"
end
end
end
end
end
end
...
...
app/models/ssh_host_key.rb
View file @
96598878
...
@@ -107,7 +107,7 @@ class SshHostKey
...
@@ -107,7 +107,7 @@ class SshHostKey
if
status
.
success?
&&
!
errors
.
present?
if
status
.
success?
&&
!
errors
.
present?
{
known_hosts:
known_hosts
}
{
known_hosts:
known_hosts
}
else
else
Rails
.
logger
.
debug
(
"Failed to detect SSH host keys for
#{
id
}
:
#{
errors
}
"
)
# rubocop:disable Gitlab/RailsLogger
Gitlab
::
AppLogger
.
debug
(
"Failed to detect SSH host keys for
#{
id
}
:
#{
errors
}
"
)
{
error:
'Failed to detect SSH host keys'
}
{
error:
'Failed to detect SSH host keys'
}
end
end
...
...
changelogs/unreleased/rails-logger-cop-5.yml
0 → 100644
View file @
96598878
---
title
:
Use applogger in build and ssh host key
merge_request
:
32187
author
:
Rajendra Kadam
type
:
fixed
spec/models/ci/build_spec.rb
View file @
96598878
...
@@ -3612,7 +3612,7 @@ describe Ci::Build do
...
@@ -3612,7 +3612,7 @@ describe Ci::Build do
.
to
receive
(
:execute
)
.
to
receive
(
:execute
)
.
with
(
subject
)
.
with
(
subject
)
.
and_raise
(
Gitlab
::
Access
::
AccessDeniedError
)
.
and_raise
(
Gitlab
::
Access
::
AccessDeniedError
)
allow
(
Rails
.
l
ogger
).
to
receive
(
:error
)
allow
(
Gitlab
::
AppL
ogger
).
to
receive
(
:error
)
end
end
it
'handles raised exception'
do
it
'handles raised exception'
do
...
@@ -3622,7 +3622,7 @@ describe Ci::Build do
...
@@ -3622,7 +3622,7 @@ describe Ci::Build do
it
'logs the error'
do
it
'logs the error'
do
subject
.
drop!
subject
.
drop!
expect
(
Rails
.
l
ogger
)
expect
(
Gitlab
::
AppL
ogger
)
.
to
have_received
(
:error
)
.
to
have_received
(
:error
)
.
with
(
a_string_matching
(
"Unable to auto-retry job
#{
subject
.
id
}
"
))
.
with
(
a_string_matching
(
"Unable to auto-retry job
#{
subject
.
id
}
"
))
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