Skip to content

Refactor repository size error message

Mark Chao requested to merge refactor-repository-size-error into master

What does this MR do?

Currently repository size checking is only happening at EE, and is coupled with project heavily. A few calculation methods are tied with project columns, and the RepositorySizeError class for building error messages is also tied with project columns.

This MR moves size related calculations into a class called RepositorySizeChecker. It is accessible via HasRepository#repository_size_checker method. Some methods are renamed:

  • repository_and_lfs_size -> current_size
  • actual_size_limit -> limit
  • size_limit_enabled? -> enabled?

RepositorySizeChecker also offers access to RepositorySizeError class for generating messages.

The RepositorySizeChecker means calculations are no longer tied with table column names, so they can later be reused on Snippet.

It is extracted as FOSS code because snippet size check will be done in FOSS.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by 🤖 GitLab Bot 🤖

Merge request reports