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
Boxiang Sun
gitlab-ce
Commits
c6a4f9fc
Commit
c6a4f9fc
authored
Nov 21, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update some docs to reflect MWPS name change
parent
d07ef089
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
24 additions
and
24 deletions
+24
-24
app/services/system_note_service.rb
app/services/system_note_service.rb
+2
-2
doc/api/merge_requests.md
doc/api/merge_requests.md
+1
-1
doc/development/code_review.md
doc/development/code_review.md
+2
-2
doc/intro/README.md
doc/intro/README.md
+1
-1
doc/user/project/merge_requests.md
doc/user/project/merge_requests.md
+5
-5
doc/user/project/merge_requests/merge_when_build_succeeds.md
doc/user/project/merge_requests/merge_when_build_succeeds.md
+8
-8
doc/workflow/README.md
doc/workflow/README.md
+1
-1
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+2
-2
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+1
-1
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+1
-1
No files found.
app/services/system_note_service.rb
View file @
c6a4f9fc
...
@@ -133,14 +133,14 @@ module SystemNoteService
...
@@ -133,14 +133,14 @@ module SystemNoteService
create_note
(
noteable:
noteable
,
project:
project
,
author:
author
,
note:
body
)
create_note
(
noteable:
noteable
,
project:
project
,
author:
author
,
note:
body
)
end
end
# Called when 'merge when
build
succeeds' is executed
# Called when 'merge when
pipeline
succeeds' is executed
def
merge_when_build_succeeds
(
noteable
,
project
,
author
,
last_commit
)
def
merge_when_build_succeeds
(
noteable
,
project
,
author
,
last_commit
)
body
=
"Enabled an automatic merge when the pipeline for
#{
last_commit
.
to_reference
(
project
)
}
succeeds"
body
=
"Enabled an automatic merge when the pipeline for
#{
last_commit
.
to_reference
(
project
)
}
succeeds"
create_note
(
noteable:
noteable
,
project:
project
,
author:
author
,
note:
body
)
create_note
(
noteable:
noteable
,
project:
project
,
author:
author
,
note:
body
)
end
end
# Called when 'merge when
build
succeeds' is canceled
# Called when 'merge when
pipeline
succeeds' is canceled
def
cancel_merge_when_build_succeeds
(
noteable
,
project
,
author
)
def
cancel_merge_when_build_succeeds
(
noteable
,
project
,
author
)
body
=
'Canceled the automatic merge'
body
=
'Canceled the automatic merge'
...
...
doc/api/merge_requests.md
View file @
c6a4f9fc
...
@@ -518,7 +518,7 @@ Parameters:
...
@@ -518,7 +518,7 @@ Parameters:
}
}
```
```
## Cancel Merge When
Build
Succeeds
## Cancel Merge When
Pipeline
Succeeds
If successful you'll get
`200 OK`
.
If successful you'll get
`200 OK`
.
...
...
doc/development/code_review.md
View file @
c6a4f9fc
...
@@ -70,8 +70,8 @@ experience, refactors the existing code). Then:
...
@@ -70,8 +70,8 @@ experience, refactors the existing code). Then:
-
After a round of line notes, it can be helpful to post a summary note such as
-
After a round of line notes, it can be helpful to post a summary note such as
"LGTM :thumbsup:", or "Just a couple things to address."
"LGTM :thumbsup:", or "Just a couple things to address."
-
Avoid accepting a merge request before the build succeeds. Of course, "Merge
-
Avoid accepting a merge request before the build succeeds. Of course, "Merge
When
Build Succeeds" (MWB
S) is fine.
When
Pipeline Succeeds" (MWP
S) is fine.
-
If you set the MR to "Merge When
Build
Succeeds", you should take over
-
If you set the MR to "Merge When
Pipeline
Succeeds", you should take over
subsequent revisions for anything that would be spotted after that.
subsequent revisions for anything that would be spotted after that.
## Credits
## Credits
...
...
doc/intro/README.md
View file @
c6a4f9fc
...
@@ -23,7 +23,7 @@ Create merge requests and review code.
...
@@ -23,7 +23,7 @@ Create merge requests and review code.
-
[
Fork a project and contribute to it
](
../workflow/forking_workflow.md
)
-
[
Fork a project and contribute to it
](
../workflow/forking_workflow.md
)
-
[
Create a new merge request
](
../gitlab-basics/add-merge-request.md
)
-
[
Create a new merge request
](
../gitlab-basics/add-merge-request.md
)
-
[
Automatically close issues from merge requests
](
../user/project/issues/automatic_issue_closing.md
)
-
[
Automatically close issues from merge requests
](
../user/project/issues/automatic_issue_closing.md
)
-
[
Automatically merge when
your builds succeed
](
../user/project/merge_requests/merge_when_build_succeeds.md
)
-
[
Automatically merge when
pipeline succeeds
](
../user/project/merge_requests/merge_when_build_succeeds.md
)
-
[
Revert any commit
](
../user/project/merge_requests/revert_changes.md
)
-
[
Revert any commit
](
../user/project/merge_requests/revert_changes.md
)
-
[
Cherry-pick any commit
](
../user/project/merge_requests/cherry_pick_changes.md
)
-
[
Cherry-pick any commit
](
../user/project/merge_requests/cherry_pick_changes.md
)
...
...
doc/user/project/merge_requests.md
View file @
c6a4f9fc
...
@@ -19,14 +19,14 @@ in a merged merge requests or a commit.
...
@@ -19,14 +19,14 @@ in a merged merge requests or a commit.
[
Learn more about cherry-picking changes.
](
merge_requests/cherry_pick_changes.md
)
[
Learn more about cherry-picking changes.
](
merge_requests/cherry_pick_changes.md
)
## Merge when
build
succeeds
## Merge when
pipeline
succeeds
When reviewing a merge request that looks ready to merge but still has one or
When reviewing a merge request that looks ready to merge but still has one or
more CI builds running, you can set it to be merged automatically when
all
more CI builds running, you can set it to be merged automatically when
CI
builds succeed. This way, you don't have to wait for the builds to finish and
pipeline succeeds. This way, you don't have to wait for the pipeline to finish
remember to merge the request manually.
and
remember to merge the request manually.
[
Learn more about merging when
build
succeeds.
](
merge_requests/merge_when_build_succeeds.md
)
[
Learn more about merging when
pipeline
succeeds.
](
merge_requests/merge_when_build_succeeds.md
)
## Resolve discussion comments in merge requests reviews
## Resolve discussion comments in merge requests reviews
...
...
doc/user/project/merge_requests/merge_when_build_succeeds.md
View file @
c6a4f9fc
# Merge When
Build
Succeeds
# Merge When
Pipeline
Succeeds
When reviewing a merge request that looks ready to merge but still has one or
When reviewing a merge request that looks ready to merge but still has one or
more CI builds running, you can set it to be merged automatically when the
more CI builds running, you can set it to be merged automatically when the
builds pipeline succeed. This way, you don't have to wait for the builds to
builds pipeline succeed
s
. This way, you don't have to wait for the builds to
finish and remember to merge the request manually.
finish and remember to merge the request manually.
![
Enable
](
img/merge_when_build_succeeds_enable.png
)
![
Enable
](
img/merge_when_build_succeeds_enable.png
)
When you hit the "Merge When
Build
Succeeds" button, the status of the merge
When you hit the "Merge When
Pipeline
Succeeds" button, the status of the merge
request will be updated to represent the impending merge. If you cannot wait
request will be updated to represent the impending merge. If you cannot wait
for the pipeline to succeed and want to merge immediately, this option is
for the pipeline to succeed and want to merge immediately, this option is
available in the dropdown menu on the right of the main button.
available in the dropdown menu on the right of the main button.
...
@@ -27,20 +27,20 @@ will automatically be merged after all. When the merge request is updated with
...
@@ -27,20 +27,20 @@ will automatically be merged after all. When the merge request is updated with
new commits, the automatic merge is automatically canceled to allow the new
new commits, the automatic merge is automatically canceled to allow the new
changes to be reviewed.
changes to be reviewed.
## Only allow merge requests to be merged if the
build
succeeds
## Only allow merge requests to be merged if the
pipeline
succeeds
> **Note:**
> **Note:**
You need to have builds configured to enable this feature.
You need to have builds configured to enable this feature.
You can prevent merge requests from being merged if their
build
did not succeed.
You can prevent merge requests from being merged if their
pipeline
did not succeed.
Navigate to your project's settings page, select the
Navigate to your project's settings page, select the
**Only allow merge requests to be merged if the
build
succeeds**
check box and
**Only allow merge requests to be merged if the
pipeline
succeeds**
check box and
hit
**Save**
for the changes to take effect.
hit
**Save**
for the changes to take effect.
![
Only allow merge if
build
succeeds settings
](
img/merge_when_build_succeeds_only_if_succeeds_settings.png
)
![
Only allow merge if
pipeline
succeeds settings
](
img/merge_when_build_succeeds_only_if_succeeds_settings.png
)
From now on, every time the pipeline fails you will not be able to merge the
From now on, every time the pipeline fails you will not be able to merge the
merge request from the UI, until you make all relevant builds pass.
merge request from the UI, until you make all relevant builds pass.
![
Only allow merge if
build
succeeds message
](
img/merge_when_build_succeeds_only_if_succeeds_msg.png
)
![
Only allow merge if
pipeline
succeeds message
](
img/merge_when_build_succeeds_only_if_succeeds_msg.png
)
doc/workflow/README.md
View file @
c6a4f9fc
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
-
[
Merge Requests
](
../user/project/merge_requests.md
)
-
[
Merge Requests
](
../user/project/merge_requests.md
)
-
[
Authorization for merge requests
](
../user/project/merge_requests/authorization_for_merge_requests.md
)
-
[
Authorization for merge requests
](
../user/project/merge_requests/authorization_for_merge_requests.md
)
-
[
Cherry-pick changes
](
../user/project/merge_requests/cherry_pick_changes.md
)
-
[
Cherry-pick changes
](
../user/project/merge_requests/cherry_pick_changes.md
)
-
[
Merge when
build
succeeds
](
../user/project/merge_requests/merge_when_build_succeeds.md
)
-
[
Merge when
pipeline
succeeds
](
../user/project/merge_requests/merge_when_build_succeeds.md
)
-
[
Resolve discussion comments in merge requests reviews
](
../user/project/merge_requests/merge_request_discussion_resolution.md
)
-
[
Resolve discussion comments in merge requests reviews
](
../user/project/merge_requests/merge_request_discussion_resolution.md
)
-
[
Resolve merge conflicts in the UI
](
../user/project/merge_requests/resolve_conflicts.md
)
-
[
Resolve merge conflicts in the UI
](
../user/project/merge_requests/resolve_conflicts.md
)
-
[
Revert changes in the UI
](
../user/project/merge_requests/revert_changes.md
)
-
[
Revert changes in the UI
](
../user/project/merge_requests/revert_changes.md
)
...
...
lib/api/merge_requests.rb
View file @
c6a4f9fc
...
@@ -181,7 +181,7 @@ module API
...
@@ -181,7 +181,7 @@ module API
optional
:should_remove_source_branch
,
type:
Boolean
,
optional
:should_remove_source_branch
,
type:
Boolean
,
desc:
'When true, the source branch will be deleted if possible'
desc:
'When true, the source branch will be deleted if possible'
optional
:merge_when_build_succeeds
,
type:
Boolean
,
optional
:merge_when_build_succeeds
,
type:
Boolean
,
desc:
'When true, this merge request will be merged when the
build
succeeds'
desc:
'When true, this merge request will be merged when the
pipeline
succeeds'
optional
:sha
,
type:
String
,
desc:
'When present, must have the HEAD SHA of the source branch'
optional
:sha
,
type:
String
,
desc:
'When present, must have the HEAD SHA of the source branch'
end
end
put
"
#{
path
}
/merge"
do
put
"
#{
path
}
/merge"
do
...
@@ -217,7 +217,7 @@ module API
...
@@ -217,7 +217,7 @@ module API
present
merge_request
,
with:
Entities
::
MergeRequest
,
current_user:
current_user
,
project:
user_project
present
merge_request
,
with:
Entities
::
MergeRequest
,
current_user:
current_user
,
project:
user_project
end
end
desc
'Cancel merge if "Merge
when build s
ucceeds" is enabled'
do
desc
'Cancel merge if "Merge
When Pipeline S
ucceeds" is enabled'
do
success
Entities
::
MergeRequest
success
Entities
::
MergeRequest
end
end
post
"
#{
path
}
/cancel_merge_when_build_succeeds"
do
post
"
#{
path
}
/cancel_merge_when_build_succeeds"
do
...
...
spec/models/merge_request_spec.rb
View file @
c6a4f9fc
...
@@ -31,7 +31,7 @@ describe MergeRequest, models: true do
...
@@ -31,7 +31,7 @@ describe MergeRequest, models: true do
it
{
is_expected
.
to
validate_presence_of
(
:target_branch
)
}
it
{
is_expected
.
to
validate_presence_of
(
:target_branch
)
}
it
{
is_expected
.
to
validate_presence_of
(
:source_branch
)
}
it
{
is_expected
.
to
validate_presence_of
(
:source_branch
)
}
context
"Validation of merge user with Merge When
Build s
ucceeds"
do
context
"Validation of merge user with Merge When
Pipeline S
ucceeds"
do
it
"allows user to be nil when the feature is disabled"
do
it
"allows user to be nil when the feature is disabled"
do
expect
(
subject
).
to
be_valid
expect
(
subject
).
to
be_valid
end
end
...
...
spec/requests/api/merge_requests_spec.rb
View file @
c6a4f9fc
...
@@ -463,7 +463,7 @@ describe API::API, api: true do
...
@@ -463,7 +463,7 @@ describe API::API, api: true do
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
).
to
have_http_status
(
200
)
end
end
it
"enables merge when
build succeeds if the ci
is active"
do
it
"enables merge when
pipeline succeeds if the pipeline
is active"
do
allow_any_instance_of
(
MergeRequest
).
to
receive
(
:pipeline
).
and_return
(
pipeline
)
allow_any_instance_of
(
MergeRequest
).
to
receive
(
:pipeline
).
and_return
(
pipeline
)
allow
(
pipeline
).
to
receive
(
:active?
).
and_return
(
true
)
allow
(
pipeline
).
to
receive
(
:active?
).
and_return
(
true
)
...
...
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