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
ad4b1a94
Commit
ad4b1a94
authored
Jan 14, 2020
by
Tiger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent builds from halting unnecessarily when completing prerequisites
parent
4f642915
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
1 deletion
+36
-1
app/models/ci/build.rb
app/models/ci/build.rb
+1
-1
changelogs/unreleased/195998-fix-build-prerequisite-transition.yml
...s/unreleased/195998-fix-build-prerequisite-transition.yml
+5
-0
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+30
-0
No files found.
app/models/ci/build.rb
View file @
ad4b1a94
...
...
@@ -266,7 +266,7 @@ module Ci
end
before_transition
on: :enqueue_preparing
do
|
build
|
build
.
any_unmet_prerequisites?
# If false is returned, it stops the transition
!
build
.
any_unmet_prerequisites?
# If false is returned, it stops the transition
end
after_transition
created: :scheduled
do
|
build
|
...
...
changelogs/unreleased/195998-fix-build-prerequisite-transition.yml
0 → 100644
View file @
ad4b1a94
---
title
:
Prevent builds from halting unnecessarily when completing prerequisites
merge_request
:
22938
author
:
type
:
fixed
spec/models/ci/build_spec.rb
View file @
ad4b1a94
...
...
@@ -341,6 +341,36 @@ describe Ci::Build do
end
end
describe
'#enqueue_preparing'
do
let
(
:build
)
{
create
(
:ci_build
,
:preparing
)
}
subject
{
build
.
enqueue_preparing
}
before
do
allow
(
build
).
to
receive
(
:any_unmet_prerequisites?
).
and_return
(
has_unmet_prerequisites
)
end
context
'build completed prerequisites'
do
let
(
:has_unmet_prerequisites
)
{
false
}
it
'transitions to pending'
do
subject
expect
(
build
).
to
be_pending
end
end
context
'build did not complete prerequisites'
do
let
(
:has_unmet_prerequisites
)
{
true
}
it
'remains in preparing'
do
subject
expect
(
build
).
to
be_preparing
end
end
end
describe
'#actionize'
do
context
'when build is a created'
do
before
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