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

  1. Go to a pipeline with Security jobs
  2. Go to the Security Tab
  3. On a finding, click "Create an issue"
  4. 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

Verification

  1. Click the button to create an issue for a Vulnerability with a single line location
  2. On the issue creation form, the line number should not have a dash on it.
Edited by Jonathan Schafer