As a global admin, enable LFS per repository

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

To be able to control disk and LFS usage, I want to be able to enable / disable LFS per repository.

Proposal

A setting accessible from the admin project view: admin/projects/<namespace>/<project> where you can enable or disable LFS. It falls back to the global setting.

Technically (thanks @DouweM):

We can block this in http://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/lfs/response.rb#L200. The lfs_enabled attribute would be null/true/false, with null falling back to the global setting, and true/false explicitly en/disabling


Zendesk: https://gitlab.zendesk.com/agent/tickets/25927

Customer is rolling out LFS to their instances. Due to the large number of instances and potential for explosive disk usage growth, they would like the ability to toggle LFS per repository at an admin level.

This is an interesting request, because in my mind the request makes sense. On the other hand we currently don't have any instances of a per-repository setting like this that's only accessible to the global administrator.

cc/ @DouweM @JobV


Edit with complete spec:

Specification

  • If LFS is not available in the instance, don't show the LFS toggle per repository option under settings page.
  • When LFS is globally activated, all projects and groups have this toggle to ON by default.
  • If LFS is available, add a toggle to enable/disable LFS for this project under admin/groups/<groupname>/edit.
  • Add a visual indicator on admin/groups/<groupname> for the LFS status on this group, indicating the number of projects which have enabled LFS.
  • Add a toggle to enable/disable LFS for this project under admin/projects/<namespace>/<project>/edit.
  • Add a visual indicator on admin/projects/<namespace>/<project> for the LFS status on this project
  • If we globally turn LFS off, we should disable LFS for all groups and projects, even those who were manually enabled/disabled through this new setting option.
  • When turning LFS off at the group level, all projects under that group should have LFS set to off. Turning LFS off will trigger a warning to the user, asking him if he's sure.

Questions

  • What do we do when we deactivate a project that were using LFS? What happens?
  • Do we need any kind of new API call for that?

Wireframes

Enable LFS on group settings page

image

image

LFS enabled on a group

image

LFS enabled on a project

image

LFS disabled on a project

image

Enable LFS on project settings page

image

Links / references

Edited by 🤖 GitLab Bot 🤖