fix(security_scanning): Improve fetching security report results
Description
Fixes some edge cases that would cause the findings to show 0 results.
What this MR changes
See plan from #1255 (closed)
Additional tests
I opted for integration level tests that is inclusive of the mergeReports
function. I think would have been a pain to unit test all the helper functions I added, when we have better coverage with the integration level tests that tie it all together. ( call to getSecurityReports w/ mocked network requests)
The scenarios in #1255 (closed) are covered with integration level tests.
Related Issues
Resolves #1255 (closed)
How has this been tested?
- Pull this branch, and launch vs-code workflow extension
- Look for a recently completed and successful pipeline run https://gitlab.com/gitlab-org/gitlab/-/pipelines?page=8&scope=finished&status=success
- Checkout that branch.
- Observe either the results parsing, or the results showing immediately (depends on if the results are cached on the gitlab server)
Screenshots (if appropriate)
Before | After |
---|---|
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap
Closes #1255 (closed)
Edited by Fernando Cardenas