Skip to content

Refetch subscription after removing a user

What does this MR do and why?

When we remove a user on the usage quota page, we also want to refetch the subscription information as the seat usage can change when an active user gets removed.

This is necessary both on paid plans, but also on free plans where free_user_cap is enabled.

Screenshots or screen recordings

Before After
remove_user_before remove_user_after

How to set up and validate locally

Paid plan

export GITLAB_SIMULATE_SAAS=1
bin/rails c

ApplicationSetting.first.update(check_namespace_plan: true)
  1. Admin > Groups > ( Select a group ) > Change Plan to a paid plan
  2. Go to the Usage Quota page of that group (Group -> Settings -> Usage Quota)
  3. Remove a user

Free User cap

export GITLAB_SIMULATE_SAAS=1
bin/rails c

ApplicationSetting.first.update(check_namespace_plan: true)
Feature.enable(:free_user_cap)
  1. Go to the Usage Quota page of a free group (Group -> Settings -> Usage Quota)
  2. Remove a user

MR acceptance checklist

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

Merge request reports