From 2ba1a4080a283d750646b67d73a554c590cfd811 Mon Sep 17 00:00:00 2001
From: Max Fan <mfan@gitlab.com>
Date: Wed, 7 Feb 2024 11:28:50 -0800
Subject: [PATCH] Creating an internal Ci::Pipeline will send an internal event

This is more performant than using database level service pings

Changelog: performance
---
 app/models/ci/pipeline.rb                            |  2 --
 .../track_ci_pipeline_created_event.yml              |  9 ---------
 spec/models/ci/pipeline_spec.rb                      | 12 ------------
 3 files changed, 23 deletions(-)
 delete mode 100644 config/feature_flags/gitlab_com_derisk/track_ci_pipeline_created_event.yml

diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index ff012368e8565..6ed7434397bc4 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -1468,8 +1468,6 @@ def internal_pipeline?
     end
 
     def track_ci_pipeline_created_event
-      return unless Feature.enabled?(:track_ci_pipeline_created_event, project, type: :gitlab_com_derisk)
-
       Gitlab::InternalEvents.track_event('create_ci_internal_pipeline', project: project, user: user)
     end
   end
diff --git a/config/feature_flags/gitlab_com_derisk/track_ci_pipeline_created_event.yml b/config/feature_flags/gitlab_com_derisk/track_ci_pipeline_created_event.yml
deleted file mode 100644
index 4a7379156ae42..0000000000000
--- a/config/feature_flags/gitlab_com_derisk/track_ci_pipeline_created_event.yml
+++ /dev/null
@@ -1,9 +0,0 @@
----
-name: track_ci_pipeline_created_event
-feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/429065
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/142356
-rollout_issue_url: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17445
-milestone: '16.9'
-group: group::pipeline execution
-type: gitlab_com_derisk
-default_enabled: false
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index 74f011e349606..60665f4b779b7 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -190,18 +190,6 @@
           pipeline.save!
         end
       end
-
-      context 'with FF track_ci_pipeline_created_event disabled' do
-        before do
-          stub_feature_flags(track_ci_pipeline_created_event: false)
-        end
-
-        it 'does not track the creation event' do
-          expect(Gitlab::InternalEvents).not_to receive(:track_event)
-
-          pipeline.save!
-        end
-      end
     end
   end
 
-- 
GitLab