Ensure instance-level model selection page is accessible in Dedicated instance
What does this MR do and why?
This MR updates authorizations checks to allow Dedicated instance admins to access instance-level model selection while continuing to restrict self-hosted model features that are not currently supported on Dedicated:
- Ensures model configuration card in the admin GitLab Duo page is rendered when instance-level model selection is available.
- Updates
manage_instance_model_selection
global policy to not depend onuser_allowed_to_manage_self_hosted_models_settings
, which returns false if on Dedicated instance. - Updates controller to ensure page is accessible to Dedicated instance.
- Updates
aiFeatureSettings
query and mutation to ensure that GitLab-managed models can be queried and updated while also gating self-hosted models.
References
Show Duo Self-Hosted page to Dedicated (#569874 - closed)
Screenshots or screen recordings
Self-managed with Duo Self-Hosted | Self-managed offline license | Dedicated instance |
---|---|---|
|
|
|
How to set up and validate locally
Setup:
- Self-managed with Duo Self-Hosted:
- Ultimate or Premium online license.
- Run GDK on non-SAAS mode:
GITLAB_SIMULATE_SAAS=0 gdk start
- Run the following setup script to get Duo Enterprise add on:
GITLAB_SIMULATE_SAAS=0 bundle exec 'rake gitlab:duo:setup'
- Self-managed offline license:
- Ultimate or Premium offline license.
- Run GDK on non-SAAS mode:
GITLAB_SIMULATE_SAAS=0 gdk start
- Run the following setup script to get Duo Enterprise add on:
GITLAB_SIMULATE_SAAS=0 bundle exec 'rake gitlab:duo:setup'
- Dedicated:
-
Ultimate or Premium online license
-
Run GDK on non-SAAS mode:
GITLAB_SIMULATE_SAAS=0 gdk start
-
Run the following setup script to get Duo Enterprise add on:
GITLAB_SIMULATE_SAAS=0 bundle exec 'rake gitlab:duo:setup'
-
Testing Dedicated instance requires Switchboard provisioning as well as setting up GitLab Duo license. To get around this, I ran the following in the Rails console (
bin/rails c
):settings = ApplicationSetting.current settings.gitlab_dedicated_instance = true settings.save(validate: false)
-
Make sure to reset this once you're done testing:
settings = ApplicationSetting.current settings.gitlab_dedicated_instance = false settings.save(validate: false)
-
Validate locally:
- Go to GitLab Duo admin page:
/admin/gitlab_duo
- Refer to screen recordings in the previous section for key things to look out for.
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.