Commit aa499f44 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'id-remove-cached-pipeline-serializer-ff' into 'master'

Remove merge_request_cached_pipeline_serializer FF [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!57822
parents a308739a 08db5e12
...@@ -46,9 +46,7 @@ class MergeRequestPollCachedWidgetEntity < IssuableEntity ...@@ -46,9 +46,7 @@ class MergeRequestPollCachedWidgetEntity < IssuableEntity
end end
end end
expose :actual_head_pipeline, as: :pipeline, if: -> (mr, _) { expose :actual_head_pipeline, as: :pipeline, if: -> (mr, _) { presenter(mr).can_read_pipeline? } do |merge_request, options|
Feature.enabled?(:merge_request_cached_pipeline_serializer, mr.project) && presenter(mr).can_read_pipeline?
} do |merge_request, options|
MergeRequests::PipelineEntity.represent(merge_request.actual_head_pipeline, options) MergeRequests::PipelineEntity.represent(merge_request.actual_head_pipeline, options)
end end
......
...@@ -19,12 +19,6 @@ class MergeRequestPollWidgetEntity < Grape::Entity ...@@ -19,12 +19,6 @@ class MergeRequestPollWidgetEntity < Grape::Entity
# User entities # User entities
expose :merge_user, using: UserEntity expose :merge_user, using: UserEntity
expose :actual_head_pipeline, as: :pipeline, if: -> (mr, _) {
Feature.disabled?(:merge_request_cached_pipeline_serializer, mr.project) && presenter(mr).can_read_pipeline?
} do |merge_request, options|
MergeRequests::PipelineEntity.represent(merge_request.actual_head_pipeline, options)
end
expose :merge_pipeline, if: ->(mr, _) { mr.merged? && can?(request.current_user, :read_pipeline, mr.target_project)} do |merge_request, options| expose :merge_pipeline, if: ->(mr, _) { mr.merged? && can?(request.current_user, :read_pipeline, mr.target_project)} do |merge_request, options|
MergeRequests::PipelineEntity.represent(merge_request.merge_pipeline, options) MergeRequests::PipelineEntity.represent(merge_request.merge_pipeline, options)
end end
......
---
title: Move pipelines calculation from widget.json to cached_widget.json
merge_request: 57822
author:
type: performance
---
name: merge_request_cached_pipeline_serializer
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38273
rollout_issue_url:
milestone: '13.5'
type: development
group: group::code review
default_enabled: false
...@@ -248,14 +248,6 @@ RSpec.describe MergeRequestPollCachedWidgetEntity do ...@@ -248,14 +248,6 @@ RSpec.describe MergeRequestPollCachedWidgetEntity do
expect(subject[:pipeline]).to eq(pipeline_payload) expect(subject[:pipeline]).to eq(pipeline_payload)
end end
context 'when merge_request_cached_pipeline_serializer is disabled' do
it 'does not return pipeline' do
stub_feature_flags(merge_request_cached_pipeline_serializer: false)
expect(subject[:pipeline]).to be_nil
end
end
end end
context 'when user does not have access to pipelines' do context 'when user does not have access to pipelines' do
......
...@@ -226,19 +226,6 @@ RSpec.describe MergeRequestPollWidgetEntity do ...@@ -226,19 +226,6 @@ RSpec.describe MergeRequestPollWidgetEntity do
expect(subject[:pipeline]).to be_nil expect(subject[:pipeline]).to be_nil
end end
context 'when merge_request_cached_pipeline_serializer is disabled' do
it 'returns detailed info about pipeline' do
stub_feature_flags(merge_request_cached_pipeline_serializer: false)
pipeline_payload =
MergeRequests::PipelineEntity
.represent(pipeline, request: req)
.as_json
expect(subject[:pipeline]).to eq(pipeline_payload)
end
end
it 'returns ci_status' do it 'returns ci_status' do
expect(subject[:ci_status]).to eq('pending') expect(subject[:ci_status]).to eq('pending')
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment