summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--doc/api/projects.md3
-rw-r--r--doc/workflow/project_features.md8
-rw-r--r--lib/api/entities.rb2
-rw-r--r--lib/api/projects.rb8
5 files changed, 19 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 16fefd63d41..2d0cbd2cfd8 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -25,6 +25,7 @@ v 8.12.0 (unreleased)
- Add horizontal scrolling to all sub-navs on mobile viewports (ClemMakesApps)
- Fix markdown help references (ClemMakesApps)
- Add last commit time to repo view (ClemMakesApps)
+ - Added project specific enable/disable setting for LFS !5997
- Added tests for diff notes
- Add a button to download latest successful artifacts for branches and tags !5142
- Add delimiter to project stars and forks count (ClemMakesApps)
diff --git a/doc/api/projects.md b/doc/api/projects.md
index 3136c493b48..671b4ba7a7a 100644
--- a/doc/api/projects.md
+++ b/doc/api/projects.md
@@ -452,6 +452,7 @@ Parameters:
- `import_url` (optional)
- `public_builds` (optional)
- `only_allow_merge_if_build_succeeds` (optional)
+- `enable_lfs` (optional)
### Create project for user
@@ -478,6 +479,7 @@ Parameters:
- `import_url` (optional)
- `public_builds` (optional)
- `only_allow_merge_if_build_succeeds` (optional)
+- `enable_lfs` (optional)
### Edit project
@@ -505,6 +507,7 @@ Parameters:
- `visibility_level` (optional)
- `public_builds` (optional)
- `only_allow_merge_if_build_succeeds` (optional)
+- `enable_lfs` (optional)
On success, method returns 200 with the updated project. If parameters are
invalid, 400 is returned.
diff --git a/doc/workflow/project_features.md b/doc/workflow/project_features.md
index a523b3facbe..6790c06f325 100644
--- a/doc/workflow/project_features.md
+++ b/doc/workflow/project_features.md
@@ -33,3 +33,11 @@ Snippets are little bits of code or text.
This is a nice place to put code or text that is used semi-regularly within the project, but does not belong in source control.
For example, a specific config file that is used by > the team that is only valid for the people that work on the code.
+
+## LFS
+
+>**Note:** Project specific LFS setting was added on 8.12 and is available only to admins.
+
+Git Large File Storage allows you to easily manage large binary files with Git.
+With this setting admins can keep better control of which projects are allowed
+to use LFS, thus allowing for better storage usage control.
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index cbb324dd06d..61fcccf2959 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -78,7 +78,7 @@ module API
expose :path, :path_with_namespace
expose :issues_enabled, :merge_requests_enabled, :wiki_enabled, :builds_enabled, :snippets_enabled, :container_registry_enabled
expose :created_at, :last_activity_at
- expose :shared_runners_enabled
+ expose :shared_runners_enabled, :enable_lfs
expose :creator_id
expose :namespace
expose :forked_from_project, using: Entities::BasicProjectDetails, if: lambda{ |project, options| project.forked? }
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 71efd4f33ca..d98fb2611ff 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -105,6 +105,7 @@ module API
# visibility_level (optional) - 0 by default
# import_url (optional)
# public_builds (optional)
+ # enable_lfs (optional)
# Example Request
# POST /projects
post do
@@ -124,7 +125,8 @@ module API
:visibility_level,
:import_url,
:public_builds,
- :only_allow_merge_if_build_succeeds]
+ :only_allow_merge_if_build_succeeds,
+ :enable_lfs]
attrs = map_public_to_visibility_level(attrs)
@project = ::Projects::CreateService.new(current_user, attrs).execute
if @project.saved?
@@ -220,6 +222,7 @@ module API
# public (optional) - if true same as setting visibility_level = 20
# visibility_level (optional) - visibility level of a project
# public_builds (optional)
+ # enable_lfs (optional)
# Example Request
# PUT /projects/:id
put ':id' do
@@ -237,7 +240,8 @@ module API
:public,
:visibility_level,
:public_builds,
- :only_allow_merge_if_build_succeeds]
+ :only_allow_merge_if_build_succeeds,
+ :enable_lfs]
attrs = map_public_to_visibility_level(attrs)
authorize_admin_project
authorize! :rename_project, user_project if attrs[:name].present?