Commit c92f9dc5 authored by Alper Akgun's avatar Alper Akgun

Merge branch '348677-enable-by-default' into 'master'

Enable `packages_installable_package_files` by default

See merge request gitlab-org/gitlab!78254
parents 2ef40a56 a72b417a
......@@ -9,7 +9,7 @@ module Projects
def show
@package = project.packages.find(params[:id])
@package_files = if Feature.enabled?(:packages_installable_package_files)
@package_files = if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
@package.installable_package_files.recent
else
@package.package_files.recent
......
......@@ -19,7 +19,7 @@ class Packages::PackageFileFinder
private
def package_files
files = if Feature.enabled?(:packages_installable_package_files)
files = if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
package.installable_package_files
else
package.package_files
......
......@@ -37,7 +37,7 @@ module Types
end
def package_files
if Feature.enabled?(:packages_installable_package_files)
if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
object.installable_package_files
else
object.package_files
......
......@@ -97,7 +97,7 @@ module Packages
end
def package_files
if Feature.enabled?(:packages_installable_package_files)
if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
::Packages::PackageFile.installable
.for_package_ids(packages.select(:id))
else
......
......@@ -133,7 +133,7 @@ class Packages::Package < ApplicationRecord
scope :without_nuget_temporary_name, -> { where.not(name: Packages::Nuget::TEMPORARY_PACKAGE_NAME) }
scope :has_version, -> { where.not(version: nil) }
scope :preload_files, -> { Feature.enabled?(:packages_installable_package_files) ? preload(:installable_package_files) : preload(:package_files) }
scope :preload_files, -> { Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml) ? preload(:installable_package_files) : preload(:package_files) }
scope :preload_pipelines, -> { preload(pipelines: :user) }
scope :last_of_each_version, -> { where(id: all.select('MAX(id) AS id').group(:version)) }
scope :limit_recent, ->(limit) { order_created_desc.limit(limit) }
......
......@@ -58,7 +58,7 @@ class Packages::PackageFile < ApplicationRecord
.merge(project.packages.helm.installable)
.joins(:helm_file_metadatum)
.where(packages_helm_file_metadata: { channel: channel })
result = result.installable if Feature.enabled?(:packages_installable_package_files)
result = result.installable if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
result
end
......@@ -109,7 +109,7 @@ class Packages::PackageFile < ApplicationRecord
cte_name = :packages_cte
cte = Gitlab::SQL::CTE.new(cte_name, packages.select(:id))
package_files = if Feature.enabled?(:packages_installable_package_files)
package_files = if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
::Packages::PackageFile.installable.limit_recent(1)
.where(arel_table[:package_id].eq(Arel.sql("#{cte_name}.id")))
else
......
......@@ -81,7 +81,7 @@ module Packages
return unless @package
strong_memoize(:package_files) do
if Feature.enabled?(:packages_installable_package_files)
if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
@package.installable_package_files.preload_conan_file_metadata
else
@package.package_files.preload_conan_file_metadata
......
......@@ -39,7 +39,7 @@ module Packages
private
def package_file_views
package_files = if Feature.enabled?(:packages_installable_package_files)
package_files = if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
@package.installable_package_files
else
@package.package_files
......
......@@ -26,7 +26,7 @@ module Packages
.preload_npm_metadatum
batched_packages.each do |package|
package_file = if Feature.enabled?(:packages_installable_package_files)
package_file = if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
package.installable_package_files.last
else
package.package_files.last
......
......@@ -27,7 +27,7 @@ module Packages
end
def archive_url_for(package)
package_files = if Feature.enabled?(:packages_installable_package_files)
package_files = if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
package.installable_package_files
else
package.package_files
......
......@@ -36,7 +36,7 @@ module Packages
refs = []
@packages.map do |package|
package_files = if Feature.enabled?(:packages_installable_package_files)
package_files = if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
package.installable_package_files
else
package.package_files
......
......@@ -93,7 +93,7 @@ module Packages
def metadata_package_file_for(package)
return unless package
package_files = if Feature.enabled?(:packages_installable_package_files)
package_files = if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
package.installable_package_files
else
package.package_files
......
......@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/348677
milestone: '14.6'
type: development
group: group::package
default_enabled: false
default_enabled: true
......@@ -28,7 +28,7 @@ module API
package = ::Packages::PackageFinder
.new(user_project, params[:package_id]).execute
package_files = if Feature.enabled?(:packages_installable_package_files)
package_files = if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
package.installable_package_files
else
package.package_files
......@@ -55,7 +55,7 @@ module API
not_found! unless package
package_files = if Feature.enabled?(:packages_installable_package_files)
package_files = if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
package.installable_package_files
else
package.package_files
......
......@@ -69,7 +69,7 @@ module API
package_files = ::Packages::PackageFile
.for_rubygem_with_file_name(user_project, params[:file_name])
package_files = package_files.installable if Feature.enabled?(:packages_installable_package_files)
package_files = package_files.installable if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
package_file = package_files.last!
......
......@@ -71,7 +71,7 @@ module API
def package_file
strong_memoize(:package_file) do
if Feature.enabled?(:packages_installable_package_files)
if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml)
package.installable_package_files.first
else
package.package_files.first
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment