diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-11-15 10:25:34 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-11-15 10:25:34 +0000 |
commit | b7cedd91e5ec07461b25f3920ae6cf2b00f3d84e (patch) | |
tree | 264fb6418b8c1339daab9735f2b026366750d739 | |
parent | 7528b2d26070fcbf3d88b60d54955257dc48141e (diff) | |
parent | 6c796702a4dd89ae76215b4d99ec02a6e224b704 (diff) | |
download | gitlab-ce-b7cedd91e5ec07461b25f3920ae6cf2b00f3d84e.tar.gz |
Merge branch 'osw-remove-comment-on-any-diff-line-ff' into 'master'
Remove 'comment_on_any_diff_line' feature flag
Closes #54034
See merge request gitlab-org/gitlab-ce!23093
-rw-r--r-- | app/controllers/projects/blob_controller.rb | 7 | ||||
-rw-r--r-- | spec/controllers/projects/blob_controller_spec.rb | 22 |
2 files changed, 1 insertions, 28 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 0718658cd48..2a6fe3b9c97 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -122,7 +122,7 @@ class Projects::BlobController < Projects::ApplicationController @lines.map! do |line| # These are marked as context lines but are loaded from blobs. # We also have context lines loaded from diffs in other places. - diff_line = Gitlab::Diff::Line.new(line, expanded_diff_line_type, nil, nil, nil) + diff_line = Gitlab::Diff::Line.new(line, nil, nil, nil, nil) diff_line.rich_text = line diff_line end @@ -132,11 +132,6 @@ class Projects::BlobController < Projects::ApplicationController render json: DiffLineSerializer.new.represent(@lines) end - def expanded_diff_line_type - # Context lines can't receive comments. - Feature.enabled?(:comment_in_any_diff_line, @project) ? nil : 'context' - end - def add_match_line return unless @form.unfold? diff --git a/spec/controllers/projects/blob_controller_spec.rb b/spec/controllers/projects/blob_controller_spec.rb index 74771abde71..5fdf7f1229d 100644 --- a/spec/controllers/projects/blob_controller_spec.rb +++ b/spec/controllers/projects/blob_controller_spec.rb @@ -141,28 +141,6 @@ describe Projects::BlobController do expect(lines.first).to have_key('rich_text') end - context 'comment in any diff line feature flag' do - it 'renders context lines when feature disabled' do - stub_feature_flags(comment_in_any_diff_line: false) - - do_get(since: 1, to: 5, offset: 10, from_merge_request: true) - lines = JSON.parse(response.body) - all_context = lines.all? { |line| line['type'] == 'context' } - - expect(all_context).to be(true) - end - - it 'renders unchanged lines when feature enabled' do - stub_feature_flags(comment_in_any_diff_line: true) - - do_get(since: 1, to: 5, offset: 10, from_merge_request: true) - lines = JSON.parse(response.body) - all_unchanged = lines.all? { |line| line['type'].nil? } - - expect(all_unchanged).to be(true) - end - end - context 'when rendering match lines' do it 'adds top match line when "since" is less than 1' do do_get(since: 5, to: 10, offset: 10, from_merge_request: true) |