Skip to content

Draft: Cost Factors for Forked Projects for Namespace Storage PoC (Draft 1)

Jason Goodman requested to merge cost-factors-poc-2 into master

What does this MR do and why?

PoC for https://gitlab.com/gitlab-org/gitlab/-/issues/378995

This is a proof of concept. The code and UI in this MR is a sketch of ideas and could be improved upon for a final product.

Projects which are forks of other projects will have their total storage size multiplied by 0.008 for purposes of calculating namespace storage usage. The root namespace storage statistics (Namespace::RootStorageStatistics) will store both the actual size of all storage as well as the total size taking into account the cost factor for forks; so we will have both values to use as necessary. When we check if a namespace is over the storage size limit (in Namespaces::Storage::RootSize), we will use the cost factored storage size rather than the actual storage size.

There are also various changes to the UI to display the actual sizes and cost factored sizes to the user.

Screenshots or screen recordings

Personal Namespace Usage Quotas Page

There is a new Namespace Storage Consumption column in the table. Kyle Smith / GitLab Copy is a fork of a project and thus consumes less namespace storage - note the discrepancy between Namespace Storage Consumption and Total for this project.

The total namespace storage used is the sum of the Namespace Storage Consumption columns, not the Total columns.

Screen_Shot_2022-12-29_at_5.45.22_PM

Group Namespace Usage Quotas Page

This group does not have any projects that are forks.

Screen_Shot_2022-12-29_at_5.46.44_PM

Popup Text / Tooltips

This is just one idea. There may be a better way to do this, such as tool tips under just the column headings.

NamespaceStorageConsumptionPopup

TotalPopup

Forked Project Usage Quotas Page

Notice the message about how much namespace storage is consumed below the Usage breakdown bar graph.

Screen_Shot_2022-12-29_at_5.49.47_PM

Project Usage Quotas Page

This is the usage quotas page for a project that is not a fork. There are no changes here from what we have today.

Screen_Shot_2022-12-29_at_5.50.31_PM

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

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 Jason Goodman

Merge request reports