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
ab0a7ea9
Commit
ab0a7ea9
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 project.rb
parent
9ed1e151
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
app/models/project.rb
app/models/project.rb
+5
-11
changelogs/unreleased/rails-logger-cop-2.yml
changelogs/unreleased/rails-logger-cop-2.yml
+5
-0
No files found.
app/models/project.rb
View file @
ab0a7ea9
...
...
@@ -925,17 +925,15 @@ class Project < ApplicationRecord
job_id
end
# rubocop:disable Gitlab/RailsLogger
def
log_import_activity
(
job_id
,
type: :import
)
job_type
=
type
.
to_s
.
capitalize
if
job_id
Rails
.
l
ogger
.
info
(
"
#{
job_type
}
job scheduled for
#{
full_path
}
with job ID
#{
job_id
}
."
)
Gitlab
::
AppL
ogger
.
info
(
"
#{
job_type
}
job scheduled for
#{
full_path
}
with job ID
#{
job_id
}
."
)
else
Rails
.
l
ogger
.
error
(
"
#{
job_type
}
job failed to create for
#{
full_path
}
."
)
Gitlab
::
AppL
ogger
.
error
(
"
#{
job_type
}
job failed to create for
#{
full_path
}
."
)
end
end
# rubocop:enable Gitlab/RailsLogger
def
reset_cache_and_import_attrs
run_after_commit
do
...
...
@@ -1776,17 +1774,15 @@ class Project < ApplicationRecord
ensure_pages_metadatum
.
update!
(
deployed:
false
)
end
# rubocop:disable Gitlab/RailsLogger
def
write_repository_config
(
gl_full_path:
full_path
)
# We'd need to keep track of project full path otherwise directory tree
# created with hashed storage enabled cannot be usefully imported using
# the import rake task.
repository
.
raw_repository
.
write_config
(
full_path:
gl_full_path
)
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
=>
e
Rails
.
l
ogger
.
error
(
"Error writing to .git/config for project
#{
full_path
}
(
#{
id
}
):
#{
e
.
message
}
."
)
Gitlab
::
AppL
ogger
.
error
(
"Error writing to .git/config for project
#{
full_path
}
(
#{
id
}
):
#{
e
.
message
}
."
)
nil
end
# rubocop:enable Gitlab/RailsLogger
def
after_import
repository
.
expire_content_cache
...
...
@@ -1829,17 +1825,15 @@ class Project < ApplicationRecord
@pipeline_status
||=
Gitlab
::
Cache
::
Ci
::
ProjectPipelineStatus
.
load_for_project
(
self
)
end
# rubocop:disable Gitlab/RailsLogger
def
add_export_job
(
current_user
:,
after_export_strategy:
nil
,
params:
{})
job_id
=
ProjectExportWorker
.
perform_async
(
current_user
.
id
,
self
.
id
,
after_export_strategy
,
params
)
if
job_id
Rails
.
l
ogger
.
info
"Export job started for project ID
#{
self
.
id
}
with job ID
#{
job_id
}
"
Gitlab
::
AppL
ogger
.
info
"Export job started for project ID
#{
self
.
id
}
with job ID
#{
job_id
}
"
else
Rails
.
l
ogger
.
error
"Export job failed to start for project ID
#{
self
.
id
}
"
Gitlab
::
AppL
ogger
.
error
"Export job failed to start for project ID
#{
self
.
id
}
"
end
end
# rubocop:enable Gitlab/RailsLogger
def
import_export_shared
@import_export_shared
||=
Gitlab
::
ImportExport
::
Shared
.
new
(
self
)
...
...
changelogs/unreleased/rails-logger-cop-2.yml
0 → 100644
View file @
ab0a7ea9
---
title
:
Use applogger in project.rb
merge_request
:
32183
author
:
Rajendra Kadam
type
:
fixed
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