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
2b155818
Commit
2b155818
authored
Apr 15, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
35d4810f
8ede9d18
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
8 deletions
+26
-8
.gitlab-ci.yml
.gitlab-ci.yml
+6
-4
app/services/ci/prepare_build_service.rb
app/services/ci/prepare_build_service.rb
+5
-3
spec/services/ci/prepare_build_service_spec.rb
spec/services/ci/prepare_build_service_spec.rb
+15
-1
No files found.
.gitlab-ci.yml
View file @
2b155818
...
...
@@ -83,13 +83,15 @@ stages:
.use-pg
:
&use-pg
services
:
-
postgres:9.6
-
redis:alpine
-
name
:
postgres:9.6
command
:
[
"
postgres"
,
"
-c"
,
"
fsync=off"
,
"
-c"
,
"
synchronous_commit=off"
,
"
-c"
,
"
full_page_writes=off"
]
-
name
:
redis:alpine
.use-pg-10
:
&use-pg-10
services
:
-
postgres:10.0
-
redis:alpine
-
name
:
postgres:10.0
command
:
[
"
postgres"
,
"
-c"
,
"
fsync=off"
,
"
-c"
,
"
synchronous_commit=off"
,
"
-c"
,
"
full_page_writes=off"
]
-
name
:
redis:alpine
.use-mysql
:
&use-mysql
services
:
...
...
app/services/ci/prepare_build_service.rb
View file @
2b155818
...
...
@@ -11,9 +11,11 @@ module Ci
def
execute
prerequisites
.
each
(
&
:complete!
)
unless
build
.
enqueue
build
.
drop!
(
:unmet_prerequisites
)
end
build
.
enqueue!
rescue
=>
e
Gitlab
::
Sentry
.
track_acceptable_exception
(
e
,
extra:
{
build_id:
build
.
id
})
build
.
drop
(
:unmet_prerequisites
)
end
private
...
...
spec/services/ci/prepare_build_service_spec.rb
View file @
2b155818
...
...
@@ -38,7 +38,21 @@ describe Ci::PrepareBuildService do
end
it
'drops the build'
do
expect
(
build
).
to
receive
(
:drop!
).
with
(
:unmet_prerequisites
).
once
expect
(
build
).
to
receive
(
:drop
).
with
(
:unmet_prerequisites
).
once
subject
end
end
context
'prerequisites raise an error'
do
before
do
allow
(
prerequisite
).
to
receive
(
:complete!
).
and_raise
Kubeclient
::
HttpError
.
new
(
401
,
'unauthorized'
,
nil
)
end
it
'drops the build and notifies Sentry'
do
expect
(
build
).
to
receive
(
:drop
).
with
(
:unmet_prerequisites
).
once
expect
(
Gitlab
::
Sentry
).
to
receive
(
:track_acceptable_exception
)
.
with
(
instance_of
(
Kubeclient
::
HttpError
),
hash_including
(
extra:
{
build_id:
build
.
id
}))
subject
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