Skip to content

Guard Gitlab Chat by AI toggle

Madelein van Niekerk requested to merge 409539-gitlab-chat-namespace-toggle into master

What does this MR do and why?

This adds an additional check for the GitLab Chat AI feature where we only allow it when the user belongs to a paid group which has enabled experimental features and allows third party AI features.

How to set up and validate locally

  1. Enable feature flags: Feature.enable(:ai_enabling_settings), Feature.enable(:openai_experimentation) and Feature.enable(:tanuki_bot)

  2. Run gdk with SaaS:

    gdk stop
    export GITLAB_SIMULATE_SAAS=1
    gdk start
    
  3. Set OpenAI API key:

    settings = Gitlab::CurrentSettings.current_application_settings
    settings.openai_api_key = "..."
    settings.save!
  4. Choose a group and set it to an Ultimate Plan (Admin -> Groups -> [selected group] -> Plan)

  5. Go to the group's Settings -> General -> Permissions and group features

    1. Toggle Experiment features and Third-party AI services
    2. Test that GitLab Chat option is only enabled when both are checked

Screenshots or screen recordings

Screenshot_2023-05-10_at_09.39.24

Screenshot_2023-05-10_at_09.39.55

Screenshot_2023-05-10_at_09.40.22

Screenshot_2023-05-10_at_09.40.47

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #409539 (closed)

Edited by Madelein van Niekerk

Merge request reports