From 3eb09abc3546248d6a7c41723c9334cdae785566 Mon Sep 17 00:00:00 2001 From: Tiger Date: Fri, 14 Jul 2023 11:21:30 +1200 Subject: [PATCH] Remove notify_kas_on_git_push feature flag Changelog: added --- app/services/git/base_hooks_service.rb | 1 - .../clusters/agents/notify_git_push_worker.rb | 1 - .../development/notify_kas_on_git_push.yml | 8 -------- doc/user/clusters/agent/gitops.md | 1 + spec/services/git/base_hooks_service_spec.rb | 12 ------------ .../clusters/agents/notify_git_push_worker_spec.rb | 12 ------------ 6 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 config/feature_flags/development/notify_kas_on_git_push.yml diff --git a/app/services/git/base_hooks_service.rb b/app/services/git/base_hooks_service.rb index f9280be7ee2206..6a8e4d17859ecf 100644 --- a/app/services/git/base_hooks_service.rb +++ b/app/services/git/base_hooks_service.rb @@ -83,7 +83,6 @@ def enqueue_invalidate_cache def enqueue_notify_kas return unless Gitlab::Kas.enabled? - return unless Feature.enabled?(:notify_kas_on_git_push, project) Clusters::Agents::NotifyGitPushWorker.perform_async(project.id) end diff --git a/app/workers/clusters/agents/notify_git_push_worker.rb b/app/workers/clusters/agents/notify_git_push_worker.rb index d2994bb9144180..db1de0b3518f4b 100644 --- a/app/workers/clusters/agents/notify_git_push_worker.rb +++ b/app/workers/clusters/agents/notify_git_push_worker.rb @@ -14,7 +14,6 @@ class NotifyGitPushWorker def perform(project_id) return unless project = ::Project.find_by_id(project_id) - return unless Feature.enabled?(:notify_kas_on_git_push, project) Gitlab::Kas::Client.new.send_git_push_event(project: project) end diff --git a/config/feature_flags/development/notify_kas_on_git_push.yml b/config/feature_flags/development/notify_kas_on_git_push.yml deleted file mode 100644 index 32806418bce2d6..00000000000000 --- a/config/feature_flags/development/notify_kas_on_git_push.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: notify_kas_on_git_push -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119168 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/410429 -milestone: '16.0' -type: development -group: group::environments -default_enabled: true diff --git a/doc/user/clusters/agent/gitops.md b/doc/user/clusters/agent/gitops.md index aff78ed477b792..4d33603f77008f 100644 --- a/doc/user/clusters/agent/gitops.md +++ b/doc/user/clusters/agent/gitops.md @@ -78,6 +78,7 @@ For additional repository structure recommendations, see the [Flux documentation > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/392852) in GitLab 16.1 with a [flag](../../../administration/feature_flags.md) named `notify_kas_on_git_push`. Disabled by default. > - [Enabled on GitLab.com and self-managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/126527) in GitLab 16.2. +> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/410429) in GitLab 16.3. Usually, the Flux source controller reconciles Git repositories at configured intervals. This can cause delays between a `git push` and the reconciliation of the cluster state, and results in diff --git a/spec/services/git/base_hooks_service_spec.rb b/spec/services/git/base_hooks_service_spec.rb index 60883db0cd5d02..e083c8d7316d69 100644 --- a/spec/services/git/base_hooks_service_spec.rb +++ b/spec/services/git/base_hooks_service_spec.rb @@ -363,17 +363,5 @@ def commits_count subject.execute end end - - context 'when :notify_kas_on_git_push feature flag is disabled' do - before do - stub_feature_flags(notify_kas_on_git_push: false) - end - - it do - expect(Clusters::Agents::NotifyGitPushWorker).not_to receive(:perform_async) - - subject.execute - end - end end end diff --git a/spec/workers/clusters/agents/notify_git_push_worker_spec.rb b/spec/workers/clusters/agents/notify_git_push_worker_spec.rb index 561a66b86e9d7d..c6ef8dc33383cc 100644 --- a/spec/workers/clusters/agents/notify_git_push_worker_spec.rb +++ b/spec/workers/clusters/agents/notify_git_push_worker_spec.rb @@ -25,17 +25,5 @@ expect { subject }.not_to raise_error end end - - context 'when the :notify_kas_on_git_push feature flag is disabled' do - before do - stub_feature_flags(notify_kas_on_git_push: false) - end - - it 'does not notify KAS' do - expect(Gitlab::Kas::Client).not_to receive(:new) - - subject - end - end end end -- GitLab