Skip to content
Snippets Groups Projects

Return fresh duo_availability data on every fetch

What does this MR do and why?

This MR fixes a bug where ApplicationSettings is intermittently returning stale data on read of the duo_availability value.

This is showing up in the UI when an update is made in the Duo configuration page. On a form submit, the page redirects to admin/gitlab_duo where duo_availabity is then immediately read as a prop for the frontend. It's causing a "flickering" of the value shown on the page due to duo_availability being intermittently stale between page refreshes.

The issue is fixed by expiring the ApplicationSettings cache, forcing a fresh read of duo_availability each time it is fetched.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshot_2025-02-21_at_12.02.17_am

Before (Duo availability flickers between page loads) After (No flickering between page loads)
Screen_Recording_2025-02-20_at_11.47.30_pm Screen_Recording_2025-02-20_at_11.59.29_pm

How to set up and validate locally

To view the GitLab Duo Self-Hosted feature:

Prequisites

  • You will need an active Ultimate online cloud license.
  • Make sure you are set up with a Duo Enterprise subscription by running the following command in the terminal:

GITLAB_SIMULATE_SAAS=0 bundle exec 'rake gitlab:duo:setup_instance[duo_enterprise]'

  1. Start GDK in self-managed mode (GITLAB_SIMULATE_SAAS=0 gdk start)
  2. Visit Admin Area > GitLab Duo
  3. In the "GitLab Duo" panel on the right, click "Change Configuration"
  4. Update the "Availability" value to anything you like and click "Save Changes". You will be redirected back to Admin Area > GitLab Duo. The "GitLab Duo" panel should now reflect the updated value. Refresh the page several times and ensure the value does not flicker between page reloads.

Related to #519333 (closed)

Edited by Julie Huang

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading