Commit 99c36e44 authored by Steve Abrams's avatar Steve Abrams

Remove disable_composer_callback feature flag

Removes the disable_composer_callback feature flag
and deletes the composer callback that the
feature flag was disabling.

This callback was not working or needed and was
throwing errors.

Changelog: fixed
parent 3e38f54a
......@@ -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