Ban AI Decommission Duo Features Enabled Component and Update `namespace_settings` Table

What does this MR do and why?

The purposes of this MR is to decommission the HAML Duo Features Enabled component since the new GitLab Duo section has been added via this MR

For database changes, we need to update lock_duo_features_enabled to false when it previously was true and when duo_features_enabled is true. The reason for this is that the new Duo features for Availability handles the following:

  • Default on: lock_duo_features_enabled is false and duo_features_enabled is true
  • Default off: lock_duo_features_enabled is false and duo_features_enabled is false
  • Never on: lock_duo_features_enabled is true and duo_features_enabled is false

The previous case with the cascading checkboxes handled 4 conditions instead of the 3 (described above). We want to remove the 4th condition since it will no longer be valid with the removal of the HAML Duo Features enabled component - and thus we need to update/migrate the lock_duo_features_enabled column in the namespace_settings table.

Related Issues:

  • #479384 (closed) - Decommission Duo Features Enabled feature from Group and Admin Permission Settings

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-08-15_at_2.07.38_PM Screenshot_2024-08-15_at_2.04.26_PM

How to set up and validate locally

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

For frontend changes:

To utilize the new GitLab Duo features > Availability* use the following feature-flag: ai_settings_vue_group, and make sure it is enabled. This is not required to test the removal of the Duo Features Enabled component.

  1. Go to Group > Settings > Permissions and group features
  2. Validate the GitLab Duo features settings section no longer exists.

For the database changes:

  1. Validate that tables have been updated and that lock_duo_features_enabled is false when duo_features_enabled is true.
  2. Use query
UPDATE namespace_settings
SET lock_duo_features_enabled = false
WHERE lock_duo_features_enabled = true
  AND duo_features_enabled = true;

EXPLAIN ANAZLYZE UPDATE namespace_settings
SET lock_duo_features_enabled = false
WHERE lock_duo_features_enabled = true
  AND duo_features_enabled = true;
  1. Compare to Query plan here.
Edited by Lindsey Shelton

Merge request reports

Loading