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
09e901c9
Commit
09e901c9
authored
Apr 28, 2020
by
Jonathan Schafer
Committed by
Dmytro Zaporozhets
Apr 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove colon from Vulnerability file name if no line number exists
parent
4140695e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
ee/app/helpers/vulnerabilities_helper.rb
ee/app/helpers/vulnerabilities_helper.rb
+7
-3
ee/spec/helpers/vulnerabilities_helper_spec.rb
ee/spec/helpers/vulnerabilities_helper_spec.rb
+1
-0
No files found.
ee/app/helpers/vulnerabilities_helper.rb
View file @
09e901c9
...
...
@@ -49,9 +49,13 @@ module VulnerabilitiesHelper
finding
=
vulnerability
.
finding
location
=
finding
.
location
branch
=
finding
.
pipelines
&
.
last
&
.
sha
||
vulnerability
.
project
.
default_branch
link_text
=
"
#{
location
[
'file'
]
}
:
#{
location
[
'start_line'
]
}
"
offset
=
location
[
'start_line'
]
?
"#L
#{
location
[
'start_line'
]
}
"
:
''
link_path
=
project_blob_path
(
vulnerability
.
project
,
tree_join
(
branch
,
location
[
'file'
]))
+
offset
link_text
=
location
[
'file'
]
link_path
=
project_blob_path
(
vulnerability
.
project
,
tree_join
(
branch
,
location
[
'file'
]))
if
location
[
'start_line'
]
link_text
+=
":
#{
location
[
'start_line'
]
}
"
link_path
+=
"#L
#{
location
[
'start_line'
]
}
"
end
link_to
link_text
,
link_path
,
target:
'_blank'
,
rel:
'noopener noreferrer'
end
...
...
ee/spec/helpers/vulnerabilities_helper_spec.rb
View file @
09e901c9
...
...
@@ -150,6 +150,7 @@ describe VulnerabilitiesHelper do
vulnerability
.
finding
.
save
expect
(
subject
).
not_to
include
(
'#L'
)
expect
(
subject
).
not_to
match
(
/
#{
vulnerability
.
finding
.
location
[
'file'
]
}
:\d*/
)
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