Skip to content

Resolve "Display badge on AI-resolvable items within the MR report"

What does this MR do and why?

This code diff introduces a new feature to the Merge Request widget. It adds a badge to vulnerabilities that can be resolved using AI. This badge is only shown if the user has the ability to resolve vulnerabilities with AI and the vulnerability has AI resolution enabled.

Additionally, the feature flag (`resolve_vulnerability_in_mr) for resolving vulnerabilities in the merge request must be enabled.

MR acceptance checklist

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

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2024-10-07_at_11.30.17_AM Screenshot_2024-10-07_at_11.29.54_AM

How to set up and validate locally

  1. Import this project: https://gitlab.com/gitlab-org/govern/threat-insights-demos/verification-projects/cwe-tests
  2. DO NOT RUN A PIPELINE AGAINST MASTER
  3. Add a small change, eg. add a README and create a new MR
  4. Run pipeline
  5. Reload MR page after pipeline has finished
  6. Verify that the badges are NOT showing
  7. Enable the FF: echo 'Feature.enable(:resolve_vulnerability_in_mr)' | rails c
  8. Verify that the badges are showing

Related to #482900 (closed)

Edited by David Pisek

Merge request reports

Loading