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_enabled and lock_ai_audit_events_storage_enabled as top-level params on PUT /groups/:id, following the existing convention for namespace settings (like duo_features_enabled / lock_duo_features_enabled). Groups::UpdateService#handle_namespace_settings already handles them because both attributes are present in NamespaceSetting.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

  1. Enable the agent_artifacts_page feature flag (default enabled).
  2. Go to Group → Settings → GitLab Duo → Configuration.
  3. Toggle Store AI audit events and save.
  4. Reload the page — the checkbox state now persists.

References

Edited by Illya Klymov

Merge request reports

Loading