Loading
Keep mcp_server_enabled in sync with source fields
What does this MR do and why?
When duo_features_enabled or experiment_features_enabled is updated on a
root-level group's namespace settings, mcp_server_enabled must be
recomputed. Without this callback, mcp_server_enabled goes stale between
backfill and feature flag enablement windows.
References
https://gitlab.com/gitlab-com/request-for-help/-/work_items/4926
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Find or create a root-level group with Duo enabled.
g = Group.find_by_path('gitlab-duo') ns = g.namespace_settings - Set a known base state, both source fields true,
mcp_server_enabledfalse.ns.update_columns(duo_features_enabled: true, experiment_features_enabled: true, mcp_server_enabled: false) ns.reload.mcp_server_enabled # => false (callback not fired) - Disable
duo_features_enabledand save, verifymcp_server_enabledflips tofalse.ns.update!(duo_features_enabled: false) ns.reload.mcp_server_enabled # => false - Re-enable
duo_features_enabledand save, verifymcp_server_enabledflips back totrue.ns.update!(duo_features_enabled: true) ns.reload.mcp_server_enabled # => true
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by λ Tan Le