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:
Diffstat (limited to 'lib/api/package_files.rb')
-rw-r--r--lib/api/package_files.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/api/package_files.rb b/lib/api/package_files.rb
index 79ebf18ff27..5e421da2c55 100644
--- a/lib/api/package_files.rb
+++ b/lib/api/package_files.rb
@@ -28,10 +28,15 @@ module API
package = ::Packages::PackageFinder
.new(user_project, params[:package_id]).execute
- files = package.package_files
- .preload_pipelines
+ package_files = if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
+ package.installable_package_files
+ else
+ package.package_files
+ end
- present paginate(files), with: ::API::Entities::PackageFile
+ package_files = package_files.preload_pipelines
+
+ present paginate(package_files), with: ::API::Entities::PackageFile
end
desc 'Remove a package file' do
@@ -50,7 +55,13 @@ module API
not_found! unless package
- package_file = package.package_files.find_by_id(params[:package_file_id])
+ package_files = if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
+ package.installable_package_files
+ else
+ package.package_files
+ end
+
+ package_file = package_files.find_by_id(params[:package_file_id])
not_found! unless package_file