Refactor repository size error message
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
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
Edited by 🤖 GitLab Bot 🤖