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
.comenvironment - The
:ai_model_switchingfeature 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 | ![]() |
How to set up and validate locally
Pre-requisites
- An active Ultimate online cloud license.
To validate page:
- Start GDK in saas mode (
GITLAB_SIMULATE_SAAS=1 gdk start) - 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
-
Enable the following feature flag by visiting
http://gdk.test:3000/rails/features/and enablingai_model_switching -
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)
