Skip to content

Ban AI features based on project settings

What does this MR do and why?

On !144931 (merged) we introduced a cascading setting so users can mark on which projects and groups they want AI features disabled. Here, we introduce the logic that reads that setting and enables or disables AI features based on its value

Closes #441486 (closed)

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.

Generate issue description on project with duo_features_enabled=false

Screenshot_2024-02-20_at_13.05.08

Summarize notes on an Issue whose project has duo_features_enabled=false

Screenshot_2024-02-26_at_15.33.06

Ideally, the button wouldn't be visible to begin with

Use Chat on an Issue whose project has duo_features_enabled=false

Screen_Recording_2024-02-20_at_13.06.54

Note that the UX here isn't great at present, with the error message replacing the user prompt, and the Chat window hanging on "working on an answer..." until the user reloads. A follow-up issue is needed

Before After

How to set up and validate locally

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

  1. Open a rails console
  2. Modify the project or group setting with .update (there's currently no UI for this). E.g.:
Group.find_by_full_path('gitlab-org').namespace_settings.update(duo_features_enabled: false)
Project.find_by_full_path('gitlab-org/gitlab-test').update(duo_features_enabled: false)
  1. Try to use any AI feature involving that project/group, it should fail

Note: When testing chat, make sure to /reset the conversation if you had asked about the resource before changing the setting, so that the Assistant doesn't get the data from the conversation history

Edited by Alejandro Rodríguez

Merge request reports

Loading