Skip to content

Clear cache when AI related settings change

Nicolas Dular requested to merge nd/fix-ai-check-cache-issue into master

What does this MR do and why?

Issue: #425141 (closed)

Publish AI settings changed event

Always publish an event when the group changes third_party_ai_features_enabled or experiment_features_enabled as these are the flags that make sure that AI features are enabled/disabled for all group members.

After this event, we need to clear the cache for all users of the group to have immediate access to AI features.

This MR is not addressing the issue completely as we also need to publish events when:

  • A user gets added to a group
  • A user gets removed from a group
  • A group gets upgraded to the ultimate plan

This will be done in a follow-up.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
before after

How to set up and validate locally

  1. Working AI setup
  2. GITLAB_SIMULATE_SAAS=1 gdk start
  3. Have a user being the member of a group that has AI features access (ultimate group). They should be only a member of this group.
  4. Change either the "Third-Party AI setting" or "Experimental features" setting
  5. See how access to AI features changes for the user (easiest to check for Help -> Ask GitLab Duo appearing/disappearing)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Nicolas Dular

Merge request reports