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
24cd6f64
Commit
24cd6f64
authored
Oct 22, 2019
by
Matija Čupić
Committed by
James Lopez
Oct 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Block MR with OMIPS on skipped pipelines
parent
1b4453d9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
4 deletions
+9
-4
app/models/merge_request.rb
app/models/merge_request.rb
+1
-1
changelogs/unreleased/mc-bug-omips-not-blocking-on-skipped-pipelines.yml
...leased/mc-bug-omips-not-blocking-on-skipped-pipelines.yml
+5
-0
spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb
...rge_request/user_merges_only_if_pipeline_succeeds_spec.rb
+2
-2
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+1
-1
No files found.
app/models/merge_request.rb
View file @
24cd6f64
...
...
@@ -1081,7 +1081,7 @@ class MergeRequest < ApplicationRecord
return
true
unless
project
.
only_allow_merge_if_pipeline_succeeds?
return
false
unless
actual_head_pipeline
actual_head_pipeline
.
success?
||
actual_head_pipeline
.
skipped?
actual_head_pipeline
.
success?
end
def
environments_for
(
current_user
)
...
...
changelogs/unreleased/mc-bug-omips-not-blocking-on-skipped-pipelines.yml
0 → 100644
View file @
24cd6f64
---
title
:
Block MR with OMIPS on skipped pipelines.
merge_request
:
18838
author
:
type
:
fixed
spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb
View file @
24cd6f64
...
...
@@ -89,12 +89,12 @@ describe 'Merge request > User merges only if pipeline succeeds', :js do
context
'when CI skipped'
do
let
(
:status
)
{
:skipped
}
it
'
allows
MR to be merged'
do
it
'
does not allow
MR to be merged'
do
visit
project_merge_request_path
(
project
,
merge_request
)
wait_for_requests
expect
(
page
).
to
have_button
'Merge'
expect
(
page
).
not_
to
have_button
'Merge'
end
end
end
...
...
spec/models/merge_request_spec.rb
View file @
24cd6f64
...
...
@@ -2267,7 +2267,7 @@ describe MergeRequest do
allow
(
subject
).
to
receive
(
:head_pipeline
)
{
pipeline
}
end
it
{
expect
(
subject
.
mergeable_ci_state?
).
to
be_
truth
y
}
it
{
expect
(
subject
.
mergeable_ci_state?
).
to
be_
false
y
}
end
context
'when no pipeline is associated'
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