From e17f990432cf6100a84d8b75226305edbd712cee Mon Sep 17 00:00:00 2001 From: GitLab Housekeeping Bot Date: Mon, 22 Sep 2025 09:50:12 +0000 Subject: [PATCH] Delete the `add_ai_summary_for_new_mr` feature flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This feature flag was introduced in 16.9, which is more than 4 milestones ago. As part of our process we want to ensure [feature flags don't stay too long in the codebase](https://docs.gitlab.com/ee/development/feature_flags/#types-of-feature-flags). Rollout issue: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17533
Remaining mentions of the feature flag (click to expand) ``` doc-locale/ja-jp/api/graphql/reference/_index.md 45974:2つのブランチに基づいて新しいマージリクエストを要約します。`null`機能フラグが無効になっている場合、`add_ai_summary_for_new_mr`を返します。 doc/api/graphql/reference/_index.md 53917:Summarize a new merge request based on two branches. Returns `null` if the `add_ai_summary_for_new_mr` feature flag is disabled. doc/user/project/merge_requests/duo_in_merge_requests.md 32:- Feature flag `add_ai_summary_for_new_mr` [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/186108) in GitLab 17.11. 35:- [Generally available](https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17533) in GitLab 18.6. Feature flag `add_ai_summary_for_new_mr` removed. ee/spec/support/shared_examples/ai/model_selection_feature_setting_shared_examples.rb 174: review_merge_request: 'add_ai_summary_for_new_mr', ```
**Currently the feature flag is `enabled` on production** It is possible that this MR will still need some changes to remove references to the feature flag in the code. At the moment the `gitlab-housekeeper` is not always capable of removing all references so you must check the diff and pipeline failures to confirm if there are any issues. It is the responsibility of ~"group::code creation" to push those changes to this branch. **Note:** If you do not want to remove this feature flag at this time, you can add an `intended_to_rollout_by_date` attribute in the feature flag YAML file to prevent automated removal. ## TODO for the reviewers before merging this MR - [ ] See the status of the rollout by checking https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17533, https://gitlab.com/gitlab-com/gl-infra/feature-flag-log/-/issues/?search=add_ai_summary_for_new_mr&sort=created_date&state=all&label_name%5B%5D=host%3A%3Agitlab.com - [ ] Verify the feature flag status via chatops by running `/chatops run feature get add_ai_summary_for_new_mr`. - [ ] [Search for references to `AddAiSummaryForNewMr` in frontend part of code](https://gitlab.com/search?project_id=278964&scope=blobs&search=AddAiSummaryForNewMr®ex=false) - [ ] [Search for references to `add_ai_summary_for_new_mr` in code](https://gitlab.com/search?project_id=278964&scope=blobs&search=add_ai_summary_for_new_mr®ex=false) - [ ] Check if we need to remove any Gem or other related code by looking at the changes in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/142739 This change was generated by [gitlab-housekeeper](https://gitlab.com/gitlab-org/gitlab/-/tree/master/gems/gitlab-housekeeper) in [CI](https://gitlab.com/gitlab-org/quality/engineering-productivity/team/-/jobs/11438937864) using the `Keeps::DeleteOldFeatureFlags` keep. To provide feedback on your experience with `gitlab-housekeeper` please create an issue with the label ~"GitLab Housekeeper" and consider pinging the author of this keep. Changelog: removed --- .../project/merge_requests/duo_in_merge_requests.md | 1 + .../ai/summarize_new_merge_request_input_type.rb | 3 +-- .../ai/model_selection/features_configurable.rb | 1 - ee/app/policies/ee/project_policy.rb | 13 ++++++------- .../development/add_ai_summary_for_new_mr.yml | 9 --------- ee/spec/policies/project_policy_spec.rb | 12 ++++-------- .../llm/summarize_new_merge_request_service_spec.rb | 2 +- ...del_selection_feature_setting_shared_examples.rb | 4 ++-- 8 files changed, 15 insertions(+), 30 deletions(-) delete mode 100644 ee/config/feature_flags/development/add_ai_summary_for_new_mr.yml diff --git a/doc/user/project/merge_requests/duo_in_merge_requests.md b/doc/user/project/merge_requests/duo_in_merge_requests.md index b2630dab0eaba6..9f167e8b7b427d 100644 --- a/doc/user/project/merge_requests/duo_in_merge_requests.md +++ b/doc/user/project/merge_requests/duo_in_merge_requests.md @@ -32,6 +32,7 @@ GitLab Duo is designed to provide contextually relevant information during the l - Feature flag `add_ai_summary_for_new_mr` [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/186108) in GitLab 17.11. - Changed to include Premium in GitLab 18.0. - LLM [updated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/193208) to Claude 4.0 Sonnet in GitLab 18.1. +- [Generally available](https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17533) in GitLab 18.6. Feature flag `add_ai_summary_for_new_mr` removed. {{< /history >}} diff --git a/ee/app/graphql/types/ai/summarize_new_merge_request_input_type.rb b/ee/app/graphql/types/ai/summarize_new_merge_request_input_type.rb index f83ffea88b7a36..bbaba0115c68f0 100644 --- a/ee/app/graphql/types/ai/summarize_new_merge_request_input_type.rb +++ b/ee/app/graphql/types/ai/summarize_new_merge_request_input_type.rb @@ -4,8 +4,7 @@ module Types module Ai class SummarizeNewMergeRequestInputType < BaseMethodInputType graphql_name 'AiSummarizeNewMergeRequestInput' - description "Summarize a new merge request based on two branches. " \ - "Returns `null` if the `add_ai_summary_for_new_mr` feature flag is disabled." + description 'Summarize a new merge request based on two branches.' argument :source_project_id, ::GraphQL::Types::ID, required: false, diff --git a/ee/app/models/concerns/ai/model_selection/features_configurable.rb b/ee/app/models/concerns/ai/model_selection/features_configurable.rb index 660d9de30d3908..bac2cc2d5cede5 100644 --- a/ee/app/models/concerns/ai/model_selection/features_configurable.rb +++ b/ee/app/models/concerns/ai/model_selection/features_configurable.rb @@ -34,7 +34,6 @@ module FeaturesConfigurable FEATURES_UNDER_FLAGS = { summarize_review: :summarize_my_code_review, - summarize_new_merge_request: :add_ai_summary_for_new_mr, duo_agent_platform: DUO_AGENT_PLATFORM_FEATURE_FLAG }.freeze # Keys are :feature enum values diff --git a/ee/app/policies/ee/project_policy.rb b/ee/app/policies/ee/project_policy.rb index eb8c148bc9b0f9..b4c6564ad48538 100644 --- a/ee/app/policies/ee/project_policy.rb +++ b/ee/app/policies/ee/project_policy.rb @@ -288,13 +288,12 @@ module ProjectPolicy end condition(:summarize_new_merge_request_enabled) do - ::Feature.enabled?(:add_ai_summary_for_new_mr, subject) && - ::Gitlab::Llm::FeatureAuthorizer.new( - container: subject, - feature_name: :summarize_new_merge_request, - user: @user, - licensed_feature: :summarize_new_merge_request - ).allowed? + ::Gitlab::Llm::FeatureAuthorizer.new( + container: subject, + feature_name: :summarize_new_merge_request, + user: @user, + licensed_feature: :summarize_new_merge_request + ).allowed? end condition(:generate_description_enabled) do diff --git a/ee/config/feature_flags/development/add_ai_summary_for_new_mr.yml b/ee/config/feature_flags/development/add_ai_summary_for_new_mr.yml deleted file mode 100644 index bee2604a9f6ba0..00000000000000 --- a/ee/config/feature_flags/development/add_ai_summary_for_new_mr.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -name: add_ai_summary_for_new_mr -feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/429882 -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/142739 -rollout_issue_url: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17533 -milestone: '16.9' -group: group::code creation -type: development -default_enabled: true diff --git a/ee/spec/policies/project_policy_spec.rb b/ee/spec/policies/project_policy_spec.rb index 17f1c46555d494..06a70d4a3cb495 100644 --- a/ee/spec/policies/project_policy_spec.rb +++ b/ee/spec/policies/project_policy_spec.rb @@ -3681,18 +3681,14 @@ def create_member_role(member, abilities = member_role_abilities) let(:authorizer) { instance_double(::Gitlab::Llm::FeatureAuthorizer) } let(:current_user) { user_can_create_mr ? developer : nil } - where(:feature_flag_enabled, :llm_authorized, :user_can_create_mr, :expected_result) do - true | true | true | be_allowed(:access_summarize_new_merge_request) - true | true | false | be_disallowed(:access_summarize_new_merge_request) - true | false | true | be_disallowed(:access_summarize_new_merge_request) - false | true | true | be_disallowed(:access_summarize_new_merge_request) + where(:llm_authorized, :user_can_create_mr, :expected_result) do + true | true | be_allowed(:access_summarize_new_merge_request) + true | false | be_disallowed(:access_summarize_new_merge_request) + false | true | be_disallowed(:access_summarize_new_merge_request) end with_them do before do - # Setup feature flag - stub_feature_flags(add_ai_summary_for_new_mr: feature_flag_enabled) - # Setup LLM authorizer allow(::Gitlab::Llm::FeatureAuthorizer).to receive(:new).and_return(authorizer) allow(authorizer).to receive(:allowed?).and_return(llm_authorized) diff --git a/ee/spec/services/llm/summarize_new_merge_request_service_spec.rb b/ee/spec/services/llm/summarize_new_merge_request_service_spec.rb index ae076d86d64c8d..c4677c9d2aed66 100644 --- a/ee/spec/services/llm/summarize_new_merge_request_service_spec.rb +++ b/ee/spec/services/llm/summarize_new_merge_request_service_spec.rb @@ -27,7 +27,7 @@ .with(:summarize_new_merge_request, licensed_feature: :summarize_new_merge_request) .and_return(true) - stub_feature_flags(ai_global_switch: true, add_ai_summary_for_new_mr: true) + stub_feature_flags(ai_global_switch: true) # Multiple base permissions are checked before executing this service # so we stub all permission checks to return true to avoid having to stub each one individually diff --git a/ee/spec/support/shared_examples/ai/model_selection_feature_setting_shared_examples.rb b/ee/spec/support/shared_examples/ai/model_selection_feature_setting_shared_examples.rb index 294ca77ae02b95..388d3d1b142cea 100644 --- a/ee/spec/support/shared_examples/ai/model_selection_feature_setting_shared_examples.rb +++ b/ee/spec/support/shared_examples/ai/model_selection_feature_setting_shared_examples.rb @@ -161,7 +161,7 @@ describe '.enabled_features_for' do let(:all_features) do - { code_generations: 0, code_completions: 1, summarize_review: 2, review_merge_request: 3 } + { code_generations: 0, code_completions: 1, summarize_review: 2 } end let(:ga_features) do @@ -213,7 +213,7 @@ context 'when a feature is disabled' do let(:expected_enabled_features) do - { code_generations: 0, code_completions: 1, review_merge_request: 3 } + { code_generations: 0, code_completions: 1 } end before do -- GitLab