Stop resetting mcp_server_enabled when Duo settings change

What does this MR do and why?

Removes the sync_mcp_server_enabled before_save callback from EE::NamespaceSetting.

Since GitLab 19.2, MCP server access is governed by the dedicated mcp_server_enabled setting (see #590729 (closed) and !253212 (merged)). However, this callback still recomputed the root-group setting as duo_features_enabled && experiment_features_enabled whenever either of those was saved, so a group Owner who had explicitly enabled MCP access could have it silently turned off by changing Duo availability or beta/experimental features.

The callback was introduced in a73f4ec8 to cover staleness "between backfill and feature flag enablement windows". The mcp_server_availability_setting flag has since been removed (#598279 (closed)), so it is no longer needed. The MCP request path (lib/api/mcp/base.rb, ee/lib/ee/api/mcp/base.rb) only checks mcp_server_enabled, and the instance-level setting on self-managed already has no equivalent sync.

Spec changes:

  • ee/spec/models/namespace_setting_spec.rb: replaced the #sync_mcp_server_enabled examples with ones asserting mcp_server_enabled is not changed when duo_features_enabled / experiment_features_enabled flip.
  • ee/spec/lib/namespaces/namespace_setting_changes_auditor_spec.rb: removed the special-cased experiment_features_enabled context (which expected two audit events) and restored the column to the generic for all columns table.

References

Screenshots or screen recordings

N/A — backend only.

How to set up and validate locally

On a SaaS-mode GDK (GITLAB_SIMULATE_SAAS=1), as an Owner of a top-level group:

  1. Settings > General > Permissions and group features > enable MCP client access: Allow connection to GitLab. Save.
  2. Settings > GitLab Duo > set Duo availability to Never on (or turn off beta/experimental features). Save.
  3. Return to Permissions and group features.
  4. Before this MR: Allow connection to GitLab is unchecked. After: it remains checked.

Or in a Rails console:

g = Group.first
g.namespace_settings.update!(mcp_server_enabled: true, duo_features_enabled: true, experiment_features_enabled: true)
g.namespace_settings.update!(duo_features_enabled: false)
g.namespace_settings.reload.mcp_server_enabled # => true (was false before this MR)
Edited by Sebastian Rehm

Merge request reports

Loading
Loading