[go: up one dir, main page]

Skip to content

Ability to enforce Repository size limit

Description including problem, use cases, benefits, and/or goals

Projects, especially with LFS, can grow very large. Storage space is limited and if you have a large instance growth can be hard to control.

Proposal

We will have a limit per project, per group and globally.

This should count total data of the project, including LFS storage size.

Specification

  • Users can set a limit to project size at a project level, group level and global level.
  • By default it's unlimited at every level.
  • When setting a limit at either group or global levels, we check if the group or the account has projects that are above this limit.
    • If there are, we warn the user about it but they can still save this limit.
    • This is a hard limit. That means we will block git pushto projects that are over the limit.
  • Administrators (and only them) can override both group and global limits by manually entering a value at the group level, or at the project level.

UI changes

  • admin/application_settings > Account and Limit settings: Add a project size limit field.
  • Add/Edit group: add ability to override the limit through the UI
  • admin/groups/<group-name>/edit, ability to change to override the global "per project limit" for this group
  • Error messages in the UI when there is no available space anymore:
    • Unable to commit through the UI
    • Unable to proceed with merging
  • List of projects admin/projects, if a global or goup limit is set, indicate the size of the project and the max allowed size.

Backend changes

  • We can't obviously put negative values for the project size limit.
  • By default, project size is set to unlimited.
  • Forks will not inherit the project limit if one is set in the original project.
  • New API calls to be able to override the default project size limit on a group level, and at the project level.
  • Error messages when doing git operations from the CLI if there is no available space anymore

Wireframes

Administration panel

image

Edit a group in the administration area (admin/groups/<group-name>/edit)

image

Creating/editing a group (groups/new)

image

List of projects

image

Design needed

  • List of projects: as shown in the wireframe above: next to each project in the admin view , indicate the space it takes as well as the available space (like 2.32MB out of 10Gb).
  • When setting a project limit globally in the admin panel, how would the warning message look like (You have 3 projects over the limit you are trying to set)?
  • Visual of a message that appear when we can't commit through the UI or proceed with merge (Your repository exceeds the limit of XXX and as a result you will be unable to push to this repository). I don't know if we have something for that already.

Links / references

cc @dzaporozhets @stanhu