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_enabledexamples with ones assertingmcp_server_enabledis not changed whenduo_features_enabled/experiment_features_enabledflip.ee/spec/lib/namespaces/namespace_setting_changes_auditor_spec.rb: removed the special-casedexperiment_features_enabledcontext (which expected two audit events) and restored the column to the genericfor all columnstable.
References
- Closes #627602
- Related: !253212 (merged) (docs MR removing the Duo availability prerequisite)
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:
- Settings > General > Permissions and group features > enable MCP client access: Allow connection to GitLab. Save.
- Settings > GitLab Duo > set Duo availability to Never on (or turn off beta/experimental features). Save.
- Return to Permissions and group features.
- 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)