Fix policies for GitLab Duo code suggestions and glab ask
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do and why?
GitLab 17.7 released with commit addb836e (MR !173220 (merged)) applied, which changed how it is determined
whether users can use GitLab Duo or not. This new implementation uses check for ai_features_enabled, which is only true,
when instance setting is set to on by default causing issue #510755 (closed).
This was partialy fixed in released GitLab version 17.9 with commit a5300200 (MR !176588 (merged))
which enables most GitLab Duo features by introducing new check ai_features_not_banned whch is true whenever instance AI setting isn't always off and it changed Duo Chat to use this new check, but original change influences also :access_duo_chat and :access_glab_ask_git_command rules. Hence this MR.
This merge request applies fix to those other two rules using the ai_features_not_banned introduced in !176588 (merged)
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
- MR which initialy changed policy logic: !173220 (merged)
- Issue: #510755 (closed)
- Partial fix introducing
ai_features_not_banned: a5300200 (MR !176588 (merged)) - Change introducing the
lock_duo_features_enabledsetting - Issue | MR
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Launch GDK and activate license with GitLab Duo subscription
- Assign GitLab Duo seat to your account
- Configure GitLab Duo instance setting to "Off by default"
- Connect VSCodium/JetBrains IDE with GitLab Plugin to your account on gdk instance
- GitLab duo will allow you to chat, but code completion will act as if forbidden by administrator
- Apply fix
- Restart GitLab plugin language server to force it to fetch new information from instance
- Now you can use code completion unless seat is revoked from you or instance AI is "always off"