Skip to content

Fix error when applying scanner suggestion

What does this MR do and why?

VulnerabilityFeedback::CreateService always tries to create remediations. If there is already an existing remediation, it will fail due to uniqueness constraints. This change fixes the issue by changing Remediations::CreateService to use find_or_create_by.

References

Screenshots or screen recordings

Before After
image remediate_with_scanner_suggestion_when_user_clicks_resolve_with_scanner_suggestion_creates_mr_and_re

How to set up and validate locally

  1. Clone the Yarn Remediation repo
  2. Run a pipeline on the cureable branch.
  3. Navigate to the project security dashboard select a vulnerability and view the details page. The Resolve with MR button should be available.
  4. Click on the Resolve with MR button.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Brian Williams

Merge request reports

Loading