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
4917fa3f
Commit
4917fa3f
authored
Sep 08, 2020
by
Rajendra Kadam
Committed by
Peter Leitzen
Sep 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use applogger in ee/app/helpers, models and services
parent
c78115d4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
9 deletions
+12
-9
changelogs/unreleased/app-logger-3.yml
changelogs/unreleased/app-logger-3.yml
+5
-0
ee/app/helpers/ee/kerberos_spnego_helper.rb
ee/app/helpers/ee/kerberos_spnego_helper.rb
+1
-1
ee/app/models/geo_node.rb
ee/app/models/geo_node.rb
+1
-1
ee/app/services/fetch_subscription_plans_service.rb
ee/app/services/fetch_subscription_plans_service.rb
+1
-1
ee/app/workers/ldap_sync_worker.rb
ee/app/workers/ldap_sync_worker.rb
+2
-4
ee/app/workers/pseudonymizer_worker.rb
ee/app/workers/pseudonymizer_worker.rb
+1
-1
ee/spec/services/fetch_subscription_plans_service_spec.rb
ee/spec/services/fetch_subscription_plans_service_spec.rb
+1
-1
No files found.
changelogs/unreleased/app-logger-3.yml
0 → 100644
View file @
4917fa3f
---
title
:
Use applogger in ee/app/models, helpers and workers
merge_request
:
41048
author
:
Rajendra Kadam
type
:
other
ee/app/helpers/ee/kerberos_spnego_helper.rb
View file @
4917fa3f
...
@@ -82,7 +82,7 @@ module EE
...
@@ -82,7 +82,7 @@ module EE
# Return user principal name if authentication succeeded
# Return user principal name if authentication succeeded
gss
.
display_name
gss
.
display_name
rescue
GSSAPI
::
GssApiError
=>
ex
rescue
GSSAPI
::
GssApiError
=>
ex
Rails
.
logger
.
error
"
#{
self
.
class
.
name
}
: failed to process Negotiate/Kerberos authentication:
#{
ex
.
message
}
"
# rubocop:disable Gitlab/RailsLogger
Gitlab
::
AppLogger
.
error
"
#{
self
.
class
.
name
}
: failed to process Negotiate/Kerberos authentication:
#{
ex
.
message
}
"
false
false
end
end
...
...
ee/app/models/geo_node.rb
View file @
4917fa3f
...
@@ -232,7 +232,7 @@ class GeoNode < ApplicationRecord
...
@@ -232,7 +232,7 @@ class GeoNode < ApplicationRecord
# be called in an initializer and we don't want other callbacks
# be called in an initializer and we don't want other callbacks
# to mess with uninitialized dependencies.
# to mess with uninitialized dependencies.
if
clone_url_prefix_changed?
if
clone_url_prefix_changed?
Rails
.
logger
.
info
"Geo: modified clone_url_prefix to
#{
clone_url_prefix
}
"
# rubocop:disable Gitlab/RailsLogger
Gitlab
::
AppLogger
.
info
"Geo: modified clone_url_prefix to
#{
clone_url_prefix
}
"
update_column
(
:clone_url_prefix
,
clone_url_prefix
)
update_column
(
:clone_url_prefix
,
clone_url_prefix
)
end
end
end
end
...
...
ee/app/services/fetch_subscription_plans_service.rb
View file @
4917fa3f
...
@@ -21,7 +21,7 @@ class FetchSubscriptionPlansService
...
@@ -21,7 +21,7 @@ class FetchSubscriptionPlansService
Gitlab
::
Json
.
parse
(
response
.
body
).
map
{
|
plan
|
Hashie
::
Mash
.
new
(
plan
)
}
Gitlab
::
Json
.
parse
(
response
.
body
).
map
{
|
plan
|
Hashie
::
Mash
.
new
(
plan
)
}
rescue
=>
e
rescue
=>
e
Rails
.
logger
.
info
"Unable to connect to GitLab Customers App
#{
e
}
"
# rubocop:disable Gitlab/RailsLogger
Gitlab
::
AppLogger
.
info
"Unable to connect to GitLab Customers App
#{
e
}
"
nil
nil
end
end
...
...
ee/app/workers/ldap_sync_worker.rb
View file @
4917fa3f
...
@@ -8,18 +8,16 @@ class LdapSyncWorker # rubocop:disable Scalability/IdempotentWorker
...
@@ -8,18 +8,16 @@ class LdapSyncWorker # rubocop:disable Scalability/IdempotentWorker
worker_has_external_dependencies!
worker_has_external_dependencies!
# rubocop: disable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
# rubocop: disable Gitlab/RailsLogger
def
perform
def
perform
return
unless
Gitlab
::
Auth
::
Ldap
::
Config
.
group_sync_enabled?
return
unless
Gitlab
::
Auth
::
Ldap
::
Config
.
group_sync_enabled?
Rails
.
l
ogger
.
info
"Performing daily LDAP sync task."
Gitlab
::
AppL
ogger
.
info
"Performing daily LDAP sync task."
User
.
ldap
.
find_each
(
batch_size:
100
).
each
do
|
ldap_user
|
User
.
ldap
.
find_each
(
batch_size:
100
).
each
do
|
ldap_user
|
Rails
.
l
ogger
.
debug
"Syncing user
#{
ldap_user
.
username
}
,
#{
ldap_user
.
email
}
"
Gitlab
::
AppL
ogger
.
debug
"Syncing user
#{
ldap_user
.
username
}
,
#{
ldap_user
.
email
}
"
# Use the 'update_ldap_group_links_synchronously' option to avoid creating a ton
# Use the 'update_ldap_group_links_synchronously' option to avoid creating a ton
# of new Sidekiq jobs all at once.
# of new Sidekiq jobs all at once.
Gitlab
::
Auth
::
Ldap
::
Access
.
allowed?
(
ldap_user
,
update_ldap_group_links_synchronously:
true
)
Gitlab
::
Auth
::
Ldap
::
Access
.
allowed?
(
ldap_user
,
update_ldap_group_links_synchronously:
true
)
end
end
end
end
# rubocop: enable CodeReuse/ActiveRecord
# rubocop: enable CodeReuse/ActiveRecord
# rubocop: enable Gitlab/RailsLogger
end
end
ee/app/workers/pseudonymizer_worker.rb
View file @
4917fa3f
...
@@ -21,7 +21,7 @@ class PseudonymizerWorker # rubocop:disable Scalability/IdempotentWorker
...
@@ -21,7 +21,7 @@ class PseudonymizerWorker # rubocop:disable Scalability/IdempotentWorker
uploader
=
Pseudonymizer
::
Uploader
.
new
(
options
,
progress_output:
File
.
open
(
File
::
NULL
,
"w"
))
uploader
=
Pseudonymizer
::
Uploader
.
new
(
options
,
progress_output:
File
.
open
(
File
::
NULL
,
"w"
))
unless
uploader
.
available?
unless
uploader
.
available?
Rails
.
logger
.
error
(
"The pseudonymizer object storage must be configured."
)
# rubocop:disable Gitlab/RailsLogger
Gitlab
::
AppLogger
.
error
(
"The pseudonymizer object storage must be configured."
)
return
return
end
end
...
...
ee/spec/services/fetch_subscription_plans_service_spec.rb
View file @
4917fa3f
...
@@ -26,7 +26,7 @@ RSpec.describe FetchSubscriptionPlansService do
...
@@ -26,7 +26,7 @@ RSpec.describe FetchSubscriptionPlansService do
end
end
it
'logs failure'
do
it
'logs failure'
do
expect
(
Rails
).
to
receive_message_chain
(
:logger
,
:info
).
with
(
'Unable to connect to GitLab Customers App Error message'
)
expect
(
Gitlab
::
AppLogger
).
to
receive
(
:info
).
with
(
'Unable to connect to GitLab Customers App Error message'
)
subject
subject
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