Skip to content

Draft: Mixin for [Ban AI] Do not show UI when duo features are disabled epic

What does this MR do and why?

This MR resolves the issue where AI features are shown in the UI even when the user will not be able to use the feature.

The root cause of this issue is that the duoFeaturesEnabled flag is not being set correctly. This flag is used to determine whether or not AI features should be shown in the UI. However, the current code is only setting this flag for the first group in the project. This means that if a user is a member of multiple groups, they may see AI features in the UI even if they are not able to use them.

To fix this issue, this MR changes the code to set the duoFeaturesEnabled flag for all groups that the user is a member of. This ensures that AI features are only shown in the UI if the user is able to use them.

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

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Make sure you have a GitLab Ultimate license for UI testing
  2. In rails console validate if duo features are enabled, if true then disable
    Feature.enabled(:duo_features_enabled)
    Feature.enable(:duo_features_enabled)
  3. In a local AI Feature in the code, set the mixin. (Example: Root Cause Analysis - see Google Doc source path) 3a. After setting mixin: [duoFeatureEnabled], go do UI component and call the mixin this.$apollo.queries.duoFeaturesEnabled
  4. Find the component in your local instance to validate: Visit http://{LOCAL_INSTANCE}/{path_to_component}. (Example: for Root Cause Analysis - see Google Doc Location in UI)

Related to #443379 (closed)


This description was generated for revision 2d0ac9a8 using AI

Edited by Lindsey Shelton

Merge request reports