Add Routing for Model Selection Page

What does this MR do and why?

Adds routing and a HAML view for the top-level group model selection page (for SaaS only). The UI for this page will be built as a Vue app and will be added in a later piece of work.

Route created: /groups/<group-namespace>/-/settings/gitlab_duo/model_selection

Multiple checks have been added for guarding the page. Its purpose is to ensure the page can only be accessed when:

  • The user is a group owner
  • It's a .com environment
  • The :ai_model_switching feature flag is enabled
  • The group is a top-level group
  • Duo features are enabled for the group

References

Screenshots or screen recordings

Before After
Did not exist Screenshot_2025-05-14_at_6.21.45_pm

How to set up and validate locally

Pre-requisites

  • An active Ultimate online cloud license.

To validate page:

  1. Start GDK in saas mode (GITLAB_SIMULATE_SAAS=1 gdk start)
  2. Create a new top-level group and call it "GitLab Duo". Then to configure it with Duo, run the following command in the terminal:

GITLAB_SIMULATE_SAAS=1 bundle exec 'rake gitlab:duo:setup

  1. Enable the following feature flag by visiting http://gdk.test:3000/rails/features/ and enabling ai_model_switching

  2. Visit the model selection page of the group just created, i.e http://gdk.test:3000/groups/gitlab-duo/-/settings/gitlab_duo/model_selection. You should see a blank page with the correct breadcrumbs.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #536711 (closed)

Edited by Julie Huang

Merge request reports

Loading