Trim whitespace from excluded paths
What does this MR do?
Trims leading whitespace from values in the SAST_EXCLUDED_PATHS
environment variable after it's split. Exclusion patterns with leading whitespace appear to be ignored completely by Semgrep, which can cause much confusion and frustration for users.
The default value for SAST_EXCLUDED_PATHS
includes whitespace between the comma-separated values too. This effectively becomes a no-op as those patterns are ignored by Semgrep. This issue has surfaced on Stackoverflow as well as gitlab-org/gitlab#332187 (closed).
What are the relevant issue numbers?
- gitlab-org/gitlab#332187 (closed) (the original issue that prompted me down this rabbit hole)
- gitlab-org/gitlab#223283 (I've added some commentary here explaining the issue in depth)
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated for GitLab EE, if necessary -
Documentation created/updated for this project, if necessary -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Job definition updated, if necessary -
Conforms to the code review guidelines -
Conforms to the Go guidelines -
Security reports checked/validated by reviewer
Edited by Lucas Charles