Invalid location in issues created off of a finding/vulnerability
Summary
The location links generated for issues created off findings is invalid.
Steps to reproduce
- Go to a pipeline with Security jobs
- Go to the Security Tab
- On a finding, click "Create an issue"
- The issue generated has an invalid location link
Example Project
https://gitlab.com/gitlab-org/gitlab/-/issues/336942#note_637226933 (confidential issue)
What is the current bug behavior?
The link is https://gitlab.com/gitlab-org/gitlab/-/blob/master/[redacted].rb:23 instead of https://gitlab.com/gitlab-org/gitlab/-/blob/master/[redacted].rb#L23
What is the expected correct behavior?
https://gitlab.com/gitlab-org/gitlab/-/blob/master/[redacted].rb#L23
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)
Possible fixes
I thought it was related to the brakeman scanner, but this issue (confidential) has a different link (but still invalid...).
Implementation Plan
-
backend Fix the VulnerabilityPresenterto include the#Lproperly in the link.
Verification
- Click the button to create an issue for a Vulnerability with a single line location
- On the issue creation form, the line number should not have a dash on it.