Change-gate web_search_enabled in group Duo form

What does this MR do and why?

The group Duo settings form now sends web_search_enabled only when its value changed.

Before this MR, the form sent web_search_enabled on every save whenever the web search setting was visible. Every other key under ai_settings_attributes is already sent only when it changed (785a0f80). Sending a key means "this setting was explicitly configured", and with !256692 (merged) it also refreshes the setting's configured_at stamp. So saving the page to change an unrelated toggle marked web search as configured.

The existing "submits no gated keys" spec missed this because its default setup hides the web search setting. This MR updates that spec to run with web search visible.

Frontend only. The API treats every ai_settings_attributes key as optional, so no backend change is needed.

References

Screenshots or screen recordings

Not applicable. The UI does not change, only the request payload.

How to set up and validate locally

  1. In the Rails console, enable the feature flag:
    Feature.enable(:dap_web_search)
  2. Use a top-level group where web search is available.
  3. Open Settings > GitLab Duo > Configuration with the browser DevTools Network tab open.
  4. Change an unrelated setting, for example Collect usage data, and select Save changes.
  5. In the PUT /api/v4/groups/:id request body, ai_settings_attributes does not contain web_search_enabled.
  6. Change the web search setting and save again. The request body now contains web_search_enabled.

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 SAM FIGUEROA

Merge request reports

Loading
Loading