Skip to content

Guard RTV behind global ai and experimental setting

Lorenz van Herwaarden requested to merge guard-RTV-global-ai-experimental into master

What does this MR do and why?

Came up in slack discussion (internal link). The Resolve this vulnerability feature is guarded behind its resolve_vulnerability_ai feature flag, but not behind the global ai_global_switch feature flag and the Experiment & Beta features setting.

This MR adds this guard similar to how it's done for Explain this vulnerability feature.

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.

How to set up and validate locally

Prerequisites

  1. You need an EE license
  2. Simulate SAAS: https://docs.gitlab.com/ee/development/ee_features.html#simulate-a-saas-instance
  3. Make sure the group you'll be importing the project has ultimate license
  4. You need to have runners enabled (See $2408961 for setting up a runner)
  5. Import https://gitlab.com/gitlab-org/govern/demos/sandbox/minac/test-remediations in the group with the ultimate license
  6. Run a pipeline on master

Validation

  1. Go to the vulnerability report of the imported project and select a vulnerability
  2. Validate that in the split button (top-right) the "Resolve with AI" is not there
  3. Enable resolveVulnerabilityAi feature flag: echo "Feature.enable(:resolve_vulnerability_ai)" | gdk rails c
  4. Validate that the "Resolve with AI" is still not there
  5. Enable Experiment & Beta features setting:
    1. Go to the group with the Ultimate license
    2. Group Settings > General -> Permissions and group features
    3. Enable Experiment & Beta features
  6. Validate that the "Resolve with AI" is still not there
  7. Enable global ai switch: echo "Feature.enable(:ai_global_switc)" | gdk rails c
  8. Validate that the "Resolve with AI" is visible
Edited by Lorenz van Herwaarden

Merge request reports