Skip to content

Ignore line extraction on historic scans

Zach Rice requested to merge fix-historic-scan-file-reading into master

What does this MR do?

This MR fixes the bug described here: gitlab-org/gitlab#223565 (closed). SECRET_DETECTION_HISTORIC_SCAN was causing the analyzer to fail due to the scanners trying to extract the line number from non-existing files. This bug arises when a secret is detected somewhere in the git history, but later the file that contains that secret is deleted. This MR adds some logic to prevent that from happening.

I also did a little refactoring to consolidate some items into the scanner/scanner.go file.

What are the relevant issue numbers?

gitlab-org/gitlab#223565 (closed)

Does this MR meet the acceptance criteria?

Edited by Lucas Charles

Merge request reports