Skip to content

Move storage alert to page level

Ammar Alakkad requested to merge 363159-move-storage-alert-to-page-level into master

What does this MR do and why?

It updates the storage alert to be at page-level per Pajama's guidelines.

The MR does not include a changelog because the changes are behind a disabled feature flag/settings.

Screenshots or screen recordings

before after (fluid layout) after (fixed layout)
Screen_Shot_2022-08-15_at_13.40.15 Screen_Shot_2022-08-15_at_13.39.42 Screen_Shot_2022-08-15_at_13.39.27

How to set up and validate locally

Ensure storage alert is showing for a namespace, if not, follow the steps inside 👈

The following steps are borrowed from !92642 (merged), thanks Sheldon!

  1. First step is to enable the FF that toggles the type of enforcement from repository to namespace storage: Feature.enable(:namespace_storage_limit)
    • This will make the repository-level storage banners (mentioned above) to stop showing
  2. Next we need to enable other feature flags that control other parts of this feature
    1. Feature.enable(:namespace_storage_limit_bypass_date_check)
    2. Feature.enable(:enforce_storage_limit_for_paid)
    3. Feature.enable(:enforce_storage_limit_for_free)
  3. Let's add a limit to the free plan (10 here means 10 megabytes):
    1. Plan.default.actual_limits.update!(storage_size_limit: 10)
    2. Plan.free.actual_limits.update!(storage_size_limit: 10)
  4. If you're using the same group for all examples, let's remove the additional purchased storage:
    1. n = Group.find(<your group id here>)
    2. n.update(additional_purchased_storage_size: 0)
  5. Add namespace storage statistics
n = Group.find(<your group id here>)
n.root_storage_statistics&.destroy!
s = Namespace::RootStorageStatistics.new(
  namespace: n,
  build_artifacts_size: 0,
  wiki_size: 0,
  repository_size: 0,
  packages_size: 0,
  lfs_objects_size: 7864320
)
s.storage_size = s.repository_size + s.lfs_objects_size + s.wiki_size + s.build_artifacts_size + s.packages_size
s.save!

Note: some changes might take a bit, make sure to restart GDK.

  • Navigate to a namespace with the storage alert visible
  • If your current user layout preference is set to fixed, the alert should be displayed within the page container
  • If your current user layout preference is set to fluid, the alert should be displayed with full width

MR acceptance checklist

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

Related to #363159

Edited by Ammar Alakkad

Merge request reports