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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
7f7e93a3
Commit
7f7e93a3
authored
Jul 26, 2017
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove log statements from workers
parent
f1ccecc9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
30 deletions
+3
-30
app/workers/create_gpg_signature_worker.rb
app/workers/create_gpg_signature_worker.rb
+2
-6
app/workers/invalid_gpg_signature_update_worker.rb
app/workers/invalid_gpg_signature_update_worker.rb
+1
-3
spec/workers/create_gpg_signature_worker_spec.rb
spec/workers/create_gpg_signature_worker_spec.rb
+0
-14
spec/workers/invalid_gpg_signature_update_worker_spec.rb
spec/workers/invalid_gpg_signature_update_worker_spec.rb
+0
-7
No files found.
app/workers/create_gpg_signature_worker.rb
View file @
7f7e93a3
...
@@ -5,15 +5,11 @@ class CreateGpgSignatureWorker
...
@@ -5,15 +5,11 @@ class CreateGpgSignatureWorker
def
perform
(
commit_sha
,
project_id
)
def
perform
(
commit_sha
,
project_id
)
project
=
Project
.
find_by
(
id:
project_id
)
project
=
Project
.
find_by
(
id:
project_id
)
unless
project
return
unless
project
return
Rails
.
logger
.
error
(
"CreateGpgSignatureWorker: couldn't find project with ID=
#{
project_id
}
, skipping job"
)
end
commit
=
project
.
commit
(
commit_sha
)
commit
=
project
.
commit
(
commit_sha
)
unless
commit
return
unless
commit
return
Rails
.
logger
.
error
(
"CreateGpgSignatureWorker: couldn't find commit with commit_sha=
#{
commit_sha
}
, skipping job"
)
end
commit
.
signature
commit
.
signature
end
end
...
...
app/workers/invalid_gpg_signature_update_worker.rb
View file @
7f7e93a3
...
@@ -5,9 +5,7 @@ class InvalidGpgSignatureUpdateWorker
...
@@ -5,9 +5,7 @@ class InvalidGpgSignatureUpdateWorker
def
perform
(
gpg_key_id
)
def
perform
(
gpg_key_id
)
gpg_key
=
GpgKey
.
find_by
(
id:
gpg_key_id
)
gpg_key
=
GpgKey
.
find_by
(
id:
gpg_key_id
)
unless
gpg_key
return
unless
gpg_key
return
Rails
.
logger
.
error
(
"InvalidGpgSignatureUpdateWorker: couldn't find gpg_key with ID=
#{
gpg_key_id
}
, skipping job"
)
end
Gitlab
::
Gpg
::
InvalidGpgSignatureUpdater
.
new
(
gpg_key
).
run
Gitlab
::
Gpg
::
InvalidGpgSignatureUpdater
.
new
(
gpg_key
).
run
end
end
...
...
spec/workers/create_gpg_signature_worker_spec.rb
View file @
7f7e93a3
...
@@ -20,13 +20,6 @@ describe CreateGpgSignatureWorker do
...
@@ -20,13 +20,6 @@ describe CreateGpgSignatureWorker do
let
(
:nonexisting_commit_sha
)
{
'bogus'
}
let
(
:nonexisting_commit_sha
)
{
'bogus'
}
let
(
:project
)
{
create
:project
}
let
(
:project
)
{
create
:project
}
it
'logs CreateGpgSignatureWorker process skipping'
do
expect
(
Rails
.
logger
).
to
receive
(
:error
)
.
with
(
"CreateGpgSignatureWorker: couldn't find commit with commit_sha=bogus, skipping job"
)
described_class
.
new
.
perform
(
nonexisting_commit_sha
,
project
.
id
)
end
it
'does not raise errors'
do
it
'does not raise errors'
do
expect
{
described_class
.
new
.
perform
(
nonexisting_commit_sha
,
project
.
id
)
}.
not_to
raise_error
expect
{
described_class
.
new
.
perform
(
nonexisting_commit_sha
,
project
.
id
)
}.
not_to
raise_error
end
end
...
@@ -41,13 +34,6 @@ describe CreateGpgSignatureWorker do
...
@@ -41,13 +34,6 @@ describe CreateGpgSignatureWorker do
context
'when Project is not found'
do
context
'when Project is not found'
do
let
(
:nonexisting_project_id
)
{
-
1
}
let
(
:nonexisting_project_id
)
{
-
1
}
it
'logs CreateGpgSignatureWorker process skipping'
do
expect
(
Rails
.
logger
).
to
receive
(
:error
)
.
with
(
"CreateGpgSignatureWorker: couldn't find project with ID=-1, skipping job"
)
described_class
.
new
.
perform
(
anything
,
nonexisting_project_id
)
end
it
'does not raise errors'
do
it
'does not raise errors'
do
expect
{
described_class
.
new
.
perform
(
anything
,
nonexisting_project_id
)
}.
not_to
raise_error
expect
{
described_class
.
new
.
perform
(
anything
,
nonexisting_project_id
)
}.
not_to
raise_error
end
end
...
...
spec/workers/invalid_gpg_signature_update_worker_spec.rb
View file @
7f7e93a3
...
@@ -16,13 +16,6 @@ describe InvalidGpgSignatureUpdateWorker do
...
@@ -16,13 +16,6 @@ describe InvalidGpgSignatureUpdateWorker do
context
'when GpgKey is not found'
do
context
'when GpgKey is not found'
do
let
(
:nonexisting_gpg_key_id
)
{
-
1
}
let
(
:nonexisting_gpg_key_id
)
{
-
1
}
it
'logs InvalidGpgSignatureUpdateWorker process skipping'
do
expect
(
Rails
.
logger
).
to
receive
(
:error
)
.
with
(
"InvalidGpgSignatureUpdateWorker: couldn't find gpg_key with ID=-1, skipping job"
)
described_class
.
new
.
perform
(
nonexisting_gpg_key_id
)
end
it
'does not raise errors'
do
it
'does not raise errors'
do
expect
{
described_class
.
new
.
perform
(
nonexisting_gpg_key_id
)
}.
not_to
raise_error
expect
{
described_class
.
new
.
perform
(
nonexisting_gpg_key_id
)
}.
not_to
raise_error
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