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
f910931a
Commit
f910931a
authored
Sep 25, 2020
by
Simon Lenz
Committed by
Kerri Miller
Sep 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return only the latest build with coverage in MR widget JSON
parent
d4628f0c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-1
changelogs/unreleased/246793-mr-coverage-only-latest-build.yml
...elogs/unreleased/246793-mr-coverage-only-latest-build.yml
+5
-0
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+10
-0
No files found.
app/models/ci/pipeline.rb
View file @
f910931a
...
...
@@ -875,7 +875,7 @@ module Ci
end
def
builds_with_coverage
builds
.
with_coverage
builds
.
latest
.
with_coverage
end
def
has_reports?
(
reports_scope
)
...
...
changelogs/unreleased/246793-mr-coverage-only-latest-build.yml
0 → 100644
View file @
f910931a
---
title
:
Do not show retried builds in the MR code coverage
merge_request
:
42402
author
:
Simon Lenz @koala7
type
:
fixed
spec/models/ci/pipeline_spec.rb
View file @
f910931a
...
...
@@ -3628,6 +3628,16 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
expect
(
builds
).
to
include
(
rspec
,
jest
)
expect
(
builds
).
not_to
include
(
karma
)
end
it
'returns only latest builds'
do
obsolete
=
create
(
:ci_build
,
name:
"jest"
,
coverage:
10.12
,
pipeline:
pipeline
,
retried:
true
)
retried
=
create
(
:ci_build
,
name:
"jest"
,
coverage:
20.11
,
pipeline:
pipeline
)
builds
=
pipeline
.
builds_with_coverage
expect
(
builds
).
to
include
(
retried
)
expect
(
builds
).
not_to
include
(
obsolete
)
end
end
describe
'#base_and_ancestors'
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