FE: Introduce scan execution strategy for Scan Execution Policies

Overview

This issue implements a new UI component for Scan Execution Policies that simplifies configuration for MR approval policy compatibility, as shown in this design.

Problem

Currently, users must understand complex GitLab pipeline mechanics to configure Scan Execution Policies that work properly with MR approval policies. This leads to confusion and often results in users selecting "all branches" (*), causing unnecessary pipeline executions and increased infrastructure costs.

Proposal

Implement a new "Optimize for MR approval policies" checkbox option that:

  • Automatically configures the policy to run scans in both source and target branches for open merge requests
  • Enforces the use of .latest templates to ensure MR pipelines are used correctly
  • Provides clear explanatory text about what this configuration does

Implementation Details

  1. Update the ScanExecutionPolicyEditor.vue component to include the new strategy option
  2. Add the necessary state management for this option
  3. When checked:
    • Set branch type to target_default in the backend configuration
    • Ensure template selection is set to .latest
    • Hide conflicting options to prevent confusion
  4. Add appropriate tooltips and help text to explain the benefits
  5. Implement behind a feature flag for controlled rollout

Technical Considerations

  • This feature depends on the backend implementation of target_default branch type
  • The UI should gracefully handle cases where the backend feature is not available
  • We should ensure the state is properly preserved when editing existing policies

Acceptance Criteria

  • New "Optimize for MR approval policies" checkbox is added to the SEP editor
  • When checked, it correctly configures the policy for MR approval compatibility
  • Clear explanatory text is shown to users about what this option does
  • The UI handles existing policies correctly when editing
  • Feature is implemented behind a feature flag
  • Documentation is updated to explain the new option

Related Links

Edited by Alan (Maciej) Paruszewski