Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 16:49:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 16:49:51 +0300
commit71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch)
tree6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /lib/api/projects.rb
parenta7253423e3403b8c08f8a161e5937e1488f5f407 (diff)
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb34
1 files changed, 32 insertions, 2 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 5077f02fcc1..6eea56ea117 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -9,7 +9,11 @@ module API
before { authenticate_non_get! }
- feature_category :projects, ['/projects/:id/custom_attributes', '/projects/:id/custom_attributes/:key']
+ feature_category :projects, %w[
+ /projects/:id/custom_attributes
+ /projects/:id/custom_attributes/:key
+ /projects/:id/share_locations
+ ]
PROJECT_ATTACHMENT_SIZE_EXEMPT = 1.gigabyte
@@ -351,6 +355,20 @@ module API
render_validation_error!(project)
end
end
+
+ desc 'Returns group that can be shared with the given project' do
+ success Entities::Group
+ end
+ params do
+ requires :id, type: Integer, desc: 'The id of the project'
+ optional :search, type: String, desc: 'Return list of groups matching the search criteria'
+ end
+ get ':id/share_locations' do
+ groups = ::Groups::AcceptingProjectSharesFinder.new(current_user, user_project, declared_params(include_missing: false)).execute
+
+ present_groups groups
+ end
+
# rubocop: enable CodeReuse/ActiveRecord
end
@@ -850,11 +868,23 @@ module API
]
tags %w[projects]
end
+ params do
+ optional :task, type: Symbol, default: :eager, values: %i[eager prune], desc: '`prune` to trigger manual prune of unreachable objects or `eager` to trigger eager housekeeping.'
+ end
post ':id/housekeeping', feature_category: :source_code_management do
authorize_admin_project
begin
- ::Repositories::HousekeepingService.new(user_project, :gc).execute
+ ::Repositories::HousekeepingService.new(user_project, params[:task]).execute do
+ ::Gitlab::Audit::Auditor.audit(
+ name: 'manually_trigger_housekeeping',
+ author: current_user,
+ scope: user_project,
+ target: user_project,
+ message: "Housekeeping task: #{params[:task]}",
+ created_at: DateTime.current
+ )
+ end
rescue ::Repositories::HousekeepingService::LeaseTaken => error
conflict!(error.message)
end