Commit deea032d authored by Thong Kuah's avatar Thong Kuah

Merge branch '328393_remove_feature_flag' into 'master'

Explicitly destroy webhooks and logs before the project deletion [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!61995
parents 2a62528c e6f828fc
......@@ -116,7 +116,7 @@ module Projects
log_destroy_event
trash_relation_repositories!
trash_project_repositories!
destroy_web_hooks! if Feature.enabled?(:destroy_webhooks_before_the_project, project, default_enabled: :yaml)
destroy_web_hooks!
# Rails attempts to load all related records into memory before
# destroying: https://github.com/rails/rails/issues/22510
......
---
name: destroy_webhooks_before_the_project
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59754
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/328393
milestone: '13.12'
type: development
group: group::source code
default_enabled: true
......@@ -447,23 +447,6 @@ RSpec.describe Projects::DestroyService, :aggregate_failures do
it_behaves_like 'handles errors thrown during async destroy', "Failed to remove webhooks"
end
context 'when "destroy_webhooks_before_the_project" flag is disabled' do
before do
stub_feature_flags(destroy_webhooks_before_the_project: false)
end
it 'does not call WebHooks::DestroyService' do
expect(WebHooks::DestroyService).not_to receive(:new)
expect do
destroy_project(project, user)
end.to change(WebHook, :count).by(-2)
.and change(WebHookLog, :count).by(-1)
expect(another_project_web_hook.reload).to be
end
end
end
context 'error while destroying', :sidekiq_inline do
......
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