Update policies to support Self-hosted DAP SKU alongside Duo Enterprise
What does this MR do and why?
Update policies and GQL logic to satisfy the following new rules:
- Duo Enterprise customers: Continue existing self-hosting for Duo Enterprise features (Code Suggestions, etc.) + cloud-connected DAP only
- Self-hosted DAP SKU customers: self-hosted models for DAP feature settings. All classic feature settings remain as is.
References
https://gitlab.com/gitlab-org/gitlab/-/work_items/582207+
Screenshots or screen recordings
| Offline license |
Online license |
|
|---|---|---|
| Duo Enterprise add-on (no SKU) |
Cannot update DAP feature setting to self-hosted model programatically: |
Cannot update DAP feature setting to self-hosted model programatically: |
| With SKU |
|
How to set up and validate locally
Setup for no SKU (Duo Enterprise add-on)
- Run the following setup script to get Duo Enterprise add on:
GITLAB_SIMULATE_SAAS=0 bundle exec 'rake gitlab:duo:setup' - Update
offline_cloud_license?inee/app/models/license.rbto return false if testing for offline license behavior.
Setup for SKU
- Enable
self_hosted_dap_skuflag. - Update
offline_cloud_license?inee/app/models/license.rbto return false
Steps:
-
Run GDK on non-SASS mode:
GITLAB_SIMULATE_SAAS=0 gdk start -
Go to
/admin/gitlab_duo/self_hosted -
Observe the following behaviors
Self-hosted models
- View and set to self-hosted model
- Create/edit/delete self-hosted model
GitLab-managed models
- View and set to GitLab-managed model
DAP SKU with offline license Classic:
DAP:
Classic:
❌ DAP:
❌ Duo Enterprise with offline license Classic:
DAP:
❌ Classic:
❌ DAP:
❌ Duo Enterprise with online license Classic:
DAP:
❌ Classic:
DAP:
-
To test out setting self-hosted model programatically, use the GQL explorer (
/-/graphql-explorer):mutation updateAiFeatureSetting($input: AiFeatureSettingUpdateInput!) { aiFeatureSettingUpdate(input: $input) { errors __typename } } # variables { "input": { "features": [ "DUO_AGENT_PLATFORM" ], "provider": "SELF_HOSTED", "aiSelfHostedModelId": "gid://gitlab/Ai::SelfHostedModel/11", "offeredModelRef": null } }
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.

