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
d979df91
Commit
d979df91
authored
Sep 06, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
d7484ba5
78174ece
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
1 deletion
+46
-1
app/services/git/base_hooks_service.rb
app/services/git/base_hooks_service.rb
+27
-1
changelogs/unreleased/sh-add-sidekiq-logging-for-bad-ci.yml
changelogs/unreleased/sh-add-sidekiq-logging-for-bad-ci.yml
+5
-0
spec/services/git/branch_push_service_spec.rb
spec/services/git/branch_push_service_spec.rb
+14
-0
No files found.
app/services/git/base_hooks_service.rb
View file @
d979df91
...
@@ -57,7 +57,9 @@ module Git
...
@@ -57,7 +57,9 @@ module Git
Ci
::
CreatePipelineService
Ci
::
CreatePipelineService
.
new
(
project
,
current_user
,
pipeline_params
)
.
new
(
project
,
current_user
,
pipeline_params
)
.
execute
(
:push
,
pipeline_options
)
.
execute!
(
:push
,
pipeline_options
)
rescue
Ci
::
CreatePipelineService
::
CreateError
=>
ex
log_pipeline_errors
(
ex
)
end
end
def
execute_project_hooks
def
execute_project_hooks
...
@@ -125,5 +127,29 @@ module Git
...
@@ -125,5 +127,29 @@ module Git
project
.
mark_stuck_remote_mirrors_as_failed!
project
.
mark_stuck_remote_mirrors_as_failed!
project
.
update_remote_mirrors
project
.
update_remote_mirrors
end
end
def
log_pipeline_errors
(
exception
)
data
=
{
class:
self
.
class
.
name
,
correlation_id:
Labkit
::
Correlation
::
CorrelationId
.
current_id
.
to_s
,
project_id:
project
.
id
,
project_path:
project
.
full_path
,
message:
"Error creating pipeline"
,
errors:
exception
.
to_s
,
pipeline_params:
pipeline_params
}
logger
.
warn
(
data
)
end
def
logger
if
Sidekiq
.
server?
Sidekiq
.
logger
else
# This service runs in Sidekiq, so this shouldn't ever be
# called, but this is included just in case.
Gitlab
::
ProjectServiceLogger
end
end
end
end
end
end
changelogs/unreleased/sh-add-sidekiq-logging-for-bad-ci.yml
0 → 100644
View file @
d979df91
---
title
:
Log errors for failed pipeline creation in PostReceive
merge_request
:
32633
author
:
type
:
other
spec/services/git/branch_push_service_spec.rb
View file @
d979df91
...
@@ -99,6 +99,20 @@ describe Git::BranchPushService, services: true do
...
@@ -99,6 +99,20 @@ describe Git::BranchPushService, services: true do
expect
(
pipeline
).
to
be_push
expect
(
pipeline
).
to
be_push
expect
(
Gitlab
::
Git
::
BRANCH_REF_PREFIX
+
pipeline
.
ref
).
to
eq
(
ref
)
expect
(
Gitlab
::
Git
::
BRANCH_REF_PREFIX
+
pipeline
.
ref
).
to
eq
(
ref
)
end
end
context
'when pipeline has errors'
do
before
do
config
=
YAML
.
dump
({
test:
{
script:
'ls'
,
only:
[
'feature'
]
}
})
stub_ci_pipeline_yaml_file
(
config
)
end
it
'reports an error'
do
allow
(
Sidekiq
).
to
receive
(
:server?
).
and_return
(
true
)
expect
(
Sidekiq
.
logger
).
to
receive
(
:warn
)
expect
{
subject
}.
not_to
change
{
Ci
::
Pipeline
.
count
}
end
end
end
end
describe
"Updates merge requests"
do
describe
"Updates merge requests"
do
...
...
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