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
f9c28fe4
Commit
f9c28fe4
authored
Oct 28, 2020
by
drew cimino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pipeline helper method for Badge::Coverage::Report
parent
c1ef6a80
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
lib/gitlab/badge/coverage/report.rb
lib/gitlab/badge/coverage/report.rb
+7
-5
No files found.
lib/gitlab/badge/coverage/report.rb
View file @
f9c28fe4
...
@@ -17,8 +17,6 @@ module Gitlab
...
@@ -17,8 +17,6 @@ module Gitlab
key_width:
opts
[
:key_width
].
to_i
,
key_width:
opts
[
:key_width
].
to_i
,
key_text:
opts
[
:key_text
]
key_text:
opts
[
:key_text
]
}
}
@pipeline
=
@project
.
ci_pipelines
.
latest_successful_for_ref
(
@ref
)
end
end
def
entity
def
entity
...
@@ -42,14 +40,18 @@ module Gitlab
...
@@ -42,14 +40,18 @@ module Gitlab
private
private
def
pipeline
@pipeline
||=
@project
.
ci_pipelines
.
latest_successful_for_ref
(
@ref
)
end
# rubocop: disable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
def
raw_coverage
def
raw_coverage
return
unless
@
pipeline
return
unless
pipeline
if
@job
.
blank?
if
@job
.
blank?
@
pipeline
.
coverage
pipeline
.
coverage
else
else
@
pipeline
.
builds
pipeline
.
builds
.
find_by
(
name:
@job
)
.
find_by
(
name:
@job
)
.
try
(
:coverage
)
.
try
(
:coverage
)
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