Skip to content
Snippets Groups Projects
Commit 3e0dd0a3 authored by Moaz Khalifa's avatar Moaz Khalifa
Browse files

Release skipping copy operation in generic packages upload

When uploading a generic package, we put the file in a temp location on object store, then copy the file from the temp location to a permanent one. In this MR, we avoid this copy operation and upload the file to its final location from the beginning. This helps save time & cost in packages upload.

Changelog: performance
parent 64904879
No related branches found
No related tags found
1 merge request!148947Release skipping copy operation in generic packages upload
---
name: skip_copy_operation_in_generic_packages_upload
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/429060
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147454
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/450992
milestone: '16.11'
group: group::package registry
type: gitlab_com_derisk
default_enabled: false
......@@ -148,16 +148,11 @@ def max_file_size_exceeded?
def authorize_workhorse_params
project = authorized_user_project
params = {
{
subject: project,
maximum_size: project.actual_limits.generic_packages_max_file_size
maximum_size: project.actual_limits.generic_packages_max_file_size,
use_final_store_path: true
}
if ::Feature.enabled?(:skip_copy_operation_in_generic_packages_upload, project)
params[:use_final_store_path] = true
end
params
end
end
end
......
......@@ -182,20 +182,6 @@ def deploy_token_header(value)
authorize_upload_file(workhorse_headers.merge(personal_access_token_header))
end
context 'when feature flag is disabled' do
before do
stub_feature_flags(skip_copy_operation_in_generic_packages_upload: false)
end
it 'sends use_final_store_path with false' do
expect(::Packages::PackageFileUploader).to receive(:workhorse_authorize).with(
hash_including(use_final_store_path: false)
).and_call_original
authorize_upload_file(workhorse_headers.merge(personal_access_token_header))
end
end
end
def authorize_upload_file(request_headers, package_name: 'mypackage', file_name: 'myfile.tar.gz')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment