diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-12-18 18:42:34 +0300 |
---|---|---|
committer | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-01-02 20:36:15 +0300 |
commit | 15627ccb09aec7601af29c842448ccaeaf112aa2 (patch) | |
tree | 0631bbf99273944e06774f605e05dbbbdc77c337 | |
parent | 5eff636db560388f69fd02b0ba25e9560ff7fc30 (diff) |
Merge branch 'osw-revert-suggestions-ff' into 'master'
Remove feature flag for suggest changes feature
See merge request gitlab-org/gitlab-ce!23892
(cherry picked from commit 58ee1746a867ea939dd64a993963f14fc34c338d)
ee425c9c Remove feature flag for suggest changes feature
-rw-r--r-- | app/models/merge_request.rb | 3 | ||||
-rw-r--r-- | app/models/suggestion.rb | 6 | ||||
-rw-r--r-- | app/views/projects/merge_requests/show.html.haml | 5 | ||||
-rw-r--r-- | lib/banzai/filter/suggestion_filter.rb | 1 | ||||
-rw-r--r-- | spec/lib/banzai/filter/suggestion_filter_spec.rb | 9 |
5 files changed, 4 insertions, 20 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index baf320d84a1..24b801b38a2 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -364,8 +364,7 @@ class MergeRequest < ActiveRecord::Base end def supports_suggestion? - # Should be `true` when removing the FF. - Suggestion.feature_enabled? + true end # Calls `MergeWorker` to proceed with the merge process and diff --git a/app/models/suggestion.rb b/app/models/suggestion.rb index cec5ea30f9d..c76b8e71507 100644 --- a/app/models/suggestion.rb +++ b/app/models/suggestion.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true class Suggestion < ApplicationRecord - FEATURE_FLAG = :diff_suggestions - belongs_to :note, inverse_of: :suggestions validates :note, presence: true validates :commit_id, presence: true, if: :applied? @@ -10,10 +8,6 @@ class Suggestion < ApplicationRecord delegate :original_position, :position, :diff_file, :noteable, to: :note - def self.feature_enabled? - Feature.enabled?(FEATURE_FLAG) - end - def project noteable.source_project end diff --git a/app/views/projects/merge_requests/show.html.haml b/app/views/projects/merge_requests/show.html.haml index a0a03838b10..e5c80aae0f7 100644 --- a/app/views/projects/merge_requests/show.html.haml +++ b/app/views/projects/merge_requests/show.html.haml @@ -5,6 +5,7 @@ - page_title "#{@merge_request.title} (#{@merge_request.to_reference})", "Merge Requests" - page_description @merge_request.description - 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) } } = render "projects/merge_requests/mr_title" @@ -67,7 +68,7 @@ noteable_data: serialize_issuable(@merge_request), noteable_type: 'MergeRequest', 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} } #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) #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), - help_page_path: nil, + help_page_path: suggest_changes_help_path, current_user_data: UserSerializer.new(project: @project).represent(current_user, {}, MergeRequestUserEntity).to_json, project_path: project_path(@merge_request.project)} } diff --git a/lib/banzai/filter/suggestion_filter.rb b/lib/banzai/filter/suggestion_filter.rb index 822db7cf26e..307ea449140 100644 --- a/lib/banzai/filter/suggestion_filter.rb +++ b/lib/banzai/filter/suggestion_filter.rb @@ -7,7 +7,6 @@ module Banzai TAG_CLASS = 'js-render-suggestion'.freeze def call - return doc unless Suggestion.feature_enabled? return doc unless suggestions_filter_enabled? doc.search('pre.suggestion > code').each do |node| diff --git a/spec/lib/banzai/filter/suggestion_filter_spec.rb b/spec/lib/banzai/filter/suggestion_filter_spec.rb index 55a141bf315..b13c90b54bd 100644 --- a/spec/lib/banzai/filter/suggestion_filter_spec.rb +++ b/spec/lib/banzai/filter/suggestion_filter_spec.rb @@ -17,15 +17,6 @@ describe Banzai::Filter::SuggestionFilter do expect(result[:class]).to include('js-render-suggestion') 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 doc = filter(input) result = doc.css('code').first |