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
66654cac
Commit
66654cac
authored
Sep 06, 2020
by
Rajendra Kadam
Committed by
Peter Leitzen
Sep 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Applogger in lib/gitlab
parent
2881d5c4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
6 deletions
+11
-6
changelogs/unreleased/app-logger-17.yml
changelogs/unreleased/app-logger-17.yml
+5
-0
lib/gitlab/auth/ldap/config.rb
lib/gitlab/auth/ldap/config.rb
+2
-2
lib/gitlab/repository_cache_adapter.rb
lib/gitlab/repository_cache_adapter.rb
+1
-1
spec/lib/gitlab/auth/ldap/config_spec.rb
spec/lib/gitlab/auth/ldap/config_spec.rb
+2
-2
spec/lib/gitlab/repository_cache_adapter_spec.rb
spec/lib/gitlab/repository_cache_adapter_spec.rb
+1
-1
No files found.
changelogs/unreleased/app-logger-17.yml
0 → 100644
View file @
66654cac
---
title
:
Use GitLab AppLogger
merge_request
:
41261
author
:
Rajendra Kadam
type
:
other
lib/gitlab/auth/ldap/config.rb
View file @
66654cac
...
...
@@ -248,7 +248,7 @@ module Gitlab
begin
custom_options
[
:cert
]
=
OpenSSL
::
X509
::
Certificate
.
new
(
custom_options
[
:cert
])
rescue
OpenSSL
::
X509
::
CertificateError
=>
e
Rails
.
logger
.
error
"LDAP TLS Options 'cert' is invalid for provider
#{
provider
}
:
#{
e
.
message
}
"
# rubocop:disable Gitlab/RailsLogger
Gitlab
::
AppLogger
.
error
"LDAP TLS Options 'cert' is invalid for provider
#{
provider
}
:
#{
e
.
message
}
"
end
end
...
...
@@ -256,7 +256,7 @@ module Gitlab
begin
custom_options
[
:key
]
=
OpenSSL
::
PKey
.
read
(
custom_options
[
:key
])
rescue
OpenSSL
::
PKey
::
PKeyError
=>
e
Rails
.
logger
.
error
"LDAP TLS Options 'key' is invalid for provider
#{
provider
}
:
#{
e
.
message
}
"
# rubocop:disable Gitlab/RailsLogger
Gitlab
::
AppLogger
.
error
"LDAP TLS Options 'key' is invalid for provider
#{
provider
}
:
#{
e
.
message
}
"
end
end
...
...
lib/gitlab/repository_cache_adapter.rb
View file @
66654cac
...
...
@@ -218,7 +218,7 @@ module Gitlab
def
expire_method_caches
(
methods
)
methods
.
each
do
|
name
|
unless
cached_methods
.
include?
(
name
.
to_sym
)
Rails
.
logger
.
error
"Requested to expire non-existent method '
#{
name
}
' for Repository"
# rubocop:disable Gitlab/RailsLogger
Gitlab
::
AppLogger
.
error
"Requested to expire non-existent method '
#{
name
}
' for Repository"
next
end
...
...
spec/lib/gitlab/auth/ldap/config_spec.rb
View file @
66654cac
...
...
@@ -168,7 +168,7 @@ AtlErSqafbECNDSwS5BX8yDpu5yRBJ4xegO/rNlmb8ICRYkuJapD1xXicFOsmfUK
end
it
'logs an error when an invalid key or cert are configured'
do
allow
(
Rails
.
l
ogger
).
to
receive
(
:error
)
allow
(
Gitlab
::
AppL
ogger
).
to
receive
(
:error
)
stub_ldap_config
(
options:
{
'host'
=>
'ldap.example.com'
,
...
...
@@ -183,7 +183,7 @@ AtlErSqafbECNDSwS5BX8yDpu5yRBJ4xegO/rNlmb8ICRYkuJapD1xXicFOsmfUK
config
.
adapter_options
expect
(
Rails
.
l
ogger
).
to
have_received
(
:error
).
with
(
/LDAP TLS Options/
).
twice
expect
(
Gitlab
::
AppL
ogger
).
to
have_received
(
:error
).
with
(
/LDAP TLS Options/
).
twice
end
context
'when verify_certificates is enabled'
do
...
...
spec/lib/gitlab/repository_cache_adapter_spec.rb
View file @
66654cac
...
...
@@ -302,7 +302,7 @@ RSpec.describe Gitlab::RepositoryCacheAdapter do
it
'does not expire caches for non-existent methods'
do
expect
(
cache
).
not_to
receive
(
:expire
).
with
(
:nonexistent
)
expect
(
Rails
.
l
ogger
).
to
(
expect
(
Gitlab
::
AppL
ogger
).
to
(
receive
(
:error
).
with
(
"Requested to expire non-existent method 'nonexistent' for Repository"
))
repository
.
expire_method_caches
(
%i(nonexistent)
)
...
...
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