Skip to content

Fix create issue for new pipeline finding

What does this MR do and why?

Fix create issue for new pipeline finding

When a pipeline security finding does not exist on the default branch it is currently not possible to create an issue for it. This change fixes this.

Screenshots or screen recordings

Before After
Screenshot_2023-11-08_at_10.04.28_am Screenshot_2023-11-08_at_10.04.17_am

How to set up and validate locally

How to reproduce

  1. Import the security-reports example project and Do not run pipeline on master yet!
  2. Comment all bug 1 scanners in .gitlab-ci.yml (leave one uncommented otherwise the CI file is invalid) and commit and push this to master/main
  3. Uncomment the scanners in .gitlab-ci.yml, commit and push to a new branch and create an MR
  4. Run a pipeline for the MR and then go to the "Security" tab on that pipeline
  5. Click on a finding that was detected by a scanner that was previously commented out
  6. Verify that the "Create Issue" button is displayed
  7. Click "Create Issue" and wait until the action is completed
  8. Go back to the report and verify that the finding that the issue was created for, does not have the "Create Issue" button any longer

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #428894 (closed)

Edited by David Pisek

Merge request reports