Commit db4fc169 authored by Mikołaj Wawrzyniak's avatar Mikołaj Wawrzyniak

Merge branch '333587-delete-composer-callback-ff' into 'master'

Remove disable_composer_callback feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!64336
parents 6fb28b97 99c36e44
......@@ -158,8 +158,6 @@ class Packages::Package < ApplicationRecord
joins(:project).reorder(keyset_order)
end
after_commit :update_composer_cache, on: :destroy, if: -> { composer? && Feature.disabled?(:disable_composer_callback) }
def self.only_maven_packages_with_path(path, use_cte: false)
if use_cte
# This is an optimization fence which assumes that looking up the Metadatum record by path (globally)
......@@ -295,12 +293,6 @@ class Packages::Package < ApplicationRecord
private
def update_composer_cache
return unless composer?
::Packages::Composer::CacheUpdateWorker.perform_async(project_id, name, composer_metadatum.version_cache_sha) # rubocop:disable CodeReuse/Worker
end
def composer_tag_version?
composer? && !Gitlab::Regex.composer_dev_version_regex.match(version.to_s)
end
......
---
name: disable_composer_callback
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64016
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/333587
milestone: '14.0'
type: development
group: group::package
default_enabled: false
......@@ -1006,37 +1006,4 @@ RSpec.describe Packages::Package, type: :model do
it_behaves_like 'not enqueuing a sync worker job'
end
end
context 'destroying a composer package' do
let_it_be(:package_name) { 'composer-package-name' }
let_it_be(:json) { { 'name' => package_name } }
let_it_be(:project) { create(:project, :custom_repo, files: { 'composer.json' => json.to_json } ) }
let!(:package) { create(:composer_package, :with_metadatum, project: project, name: package_name, version: '1.0.0', json: json) }
before do
Gitlab::Composer::Cache.new(project: project, name: package_name).execute
package.composer_metadatum.reload
end
context 'with feature flag disabled' do
before do
stub_feature_flags(disable_composer_callback: false)
end
it 'schedule the update job' do
expect(::Packages::Composer::CacheUpdateWorker).to receive(:perform_async).with(project.id, package_name, package.composer_metadatum.version_cache_sha)
package.destroy!
end
end
context 'with feature flag enabled' do
it 'does nothing' do
expect(::Packages::Composer::CacheUpdateWorker).not_to receive(:perform_async)
package.destroy!
end
end
end
end
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