Remove feature flag for suggest changes feature

This commit is contained in:
Oswaldo Ferreira 2018-12-17 19:58:00 -02:00
parent aa2c729e8e
commit ee425c9cf8
5 changed files with 4 additions and 20 deletions

View file

@ -364,8 +364,7 @@ class MergeRequest < ActiveRecord::Base
end end
def supports_suggestion? def supports_suggestion?
# Should be `true` when removing the FF. true
Suggestion.feature_enabled?
end end
# Calls `MergeWorker` to proceed with the merge process and # Calls `MergeWorker` to proceed with the merge process and

View file

@ -1,8 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
class Suggestion < ApplicationRecord class Suggestion < ApplicationRecord
FEATURE_FLAG = :diff_suggestions
belongs_to :note, inverse_of: :suggestions belongs_to :note, inverse_of: :suggestions
validates :note, presence: true validates :note, presence: true
validates :commit_id, presence: true, if: :applied? validates :commit_id, presence: true, if: :applied?
@ -10,10 +8,6 @@ class Suggestion < ApplicationRecord
delegate :original_position, :position, :diff_file, delegate :original_position, :position, :diff_file,
:noteable, to: :note :noteable, to: :note
def self.feature_enabled?
Feature.enabled?(FEATURE_FLAG)
end
def project def project
noteable.source_project noteable.source_project
end end

View file

@ -5,6 +5,7 @@
- page_title "#{@merge_request.title} (#{@merge_request.to_reference})", "Merge Requests" - page_title "#{@merge_request.title} (#{@merge_request.to_reference})", "Merge Requests"
- page_description @merge_request.description - page_description @merge_request.description
- page_card_attributes @merge_request.card_attributes - page_card_attributes @merge_request.card_attributes
- suggest_changes_help_path = help_page_path('user/discussions/index.md', anchor: 'suggest-changes')
.merge-request{ data: { mr_action: j(params[:tab].presence || 'show'), url: merge_request_path(@merge_request, format: :json), project_path: project_path(@merge_request.project) } } .merge-request{ data: { mr_action: j(params[:tab].presence || 'show'), url: merge_request_path(@merge_request, format: :json), project_path: project_path(@merge_request.project) } }
= render "projects/merge_requests/mr_title" = render "projects/merge_requests/mr_title"
@ -67,7 +68,7 @@
noteable_data: serialize_issuable(@merge_request), noteable_data: serialize_issuable(@merge_request),
noteable_type: 'MergeRequest', noteable_type: 'MergeRequest',
target_type: 'merge_request', target_type: 'merge_request',
help_page_path: nil, help_page_path: suggest_changes_help_path,
current_user_data: UserSerializer.new(project: @project).represent(current_user, {}, MergeRequestUserEntity).to_json} } current_user_data: UserSerializer.new(project: @project).represent(current_user, {}, MergeRequestUserEntity).to_json} }
#commits.commits.tab-pane #commits.commits.tab-pane
@ -77,7 +78,7 @@
= render 'projects/commit/pipelines_list', disable_initialization: true, endpoint: pipelines_project_merge_request_path(@project, @merge_request) = render 'projects/commit/pipelines_list', disable_initialization: true, endpoint: pipelines_project_merge_request_path(@project, @merge_request)
#js-diffs-app.diffs.tab-pane{ data: { "is-locked" => @merge_request.discussion_locked?, #js-diffs-app.diffs.tab-pane{ data: { "is-locked" => @merge_request.discussion_locked?,
endpoint: diffs_project_merge_request_path(@project, @merge_request, 'json', request.query_parameters), endpoint: diffs_project_merge_request_path(@project, @merge_request, 'json', request.query_parameters),
help_page_path: nil, help_page_path: suggest_changes_help_path,
current_user_data: UserSerializer.new(project: @project).represent(current_user, {}, MergeRequestUserEntity).to_json, current_user_data: UserSerializer.new(project: @project).represent(current_user, {}, MergeRequestUserEntity).to_json,
project_path: project_path(@merge_request.project), project_path: project_path(@merge_request.project),
changes_empty_state_illustration: image_path('illustrations/merge_request_changes_empty.svg') } } changes_empty_state_illustration: image_path('illustrations/merge_request_changes_empty.svg') } }

View file

@ -7,7 +7,6 @@ module Banzai
TAG_CLASS = 'js-render-suggestion'.freeze TAG_CLASS = 'js-render-suggestion'.freeze
def call def call
return doc unless Suggestion.feature_enabled?
return doc unless suggestions_filter_enabled? return doc unless suggestions_filter_enabled?
doc.search('pre.suggestion > code').each do |node| doc.search('pre.suggestion > code').each do |node|

View file

@ -17,15 +17,6 @@ describe Banzai::Filter::SuggestionFilter do
expect(result[:class]).to include('js-render-suggestion') expect(result[:class]).to include('js-render-suggestion')
end end
it 'includes no `js-render-suggestion` when feature disabled' do
stub_feature_flags(diff_suggestions: false)
doc = filter(input, default_context)
result = doc.css('code').first
expect(result[:class]).to be_nil
end
it 'includes no `js-render-suggestion` when filter is disabled' do it 'includes no `js-render-suggestion` when filter is disabled' do
doc = filter(input) doc = filter(input)
result = doc.css('code').first result = doc.css('code').first