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
72818f2c
Commit
72818f2c
authored
Jul 15, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix creation of deployment on build that is retried, redeployed or rollback
parent
2550c1c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
CHANGELOG
CHANGELOG
+1
-0
app/models/ci/build.rb
app/models/ci/build.rb
+1
-0
spec/services/create_deployment_service_spec.rb
spec/services/create_deployment_service_spec.rb
+16
-0
No files found.
CHANGELOG
View file @
72818f2c
...
...
@@ -60,6 +60,7 @@ v 8.10.0 (unreleased)
- Allow expanding and collapsing files in diff view (!4990)
- Collapse large diffs by default (!4990)
- Fix mentioned users list on diff notes
- Fix creation of deployment on build that is retried, redeployed or rollback
- Check for conflicts with existing Project's wiki path when creating a new project.
- Show last push widget in upstream after push to fork
- Cache todos pending/done dashboard query counts.
...
...
app/models/ci/build.rb
View file @
72818f2c
...
...
@@ -53,6 +53,7 @@ module Ci
new_build
.
stage_idx
=
build
.
stage_idx
new_build
.
trigger_request
=
build
.
trigger_request
new_build
.
user
=
user
new_build
.
environment
=
build
.
environment
new_build
.
save
MergeRequests
::
AddTodoWhenBuildFailsService
.
new
(
build
.
project
,
nil
).
close
(
new_build
)
new_build
...
...
spec/services/create_deployment_service_spec.rb
View file @
72818f2c
...
...
@@ -89,6 +89,12 @@ describe CreateDeploymentService, services: true do
expect_any_instance_of
(
described_class
).
to
receive
(
:execute
)
subject
end
it
'is set as deployable'
do
subject
expect
(
Deployment
.
last
.
deployable
).
to
eq
(
deployable
)
end
end
context
'without environment specified'
do
...
...
@@ -105,6 +111,8 @@ describe CreateDeploymentService, services: true do
context
'when build succeeds'
do
it_behaves_like
'does create environment and deployment'
do
let
(
:deployable
)
{
build
}
subject
{
build
.
success
}
end
end
...
...
@@ -114,6 +122,14 @@ describe CreateDeploymentService, services: true do
subject
{
build
.
drop
}
end
end
context
'when build is retried'
do
it_behaves_like
'does create environment and deployment'
do
let
(
:deployable
)
{
Ci
::
Build
.
retry
(
build
)
}
subject
{
deployable
.
success
}
end
end
end
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