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
cac68196
Commit
cac68196
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 repository model
parent
0a066d83
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
app/models/repository.rb
app/models/repository.rb
+2
-4
changelogs/unreleased/rails-logger-cop-4.yml
changelogs/unreleased/rails-logger-cop-4.yml
+5
-0
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+1
-1
No files found.
app/models/repository.rb
View file @
cac68196
...
...
@@ -950,7 +950,6 @@ class Repository
async_remove_remote
(
remote_name
)
if
tmp_remote_name
end
# rubocop:disable Gitlab/RailsLogger
def
async_remove_remote
(
remote_name
)
return
unless
remote_name
return
unless
project
...
...
@@ -958,14 +957,13 @@ class Repository
job_id
=
RepositoryRemoveRemoteWorker
.
perform_async
(
project
.
id
,
remote_name
)
if
job_id
Rails
.
l
ogger
.
info
(
"Remove remote job scheduled for
#{
project
.
id
}
with remote name:
#{
remote_name
}
job ID
#{
job_id
}
."
)
Gitlab
::
AppL
ogger
.
info
(
"Remove remote job scheduled for
#{
project
.
id
}
with remote name:
#{
remote_name
}
job ID
#{
job_id
}
."
)
else
Rails
.
l
ogger
.
info
(
"Remove remote job failed to create for
#{
project
.
id
}
with remote name
#{
remote_name
}
."
)
Gitlab
::
AppL
ogger
.
info
(
"Remove remote job failed to create for
#{
project
.
id
}
with remote name
#{
remote_name
}
."
)
end
job_id
end
# rubocop:enable Gitlab/RailsLogger
def
fetch_source_branch!
(
source_repository
,
source_branch
,
local_ref
)
raw_repository
.
fetch_source_branch!
(
source_repository
.
raw_repository
,
source_branch
,
local_ref
)
...
...
changelogs/unreleased/rails-logger-cop-4.yml
0 → 100644
View file @
cac68196
---
title
:
Use applogger in repository model
merge_request
:
32185
author
:
Rajendra Kadam
type
:
fixed
spec/models/repository_spec.rb
View file @
cac68196
...
...
@@ -974,7 +974,7 @@ describe Repository do
end
it
'returns nil'
do
expect
(
Rails
.
l
ogger
).
to
receive
(
:info
).
with
(
"Remove remote job failed to create for
#{
project
.
id
}
with remote name joe."
)
expect
(
Gitlab
::
AppL
ogger
).
to
receive
(
:info
).
with
(
"Remove remote job failed to create for
#{
project
.
id
}
with remote name joe."
)
expect
(
repository
.
async_remove_remote
(
'joe'
)).
to
be_nil
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