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
c5570094
Commit
c5570094
authored
Jun 10, 2021
by
Erick Bajao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't require approval for coverage when base pipeline is missing
parent
d8d6a39c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
9 deletions
+4
-9
ee/app/services/ci/sync_reports_to_approval_rules_service.rb
ee/app/services/ci/sync_reports_to_approval_rules_service.rb
+2
-7
ee/spec/services/ci/sync_reports_to_approval_rules_service_spec.rb
...ervices/ci/sync_reports_to_approval_rules_service_spec.rb
+2
-2
No files found.
ee/app/services/ci/sync_reports_to_approval_rules_service.rb
View file @
c5570094
...
...
@@ -59,13 +59,8 @@ module Ci
pipeline
.
merge_requests_as_head_pipeline
.
reject
do
|
merge_request
|
base_pipeline
=
merge_request
.
base_pipeline
if
base_pipeline
.
present?
pipeline
.
coverage
<
base_pipeline
.
coverage
else
# base pipeline is missing so we can't make an assumption
# if the coverage is better or not. We default to require approval.
true
end
# if base pipeline is missing we just default to not require approval.
pipeline
.
coverage
<
base_pipeline
.
coverage
if
base_pipeline
.
present?
end
end
...
...
ee/spec/services/ci/sync_reports_to_approval_rules_service_spec.rb
View file @
c5570094
...
...
@@ -285,9 +285,9 @@ RSpec.describe Ci::SyncReportsToApprovalRulesService, '#execute' do
allow
(
pipeline
).
to
receive
(
:complete?
).
and_return
(
true
)
end
it
"
won't lower
approvals_required count"
do
it
"
lowers
approvals_required count"
do
expect
{
sync_rules
}
.
not_to
change
{
report_approver_rule
.
reload
.
approvals_required
}
.
to
change
{
report_approver_rule
.
reload
.
approvals_required
}.
from
(
2
).
to
(
0
)
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