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
73b04beb
Commit
73b04beb
authored
Dec 11, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix errors
parent
2b7a75ce
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
5 additions
and
10 deletions
+5
-10
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+0
-3
app/models/commit_status.rb
app/models/commit_status.rb
+1
-1
app/services/create_commit_builds_service.rb
app/services/create_commit_builds_service.rb
+0
-1
app/views/projects/commit/_builds.html.haml
app/views/projects/commit/_builds.html.haml
+1
-1
spec/features/merge_requests/merge_when_build_succeeds_spec.rb
...features/merge_requests/merge_when_build_succeeds_spec.rb
+2
-2
spec/services/create_commit_builds_service_spec.rb
spec/services/create_commit_builds_service_spec.rb
+0
-1
spec/services/merge_requests/merge_when_build_succeeds_service_spec.rb
.../merge_requests/merge_when_build_succeeds_service_spec.rb
+1
-1
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
73b04beb
...
...
@@ -81,8 +81,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
def
builds
@ci_project
=
@merge_request
.
source_project
.
gitlab_ci_project
respond_to
do
|
format
|
format
.
html
{
render
'show'
}
format
.
json
{
render
json:
{
html:
view_to_html_string
(
'projects/merge_requests/show/_builds'
)
}
}
...
...
@@ -106,7 +104,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@first_commit
=
@merge_request
.
first_commit
@diffs
=
@merge_request
.
compare_diffs
@ci_project
=
@source_project
.
gitlab_ci_project
@ci_commit
=
@merge_request
.
ci_commit
@statuses
=
@ci_commit
.
statuses
if
@ci_commit
...
...
app/models/commit_status.rb
View file @
73b04beb
...
...
@@ -77,7 +77,7 @@ class CommitStatus < ActiveRecord::Base
end
after_transition
[
:pending
,
:running
]
=>
:success
do
|
build
,
transition
|
MergeRequests
::
MergeWhenBuildSucceedsService
.
new
(
build
.
commit
.
gl_
project
,
nil
).
trigger
(
build
)
MergeRequests
::
MergeWhenBuildSucceedsService
.
new
(
build
.
commit
.
project
,
nil
).
trigger
(
build
)
end
state
:pending
,
value:
'pending'
...
...
app/services/create_commit_builds_service.rb
View file @
73b04beb
...
...
@@ -26,4 +26,3 @@ class CreateCommitBuildsService
commit
end
end
app/views/projects/commit/_builds.html.haml
View file @
73b04beb
.gray-content-block.middle-block
.pull-right
-
if
@ci_project
&&
can?
(
current_user
,
:manage_builds
,
@ci_commit
.
project
)
-
if
can?
(
current_user
,
:manage_builds
,
@ci_commit
.
project
)
-
if
@ci_commit
.
builds
.
latest
.
failed
.
any?
(
&
:retryable?
)
=
link_to
"Retry failed"
,
retry_builds_namespace_project_commit_path
(
@ci_commit
.
project
.
namespace
,
@ci_commit
.
project
,
@ci_commit
.
sha
),
class:
'btn btn-grouped btn-primary'
,
method: :post
...
...
spec/features/merge_requests/merge_when_build_succeeds_spec.rb
View file @
73b04beb
...
...
@@ -12,7 +12,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end
context
"Active build for Merge Request"
do
let!
(
:ci_commit
)
{
create
(
:ci_commit
,
gl_
project:
project
,
sha:
merge_request
.
last_commit
.
id
,
ref:
merge_request
.
source_branch
)
}
let!
(
:ci_commit
)
{
create
(
:ci_commit
,
project:
project
,
sha:
merge_request
.
last_commit
.
id
,
ref:
merge_request
.
source_branch
)
}
let!
(
:ci_build
)
{
create
(
:ci_build
,
commit:
ci_commit
)
}
before
do
...
...
@@ -47,7 +47,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
merge_user:
user
,
title:
"MepMep"
,
merge_when_build_succeeds:
true
)
end
let!
(
:ci_commit
)
{
create
(
:ci_commit
,
gl_
project:
project
,
sha:
merge_request
.
last_commit
.
id
,
ref:
merge_request
.
source_branch
)
}
let!
(
:ci_commit
)
{
create
(
:ci_commit
,
project:
project
,
sha:
merge_request
.
last_commit
.
id
,
ref:
merge_request
.
source_branch
)
}
let!
(
:ci_build
)
{
create
(
:ci_build
,
commit:
ci_commit
)
}
before
do
...
...
spec/services/create_commit_builds_service_spec.rb
View file @
73b04beb
...
...
@@ -168,4 +168,3 @@ describe CreateCommitBuildsService, services: true do
end
end
end
spec/services/merge_requests/merge_when_build_succeeds_service_spec.rb
View file @
73b04beb
...
...
@@ -11,7 +11,7 @@ describe MergeRequests::MergeWhenBuildSucceedsService do
end
let
(
:project
)
{
create
(
:project
)
}
let
(
:ci_commit
)
{
create
(
:ci_commit_with_one_job
,
ref:
mr_merge_if_green_enabled
.
source_branch
,
gl_
project:
project
)
}
let
(
:ci_commit
)
{
create
(
:ci_commit_with_one_job
,
ref:
mr_merge_if_green_enabled
.
source_branch
,
project:
project
)
}
let
(
:service
)
{
MergeRequests
::
MergeWhenBuildSucceedsService
.
new
(
project
,
user
,
commit_message:
'Awesome message'
)
}
describe
"#execute"
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