From 00a8ca95ce9890bd44a2e077728f83550e5bc805 Mon Sep 17 00:00:00 2001
From: Zamir Martins <zfilho@gitlab.com>
Date: Wed, 10 Apr 2024 13:25:42 +0000
Subject: [PATCH] Remove ff and policy information related to

auto_fix.

Changelog: removed
---
 .../security/configuration_presenter.rb       | 10 ---
 app/views/users/_overview.html.haml           | 19 +++---
 app/views/users/_profile_sidebar.html.haml    |  2 -
 app/views/users/show.html.haml                | 61 +++++++++----------
 .../development/security_auto_fix.yml         |  8 ---
 .../projects/security/dashboard_controller.rb |  4 --
 .../models/gitlab_subscriptions/features.rb   |  1 -
 ee/app/models/project_security_setting.rb     | 18 ------
 ee/app/policies/ee/project_policy.rb          |  7 +--
 .../vulnerabilities/feedback_policy.rb        |  6 +-
 .../security/configuration_presenter.rb       | 18 ------
 .../models/project_security_setting_spec.rb   | 45 --------------
 ee/spec/policies/project_policy_spec.rb       | 44 ++-----------
 .../vulnerabilities/feedback_policy_spec.rb   | 20 ++----
 .../security/configuration_presenter_spec.rb  | 15 +----
 lib/gitlab/gon_helper.rb                      |  1 -
 locale/gitlab.pot                             |  3 -
 spec/features/users/overview_spec.rb          | 36 ++---------
 spec/features/users/show_spec.rb              | 49 ++++-----------
 .../security/configuration_presenter_spec.rb  |  4 --
 20 files changed, 72 insertions(+), 299 deletions(-)
 delete mode 100644 config/feature_flags/development/security_auto_fix.yml

diff --git a/app/presenters/projects/security/configuration_presenter.rb b/app/presenters/projects/security/configuration_presenter.rb
index 64127c9ac3edd..ec82ef5ee4410 100644
--- a/app/presenters/projects/security/configuration_presenter.rb
+++ b/app/presenters/projects/security/configuration_presenter.rb
@@ -19,9 +19,6 @@ def to_h
           latest_pipeline_path: latest_pipeline_path,
           gitlab_ci_present: project.has_ci_config_file?,
           gitlab_ci_history_path: gitlab_ci_history_path,
-          auto_fix_enabled: autofix_enabled,
-          can_toggle_auto_fix_settings: can_toggle_autofix,
-          auto_fix_user_path: auto_fix_user_path,
           security_training_enabled: project.security_training_available?,
           continuous_vulnerability_scans_enabled: continuous_vulnerability_scans_enabled,
           container_scanning_for_registry_enabled: container_scanning_for_registry_enabled,
@@ -32,25 +29,18 @@ def to_h
       def to_html_data_attribute
         data = to_h
         data[:features] = data[:features].to_json
-        data[:auto_fix_enabled] = data[:auto_fix_enabled].to_json
 
         data
       end
 
       private
 
-      def autofix_enabled; end
-
-      def auto_fix_user_path; end
-
       def can_enable_auto_devops?
         feature_available?(:builds, current_user) &&
           can?(current_user, :admin_project, self) &&
           !archived?
       end
 
-      def can_toggle_autofix; end
-
       def gitlab_ci_history_path
         return '' if project.empty_repo?
 
diff --git a/app/views/users/_overview.html.haml b/app/views/users/_overview.html.haml
index 7636ad8c55266..54fae6840f6f9 100644
--- a/app/views/users/_overview.html.haml
+++ b/app/views/users/_overview.html.haml
@@ -21,7 +21,7 @@
     .activities-block
       .gl-display-flex.gl-align-items-baseline
         %h2.gl-heading-3.gl-flex-grow-1{ class: 'gl-mt-5! gl-mb-3!' }
-          = Feature.enabled?(:security_auto_fix) && @user.bot? ? s_('UserProfile|Bot activity') : s_('UserProfile|Activity')
+          = s_('UserProfile|Activity')
         = link_to s_('UserProfile|View all'), user_activity_path, class: "hide js-view-all"
 
       .user-calendar.gl-border.light.gl-rounded-base.gl-px-3.gl-pt-4.gl-text-center{ data: { calendar_path: user_calendar_path(@user, :json), calendar_activities_path: user_calendar_activities_path, utc_offset: local_timezone_instance(@user.timezone).now.utc_offset } }
@@ -35,12 +35,11 @@
       .overview-content-list.user-activity-content.gl-mb-5{ data: { href: user_activity_path, testid: 'user-activity-content' } }
         = gl_loading_icon(size: 'md', css_class: 'loading')
 
-- unless Feature.enabled?(:security_auto_fix) && @user.bot?
-  - if @user.personal_projects.any?
-    .projects-block.gl-w-full
-      .gl-display-flex.gl-align-items-baseline
-        %h2.gl-heading-3.gl-flex-grow-1{ class: 'gl-mt-5! gl-mb-3!' }
-          = s_('UserProfile|Personal projects')
-        = link_to s_('UserProfile|View all'), user_projects_path, class: "hide js-view-all"
-      .overview-content-list{ data: { href: user_projects_path } }
-        = gl_loading_icon(size: 'md', css_class: 'loading')
+- if @user.personal_projects.any?
+  .projects-block.gl-w-full
+    .gl-display-flex.gl-align-items-baseline
+      %h2.gl-heading-3.gl-flex-grow-1{ class: 'gl-mt-5! gl-mb-3!' }
+        = s_('UserProfile|Personal projects')
+      = link_to s_('UserProfile|View all'), user_projects_path, class: "hide js-view-all"
+    .overview-content-list{ data: { href: user_projects_path } }
+      = gl_loading_icon(size: 'md', css_class: 'loading')
diff --git a/app/views/users/_profile_sidebar.html.haml b/app/views/users/_profile_sidebar.html.haml
index 4886a158f5d1a..4ae1083572fbc 100644
--- a/app/views/users/_profile_sidebar.html.haml
+++ b/app/views/users/_profile_sidebar.html.haml
@@ -52,8 +52,6 @@
                 %h2.gl-font-base.gl-mb-2.gl-mt-4= s_('UserProfile|Contact')
                 - if @user.website_url.present?
                   .gl-display-flex.gl-gap-2.gl-mb-2
-                    - if Feature.enabled?(:security_auto_fix) && @user.bot?
-                      = sprite_icon('question-o', css_class: 'gl-text-blue-500')
                     = sprite_icon('earth', css_class: 'fgray gl-mt-1 flex-shrink-0')
                     = link_to @user.short_website_url, @user.full_website_url, class: 'gl-text-gray-900', target: '_blank', rel: 'me noopener noreferrer nofollow', itemprop: 'url'
                 - if display_public_email?(@user)
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index 640650c8692c4..407c69c9b9dd9 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -118,34 +118,33 @@
             %li.js-activity-tab
               = link_to user_activity_path, data: { target: 'div#activity', action: 'activity', toggle: 'tab' } do
                 = s_('UserProfile|Activity')
-          - unless Feature.enabled?(:security_auto_fix) && @user.bot?
-            - if profile_tab?(:groups)
-              %li.js-groups-tab
-                = link_to user_groups_path, data: { target: 'div#groups', action: 'groups', toggle: 'tab', endpoint: user_groups_path(format: :json) } do
-                  = s_('UserProfile|Groups')
-            - if profile_tab?(:contributed)
-              %li.js-contributed-tab
-                = link_to user_contributed_projects_path, data: { target: 'div#contributed', action: 'contributed', toggle: 'tab', endpoint: user_contributed_projects_path(format: :json) } do
-                  = s_('UserProfile|Contributed projects')
-            - if profile_tab?(:projects)
-              %li.js-projects-tab
-                = link_to user_projects_path, data: { target: 'div#projects', action: 'projects', toggle: 'tab', endpoint: user_projects_path(format: :json) } do
-                  = s_('UserProfile|Personal projects')
-            - if profile_tab?(:starred)
-              %li.js-starred-tab
-                = link_to user_starred_projects_path, data: { target: 'div#starred', action: 'starred', toggle: 'tab', endpoint: user_starred_projects_path(format: :json), card_mode: true } do
-                  = s_('UserProfile|Starred projects')
-            - if profile_tab?(:snippets)
-              %li.js-snippets-tab
-                = link_to user_snippets_path, data: { target: 'div#snippets', action: 'snippets', toggle: 'tab', endpoint: user_snippets_path(format: :json) } do
-                  = s_('UserProfile|Snippets')
-            - if profile_tab?(:followers)
-              %li.js-followers-tab
-                = link_to user_followers_path, data: { target: 'div#followers', action: 'followers', toggle: 'tab', endpoint: user_followers_path(format: :json) } do
-                  = s_('UserProfile|Followers')
-                  = gl_badge_tag @user.followers.count, size: :sm
-            - if profile_tab?(:following)
-              %li.js-following-tab
-                = link_to user_following_path, data: { target: 'div#following', action: 'following', toggle: 'tab', endpoint: user_following_path(format: :json), testid: 'following_tab' } do
-                  = s_('UserProfile|Following')
-                  = gl_badge_tag @user.followees.count, size: :sm
+          - if profile_tab?(:groups)
+            %li.js-groups-tab
+              = link_to user_groups_path, data: { target: 'div#groups', action: 'groups', toggle: 'tab', endpoint: user_groups_path(format: :json) } do
+                = s_('UserProfile|Groups')
+          - if profile_tab?(:contributed)
+            %li.js-contributed-tab
+              = link_to user_contributed_projects_path, data: { target: 'div#contributed', action: 'contributed', toggle: 'tab', endpoint: user_contributed_projects_path(format: :json) } do
+                = s_('UserProfile|Contributed projects')
+          - if profile_tab?(:projects)
+            %li.js-projects-tab
+              = link_to user_projects_path, data: { target: 'div#projects', action: 'projects', toggle: 'tab', endpoint: user_projects_path(format: :json) } do
+                = s_('UserProfile|Personal projects')
+          - if profile_tab?(:starred)
+            %li.js-starred-tab
+              = link_to user_starred_projects_path, data: { target: 'div#starred', action: 'starred', toggle: 'tab', endpoint: user_starred_projects_path(format: :json), card_mode: true } do
+                = s_('UserProfile|Starred projects')
+          - if profile_tab?(:snippets)
+            %li.js-snippets-tab
+              = link_to user_snippets_path, data: { target: 'div#snippets', action: 'snippets', toggle: 'tab', endpoint: user_snippets_path(format: :json) } do
+                = s_('UserProfile|Snippets')
+          - if profile_tab?(:followers)
+            %li.js-followers-tab
+              = link_to user_followers_path, data: { target: 'div#followers', action: 'followers', toggle: 'tab', endpoint: user_followers_path(format: :json) } do
+                = s_('UserProfile|Followers')
+                = gl_badge_tag @user.followers.count, size: :sm
+          - if profile_tab?(:following)
+            %li.js-following-tab
+              = link_to user_following_path, data: { target: 'div#following', action: 'following', toggle: 'tab', endpoint: user_following_path(format: :json), testid: 'following_tab' } do
+                = s_('UserProfile|Following')
+                = gl_badge_tag @user.followees.count, size: :sm
diff --git a/config/feature_flags/development/security_auto_fix.yml b/config/feature_flags/development/security_auto_fix.yml
deleted file mode 100644
index 8cbb227728cd2..0000000000000
--- a/config/feature_flags/development/security_auto_fix.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: security_auto_fix
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/30530
-rollout_issue_url: 
-milestone: '13.0'
-type: development
-group: group::composition analysis
-default_enabled: false
diff --git a/ee/app/controllers/projects/security/dashboard_controller.rb b/ee/app/controllers/projects/security/dashboard_controller.rb
index 0ee233b9d2ced..468c86520e9de 100644
--- a/ee/app/controllers/projects/security/dashboard_controller.rb
+++ b/ee/app/controllers/projects/security/dashboard_controller.rb
@@ -9,10 +9,6 @@ class DashboardController < Projects::ApplicationController
 
       alias_method :vulnerable, :project
 
-      before_action only: [:index] do
-        push_frontend_feature_flag(:security_auto_fix, project)
-      end
-
       feature_category :vulnerability_management
       urgency :low
       track_govern_activity 'security_dashboard', :index
diff --git a/ee/app/models/gitlab_subscriptions/features.rb b/ee/app/models/gitlab_subscriptions/features.rb
index a7c033cb64e60..9f29fa90ff6e9 100644
--- a/ee/app/models/gitlab_subscriptions/features.rb
+++ b/ee/app/models/gitlab_subscriptions/features.rb
@@ -255,7 +255,6 @@ class Features
       subepics
       tracing
       unique_project_download_limit
-      vulnerability_auto_fix
       vulnerability_finding_signatures
     ].freeze
 
diff --git a/ee/app/models/project_security_setting.rb b/ee/app/models/project_security_setting.rb
index b0860d7509e06..fc2ccb6ac7b3e 100644
--- a/ee/app/models/project_security_setting.rb
+++ b/ee/app/models/project_security_setting.rb
@@ -3,26 +3,8 @@
 class ProjectSecuritySetting < ApplicationRecord
   self.primary_key = :project_id
 
-  # Note: Even if we store settings for all types of security scanning
-  # Currently, Auto-fix feature is available only for container_scanning and
-  # dependency_scanning features.
-  AVAILABLE_AUTO_FIX_TYPES = [:dependency_scanning, :container_scanning].freeze
-
   belongs_to :project, inverse_of: :security_setting
 
-  def auto_fix_enabled?
-    return false if Feature.disabled?(:security_auto_fix, project)
-    return false unless project.feature_available?(:vulnerability_auto_fix)
-
-    auto_fix_enabled_types.any?
-  end
-
-  def auto_fix_enabled_types
-    AVAILABLE_AUTO_FIX_TYPES.filter_map do |type|
-      type if public_send("auto_fix_#{type}") # rubocop:disable GitlabSecurity/PublicSend
-    end
-  end
-
   def set_continuous_vulnerability_scans!(enabled:)
     enabled if update!(continuous_vulnerability_scans_enabled: enabled)
   end
diff --git a/ee/app/policies/ee/project_policy.rb b/ee/app/policies/ee/project_policy.rb
index 2440bcde14fe1..cfb282df78155 100644
--- a/ee/app/policies/ee/project_policy.rb
+++ b/ee/app/policies/ee/project_policy.rb
@@ -11,9 +11,6 @@ module ProjectPolicy
       desc "User is a security policy bot on the project"
       condition(:security_policy_bot) { user&.security_policy_bot? && team_member? }
 
-      with_scope :subject
-      condition(:auto_fix_enabled) { @subject.security_setting&.auto_fix_enabled? }
-
       with_scope :subject
       condition(:repository_mirrors_enabled) { @subject.feature_available?(:repository_mirrors) }
 
@@ -560,7 +557,7 @@ module ProjectPolicy
         prevent :read_vulnerability
       end
 
-      rule { security_bot & auto_fix_enabled }.policy do
+      rule { security_bot }.policy do
         enable :push_code
         enable :create_merge_request_from
         enable :create_vulnerability_feedback
@@ -946,7 +943,7 @@ module ProjectPolicy
     def lookup_access_level!
       return ::Gitlab::Access::NO_ACCESS if needs_new_sso_session?
       return ::Gitlab::Access::NO_ACCESS if visual_review_bot?
-      return ::Gitlab::Access::REPORTER if security_bot? && auto_fix_enabled?
+      return ::Gitlab::Access::REPORTER if security_bot?
 
       super
     end
diff --git a/ee/app/policies/vulnerabilities/feedback_policy.rb b/ee/app/policies/vulnerabilities/feedback_policy.rb
index 041da119cd590..f06b5fbc35170 100644
--- a/ee/app/policies/vulnerabilities/feedback_policy.rb
+++ b/ee/app/policies/vulnerabilities/feedback_policy.rb
@@ -7,9 +7,6 @@ class FeedbackPolicy < BasePolicy
     condition(:issue, scope: :subject) { @subject.for_issue? }
     condition(:merge_request, scope: :subject) { @subject.for_merge_request? }
     condition(:dismissal, scope: :subject) { @subject.for_dismissal? }
-    condition(:auto_fix_enabled, scope: :subject) do
-      @subject.project.security_setting&.auto_fix_enabled?
-    end
 
     rule { issue & ~can?(:create_issue) }.prevent :create_vulnerability_feedback
 
@@ -21,8 +18,7 @@ class FeedbackPolicy < BasePolicy
     # if auto-fix feature is disabled
     rule do
       merge_request &
-        security_bot &
-        ~auto_fix_enabled
+        security_bot
     end.prevent :create_vulnerability_feedback
 
     rule { ~dismissal }.prevent :destroy_vulnerability_feedback, :update_vulnerability_feedback
diff --git a/ee/app/presenters/ee/projects/security/configuration_presenter.rb b/ee/app/presenters/ee/projects/security/configuration_presenter.rb
index 92239f6715f1b..24e60d1fa103f 100644
--- a/ee/app/presenters/ee/projects/security/configuration_presenter.rb
+++ b/ee/app/presenters/ee/projects/security/configuration_presenter.rb
@@ -8,24 +8,6 @@ module ConfigurationPresenter
 
         private
 
-        override :can_toggle_autofix
-        def can_toggle_autofix
-          try(:auto_fix_permission)
-        end
-
-        override :autofix_enabled
-        def autofix_enabled
-          {
-            dependency_scanning: project_settings&.auto_fix_dependency_scanning,
-            container_scanning: project_settings&.auto_fix_container_scanning
-          }
-        end
-
-        override :auto_fix_user_path
-        def auto_fix_user_path
-          '/' # TODO: real link will be updated with https://gitlab.com/gitlab-org/gitlab/-/issues/348463
-        end
-
         override :continuous_vulnerability_scans_enabled
         def continuous_vulnerability_scans_enabled
           project_settings&.continuous_vulnerability_scans_enabled
diff --git a/ee/spec/models/project_security_setting_spec.rb b/ee/spec/models/project_security_setting_spec.rb
index 8a7089d98cc22..00cc84a5afed0 100644
--- a/ee/spec/models/project_security_setting_spec.rb
+++ b/ee/spec/models/project_security_setting_spec.rb
@@ -11,51 +11,6 @@
     it { is_expected.to belong_to(:project) }
   end
 
-  describe '#auto_fix_enabled?' do
-    subject { setting.auto_fix_enabled? }
-
-    let(:setting) { build(:project_security_setting) }
-
-    where(:license, :feature_flag, :auto_fix_container_scanning, :auto_fix_dependency_scanning, :auto_fix_sast, :auto_fix_enabled?) do
-      true   | true  | true  | true  | true  | true
-      false  | true  | true  | true  | true  | false
-      true   | false | true  | true  | true  | false
-      true   | true  | false | true  | true  | true
-      true   | true  | true  | false | true  | true
-      true   | true  | false | false | true  | false
-      true   | true  | true  | true  | false | true
-    end
-
-    with_them do
-      before do
-        stub_licensed_features(vulnerability_auto_fix: license)
-        stub_feature_flags(security_auto_fix: feature_flag)
-
-        setting.auto_fix_container_scanning = auto_fix_container_scanning
-        setting.auto_fix_dependency_scanning = auto_fix_dependency_scanning
-        setting.auto_fix_sast = auto_fix_sast
-      end
-
-      it { is_expected.to eq(auto_fix_enabled?) }
-    end
-  end
-
-  describe '#auto_fix_enabled_types' do
-    subject { setting.auto_fix_enabled_types }
-
-    let_it_be(:setting) { build(:project_security_setting) }
-
-    before do
-      setting.auto_fix_container_scanning = false
-      setting.auto_fix_dependency_scanning = true
-      setting.auto_fix_sast = true
-    end
-
-    it 'return status only for available types' do
-      is_expected.to eq([:dependency_scanning])
-    end
-  end
-
   describe '#set_continuous_vulnerability_scans' do
     where(:value_before, :enabled, :value_after) do
       true  | false | false
diff --git a/ee/spec/policies/project_policy_spec.rb b/ee/spec/policies/project_policy_spec.rb
index 17a0224c9ad8b..f38c038b383d6 100644
--- a/ee/spec/policies/project_policy_spec.rb
+++ b/ee/spec/policies/project_policy_spec.rb
@@ -847,50 +847,18 @@
       ]
     end
 
-    context 'when auto_fix feature is enabled' do
-      context 'when licensed feature is enabled' do
-        before do
-          stub_licensed_features(vulnerability_auto_fix: true)
-        end
-
-        it { is_expected.to be_allowed(*permissions) }
-
-        context 'when feature flag is disabled' do
-          before do
-            stub_feature_flags(security_auto_fix: false)
-          end
-
-          it { is_expected.to be_disallowed(*permissions) }
-        end
-      end
-
-      context 'when licensed feature is disabled' do
-        before do
-          stub_licensed_features(vulnerability_auto_fix: false)
-        end
-
-        it { is_expected.to be_disallowed(*permissions) }
-      end
-    end
-
-    context 'when auto_fix feature is disabled' do
-      before do
-        stub_licensed_features(vulnerability_auto_fix: true)
-        project.security_setting.update!(auto_fix_dependency_scanning: false, auto_fix_container_scanning: false)
-      end
-
-      it { is_expected.to be_disallowed(*permissions) }
-    end
-
     context 'when project does not have a security_setting' do
       before do
-        stub_licensed_features(vulnerability_auto_fix: true)
         project.security_setting.delete
         project.reload
       end
 
-      it do
-        is_expected.to be_disallowed(*permissions)
+      it { is_expected.to be_allowed(*permissions) }
+
+      context 'with user other than security bot' do
+        let_it_be(:current_user) { create(:user) }
+
+        it { is_expected.to be_disallowed(*permissions) }
       end
     end
   end
diff --git a/ee/spec/policies/vulnerabilities/feedback_policy_spec.rb b/ee/spec/policies/vulnerabilities/feedback_policy_spec.rb
index c022b79580fc8..16c053ec2bd57 100644
--- a/ee/spec/policies/vulnerabilities/feedback_policy_spec.rb
+++ b/ee/spec/policies/vulnerabilities/feedback_policy_spec.rb
@@ -77,23 +77,13 @@
         let_it_be_with_reload(:project) { create(:project, :public) }
 
         before do
-          stub_licensed_features(vulnerability_auto_fix: true)
+          project.security_setting.update!(
+            auto_fix_dependency_scanning: false,
+            auto_fix_container_scanning: false
+          )
         end
 
-        context 'when auto-fix is enabled' do
-          it { is_expected.to be_allowed(:create_vulnerability_feedback) }
-        end
-
-        context 'when auto-fix is disabled' do
-          before do
-            project.security_setting.update!(
-              auto_fix_dependency_scanning: false,
-              auto_fix_container_scanning: false
-            )
-          end
-
-          it { is_expected.to be_disallowed(:create_vulnerability_feedback) }
-        end
+        it { is_expected.to be_disallowed(:create_vulnerability_feedback) }
       end
     end
   end
diff --git a/ee/spec/presenters/ee/projects/security/configuration_presenter_spec.rb b/ee/spec/presenters/ee/projects/security/configuration_presenter_spec.rb
index 92818638ebc4a..7efaa15bdfaa5 100644
--- a/ee/spec/presenters/ee/projects/security/configuration_presenter_spec.rb
+++ b/ee/spec/presenters/ee/projects/security/configuration_presenter_spec.rb
@@ -9,18 +9,7 @@
   let_it_be(:current_user) { create(:user) }
 
   describe '#to_h' do
-    subject(:result) { described_class.new(project, auto_fix_permission: true, current_user: current_user).to_h }
-
-    it 'includes settings for auto_fix feature' do
-      auto_fix = result[:auto_fix_enabled]
-
-      expect(auto_fix[:dependency_scanning]).to be_truthy
-      expect(auto_fix[:container_scanning]).to be_truthy
-    end
-
-    it 'reports auto_fix permissions' do
-      expect(result[:can_toggle_auto_fix_settings]).to be_truthy
-    end
+    subject(:result) { described_class.new(project, current_user: current_user).to_h }
 
     it 'reports security_training_enabled' do
       allow(project).to receive(:security_training_available?).and_return(true)
@@ -42,7 +31,7 @@
   end
 
   describe '#to_html_data_attribute' do
-    subject(:result) { described_class.new(project, auto_fix_permission: true, current_user: current_user).to_h }
+    subject(:result) { described_class.new(project, current_user: current_user).to_h }
 
     before do
       stub_licensed_features(security_on_demand_scans: true, security_configuration_in_ui: true)
diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb
index 64e2fec9cc44f..e903b033045d6 100644
--- a/lib/gitlab/gon_helper.rb
+++ b/lib/gitlab/gon_helper.rb
@@ -72,7 +72,6 @@ def add_gon_variables
 
       # Initialize gon.features with any flags that should be
       # made globally available to the frontend
-      push_frontend_feature_flag(:security_auto_fix)
       push_frontend_feature_flag(:source_editor_toolbar)
       push_frontend_feature_flag(:vscode_web_ide, current_user)
       push_frontend_feature_flag(:ui_for_organizations, current_user)
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index b93868c4d5aca..f3c129d0befbb 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -55602,9 +55602,6 @@ msgstr ""
 msgid "UserProfile|Blocked user"
 msgstr ""
 
-msgid "UserProfile|Bot activity"
-msgstr ""
-
 msgid "UserProfile|Busy"
 msgstr ""
 
diff --git a/spec/features/users/overview_spec.rb b/spec/features/users/overview_spec.rb
index 727b87c69dd8c..cc3251960ce4d 100644
--- a/spec/features/users/overview_spec.rb
+++ b/spec/features/users/overview_spec.rb
@@ -267,40 +267,16 @@ def push_code_contribution
       end
     end
 
-    describe 'feature flag enabled' do
-      before do
-        stub_feature_flags(security_auto_fix: true)
-      end
-
-      include_context "visit bot's overview tab"
-
-      it "activity panel's title is 'Bot activity'" do
-        page.within('.activities-block') do
-          expect(page).to have_text('Bot activity')
-        end
-      end
+    include_context "visit bot's overview tab"
 
-      it 'does not show projects panel' do
-        expect(page).not_to have_selector('.projects-block')
+    it "activity panel's title is 'Activity'" do
+      page.within('.activities-block') do
+        expect(page).to have_text('Activity')
       end
     end
 
-    describe 'feature flag disabled' do
-      before do
-        stub_feature_flags(security_auto_fix: false)
-      end
-
-      include_context "visit bot's overview tab"
-
-      it "activity panel's title is not 'Bot activity'" do
-        page.within('.activities-block') do
-          expect(page).not_to have_text('Bot activity')
-        end
-      end
-
-      it 'shows projects panel' do
-        expect(page).not_to have_selector('.projects-block')
-      end
+    it 'does not show projects panel' do
+      expect(page).not_to have_selector('.projects-block')
     end
   end
 
diff --git a/spec/features/users/show_spec.rb b/spec/features/users/show_spec.rb
index b5d40c298ac22..996a8bcb296dd 100644
--- a/spec/features/users/show_spec.rb
+++ b/spec/features/users/show_spec.rb
@@ -467,45 +467,18 @@
       stub_feature_flags(profile_tabs_vue: false)
     end
 
-    describe 'feature flag enabled' do
-      before do
-        stub_feature_flags(security_auto_fix: true)
-      end
-
-      it 'only shows Overview and Activity tabs' do
-        subject
-
-        page.within '.nav-links' do
-          expect(page).to have_link('Overview')
-          expect(page).to have_link('Activity')
-          expect(page).not_to have_link('Groups')
-          expect(page).not_to have_link('Contributed projects')
-          expect(page).not_to have_link('Personal projects')
-          expect(page).not_to have_link('Snippets')
-          expect(page).not_to have_link('Followers')
-          expect(page).not_to have_link('Following')
-        end
-      end
-    end
-
-    describe 'feature flag disabled' do
-      before do
-        stub_feature_flags(security_auto_fix: false)
-      end
-
-      it 'only shows Overview and Activity tabs' do
-        subject
+    it 'only shows Overview and Activity tabs' do
+      subject
 
-        page.within '.nav-links' do
-          expect(page).to have_link('Overview')
-          expect(page).to have_link('Activity')
-          expect(page).to have_link('Groups')
-          expect(page).to have_link('Contributed projects')
-          expect(page).to have_link('Personal projects')
-          expect(page).to have_link('Snippets')
-          expect(page).to have_link('Followers')
-          expect(page).to have_link('Following')
-        end
+      page.within '.nav-links' do
+        expect(page).to have_link('Overview')
+        expect(page).to have_link('Activity')
+        expect(page).to have_link('Groups')
+        expect(page).to have_link('Contributed projects')
+        expect(page).to have_link('Personal projects')
+        expect(page).to have_link('Snippets')
+        expect(page).to have_link('Followers')
+        expect(page).to have_link('Following')
       end
     end
   end
diff --git a/spec/presenters/projects/security/configuration_presenter_spec.rb b/spec/presenters/projects/security/configuration_presenter_spec.rb
index 9f6efb08fb131..8be7938ad5d71 100644
--- a/spec/presenters/projects/security/configuration_presenter_spec.rb
+++ b/spec/presenters/projects/security/configuration_presenter_spec.rb
@@ -47,10 +47,6 @@
         expect(html_data[:latest_pipeline_path]).to eq(project_pipeline_path(project, pipeline))
       end
 
-      it 'has stubs for autofix' do
-        expect(html_data.keys).to include(:can_toggle_auto_fix_settings, :auto_fix_enabled, :auto_fix_user_path)
-      end
-
       context "while retrieving information about user's ability to enable auto_devops" do
         where(:is_admin, :archived, :feature_available, :result) do
           true     | true      | true   | false
-- 
GitLab