Skip to content

Add info to usage quota for free capped namespaces

What does this MR do and why?

For free namespaces where the free user cap applies, this

  1. Adds a new card with a link to the billing page
  2. Shows the maximum number of free seats available based on the cap

Screenshots or screen recordings

Description Screenshot
With subscription Screenshot_2022-04-25_at_11.13.05
Free plan without feature flag enabled (current behaviour) Screenshot_2022-04-25_at_11.12.58
Free plan with feature flag enabled (new/future behaviour) Screenshot_2022-04-25_at_11.13.09

How to set up and validate locally

  1. Start your GDK
    export GITLAB_SIMULATE_SAAS=1
    gdk start
  2. You want to have three different groups
    1. A free group
    2. A free group where the Feature flag is enabled
      bin/rails c
      group = Group.find(1) # Use the ID of the group you want to test
      Feature.enable(:free_user_cap, group)
    3. A group on a plan (go to http://localhost:3000/admin/groups, choose a group and set a plan). To be able to do this, you need to enable namespace plans:
      bin/rails c
      ApplicationSetting.first.update(check_namespace_plan: true) 
  3. For each group, go to the Usage Quota Page: http://localhost:3000/groups/GROUP_NAME/-/usage_quotas#seats-quota-tab

Note: As you have likely not set a correct subscription for the group with the plan, the "max seats for subscription" or "seats owed` number will be "0"

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

Loading