Fix AI audit events storage group setting persistence
What does this MR do and why?
The "Store AI audit events" checkbox on the group GitLab Duo settings page
(/-/settings/gitlab_duo/configuration) never persisted. The frontend sent the
value nested as namespace_settings_attributes: { ai_audit_events_storage_enabled }
in PUT /api/v4/groups/:id, but that param is not declared in the Grape API, so
declared_params silently dropped it. The request returned 200 with the success
alert while the setting was never applied.
This MR:
- Declares
ai_audit_events_storage_enabledandlock_ai_audit_events_storage_enabledas top-level params onPUT /groups/:id, following the existing convention for namespace settings (likeduo_features_enabled/lock_duo_features_enabled).Groups::UpdateService#handle_namespace_settingsalready handles them because both attributes are present inNamespaceSetting.allowed_namespace_settings_params. - Updates the frontend to send the flat param instead of the nested hash.
The GraphQL groupUpdate mutation already accepts both arguments; only the REST
path was broken.
Video
How to set up and validate locally
- Enable the
agent_artifacts_pagefeature flag (default enabled). - Go to Group → Settings → GitLab Duo → Configuration.
- Toggle Store AI audit events and save.
- Reload the page — the checkbox state now persists.
References
- Feature issue: https://gitlab.com/gitlab-org/gitlab/-/issues/592473
Edited by Illya Klymov