Bug: AI features PAT scope only available on SaaS
Problem
The ai_features
scope was introduced in 16.4 via Resolve "Introduce GitLab Duo scope for persona... (!131034 - merged)
Some logic changed 2 months ago so that the scope is only shown "when ai features are available": Hide ai_features scope when ai features are not... (!131873 - merged)
This logic change looks at the resource.any_group_with_ai_available?
method, which is checking for whether a user belongs to at least one group with both:
- experiment and beta features enabled (via group setting)
- an AI-support plan, which is defined in the code as "an Ultimate SaaS plan"
Proposal
As a result of these conditions, the ai_features
scope for PATs would never be shown to user's on self-managed or dedicated GitLab instances. This is a bug. Those customers should be able to use this scope if they have access to AI features in their instance.
Workaround
The workaround us to use the api
and read_user
PAT scopes, which allow more access than code suggestions requires.