Commit 64bf56df authored by Stan Hu's avatar Stan Hu

Merge branch '267492-remove-feature-flag-suggest_pipeline-experiment' into 'master'

Remove suggest_pipeline feature flag

See merge request gitlab-org/gitlab!48140
parents b637e87f 4ff2e1c4
...@@ -73,22 +73,20 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -73,22 +73,20 @@ document.addEventListener('DOMContentLoaded', () => {
); );
} }
if (gon.features?.suggestPipeline) { const successPipelineEl = document.querySelector('.js-success-pipeline-modal');
const successPipelineEl = document.querySelector('.js-success-pipeline-modal');
if (successPipelineEl) { if (successPipelineEl) {
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Vue({ new Vue({
el: successPipelineEl, el: successPipelineEl,
render(createElement) { render(createElement) {
return createElement(PipelineTourSuccessModal, { return createElement(PipelineTourSuccessModal, {
props: { props: {
...successPipelineEl.dataset, ...successPipelineEl.dataset,
}, },
}); });
}, },
}); });
}
} }
if (gon?.features?.gitlabCiYmlPreview) { if (gon?.features?.gitlabCiYmlPreview) {
......
...@@ -155,10 +155,7 @@ export default { ...@@ -155,10 +155,7 @@ export default {
}, },
shouldSuggestPipelines() { shouldSuggestPipelines() {
return ( return (
gon.features?.suggestPipeline && !this.mr.hasCI && this.mr.mergeRequestAddCiConfigPath && !this.mr.isDismissedSuggestPipeline
!this.mr.hasCI &&
this.mr.mergeRequestAddCiConfigPath &&
!this.mr.isDismissedSuggestPipeline
); );
}, },
shouldRenderCodeQuality() { shouldRenderCodeQuality() {
......
...@@ -33,7 +33,6 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -33,7 +33,6 @@ class Projects::BlobController < Projects::ApplicationController
before_action :set_last_commit_sha, only: [:edit, :update] before_action :set_last_commit_sha, only: [:edit, :update]
before_action only: :show do before_action only: :show do
push_frontend_feature_flag(:suggest_pipeline, default_enabled: true)
push_frontend_feature_flag(:gitlab_ci_yml_preview, @project, default_enabled: false) push_frontend_feature_flag(:gitlab_ci_yml_preview, @project, default_enabled: false)
end end
......
...@@ -27,7 +27,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo ...@@ -27,7 +27,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action :authenticate_user!, only: [:assign_related_issues] before_action :authenticate_user!, only: [:assign_related_issues]
before_action :check_user_can_push_to_source_branch!, only: [:rebase] before_action :check_user_can_push_to_source_branch!, only: [:rebase]
before_action only: [:show] do before_action only: [:show] do
push_frontend_feature_flag(:suggest_pipeline, default_enabled: true)
push_frontend_feature_flag(:widget_visibility_polling, @project, default_enabled: true) push_frontend_feature_flag(:widget_visibility_polling, @project, default_enabled: true)
push_frontend_feature_flag(:mr_commit_neighbor_nav, @project, default_enabled: true) push_frontend_feature_flag(:mr_commit_neighbor_nav, @project, default_enabled: true)
push_frontend_feature_flag(:multiline_comments, @project, default_enabled: true) push_frontend_feature_flag(:multiline_comments, @project, default_enabled: true)
......
...@@ -382,8 +382,7 @@ module BlobHelper ...@@ -382,8 +382,7 @@ module BlobHelper
end end
def show_suggest_pipeline_creation_celebration? def show_suggest_pipeline_creation_celebration?
Feature.enabled?(:suggest_pipeline, default_enabled: true) && @blob.path == Gitlab::FileDetector::PATTERNS[:gitlab_ci] &&
@blob.path == Gitlab::FileDetector::PATTERNS[:gitlab_ci] &&
@blob.auxiliary_viewer&.valid?(project: @project, sha: @commit.sha, user: current_user) && @blob.auxiliary_viewer&.valid?(project: @project, sha: @commit.sha, user: current_user) &&
@project.uses_default_ci_config? && @project.uses_default_ci_config? &&
cookies[suggest_pipeline_commit_cookie_name].present? cookies[suggest_pipeline_commit_cookie_name].present?
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
module SuggestPipelineHelper module SuggestPipelineHelper
def should_suggest_gitlab_ci_yml? def should_suggest_gitlab_ci_yml?
Feature.enabled?(:suggest_pipeline, default_enabled: true) && current_user && params[:suggest_gitlab_ci_yml] == 'true'
current_user &&
params[:suggest_gitlab_ci_yml] == 'true'
end end
end end
...@@ -67,15 +67,15 @@ class MergeRequestWidgetEntity < Grape::Entity ...@@ -67,15 +67,15 @@ class MergeRequestWidgetEntity < Grape::Entity
) )
end end
expose :user_callouts_path, if: -> (*) { Feature.enabled?(:suggest_pipeline, default_enabled: true) } do |_merge_request| expose :user_callouts_path do |_merge_request|
user_callouts_path user_callouts_path
end end
expose :suggest_pipeline_feature_id, if: -> (*) { Feature.enabled?(:suggest_pipeline, default_enabled: true) } do |_merge_request| expose :suggest_pipeline_feature_id do |_merge_request|
SUGGEST_PIPELINE SUGGEST_PIPELINE
end end
expose :is_dismissed_suggest_pipeline, if: -> (*) { Feature.enabled?(:suggest_pipeline, default_enabled: true) } do |_merge_request| expose :is_dismissed_suggest_pipeline do |_merge_request|
current_user && current_user.dismissed_callout?(feature_name: SUGGEST_PIPELINE) current_user && current_user.dismissed_callout?(feature_name: SUGGEST_PIPELINE)
end end
......
---
name: suggest_pipeline
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45926
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/267492
milestone: '13.6'
type: development
group: group::expansion
default_enabled: true
...@@ -849,7 +849,7 @@ describe('mrWidgetOptions', () => { ...@@ -849,7 +849,7 @@ describe('mrWidgetOptions', () => {
}); });
}); });
describe('suggestPipeline feature flag', () => { describe('suggestPipeline', () => {
beforeEach(() => { beforeEach(() => {
mock.onAny().reply(200); mock.onAny().reply(200);
...@@ -860,8 +860,6 @@ describe('mrWidgetOptions', () => { ...@@ -860,8 +860,6 @@ describe('mrWidgetOptions', () => {
describe('given feature flag is enabled', () => { describe('given feature flag is enabled', () => {
beforeEach(() => { beforeEach(() => {
gon.features = { suggestPipeline: true };
createComponent(); createComponent();
vm.mr.hasCI = false; vm.mr.hasCI = false;
...@@ -891,19 +889,5 @@ describe('mrWidgetOptions', () => { ...@@ -891,19 +889,5 @@ describe('mrWidgetOptions', () => {
expect(findSuggestPipeline()).toBeNull(); expect(findSuggestPipeline()).toBeNull();
}); });
}); });
describe('given feature flag is not enabled', () => {
beforeEach(() => {
gon.features = { suggestPipeline: false };
createComponent();
vm.mr.hasCI = false;
});
it('should not suggest pipelines when none exist', () => {
expect(findSuggestPipeline()).toBeNull();
});
});
}); });
}); });
...@@ -236,53 +236,41 @@ RSpec.describe BlobHelper do ...@@ -236,53 +236,41 @@ RSpec.describe BlobHelper do
let(:data) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) } let(:data) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) }
let(:blob) { fake_blob(path: Gitlab::FileDetector::PATTERNS[:gitlab_ci], data: data) } let(:blob) { fake_blob(path: Gitlab::FileDetector::PATTERNS[:gitlab_ci], data: data) }
context 'feature enabled' do it 'is true' do
it 'is true' do expect(helper.show_suggest_pipeline_creation_celebration?).to be_truthy
expect(helper.show_suggest_pipeline_creation_celebration?).to be_truthy end
end
context 'file is invalid format' do context 'file is invalid format' do
let(:data) { 'foo' } let(:data) { 'foo' }
it 'is false' do it 'is false' do
expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey
end
end end
end
context 'does not use the default ci config' do context 'does not use the default ci config' do
before do before do
project.ci_config_path = 'something_bad' project.ci_config_path = 'something_bad'
end
it 'is false' do
expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey
end
end end
context 'does not have the needed cookie' do it 'is false' do
before do expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey
helper.request.cookies.delete "suggest_gitlab_ci_yml_commit_#{project.id}"
end
it 'is false' do
expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey
end
end end
end
context 'blob does not have auxiliary view' do context 'does not have the needed cookie' do
before do before do
allow(blob).to receive(:auxiliary_viewer).and_return(nil) helper.request.cookies.delete "suggest_gitlab_ci_yml_commit_#{project.id}"
end end
it 'is false' do it 'is false' do
expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey
end
end end
end end
context 'feature disabled' do context 'blob does not have auxiliary view' do
before do before do
stub_feature_flags(suggest_pipeline: false) allow(blob).to receive(:auxiliary_viewer).and_return(nil)
end end
it 'is false' do it 'is false' do
...@@ -294,10 +282,8 @@ RSpec.describe BlobHelper do ...@@ -294,10 +282,8 @@ RSpec.describe BlobHelper do
context 'when file is not a pipeline config file' do context 'when file is not a pipeline config file' do
let(:blob) { fake_blob(path: 'LICENSE') } let(:blob) { fake_blob(path: 'LICENSE') }
context 'feature enabled' do it 'is false' do
it 'is false' do expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey
expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey
end
end end
end end
end end
......
...@@ -285,54 +285,34 @@ RSpec.describe MergeRequestWidgetEntity do ...@@ -285,54 +285,34 @@ RSpec.describe MergeRequestWidgetEntity do
end end
describe 'user callouts' do describe 'user callouts' do
context 'when suggest pipeline feature is enabled' do subject { described_class.new(resource, request: request).as_json }
subject { described_class.new(resource, request: request, experiment_enabled: :suggest_pipeline).as_json }
it 'provides a valid path value for user callout path' do it 'provides a valid path value for user callout path' do
expect(subject[:user_callouts_path]).to eq '/-/user_callouts' expect(subject[:user_callouts_path]).to eq '/-/user_callouts'
end end
it 'provides a valid value for suggest pipeline feature id' do
expect(subject[:suggest_pipeline_feature_id]).to eq described_class::SUGGEST_PIPELINE
end
it 'provides a valid value for if it is dismissed' do
expect(subject[:is_dismissed_suggest_pipeline]).to be(false)
end
context 'when the suggest pipeline has been dismissed' do
before do
create(:user_callout, user: user, feature_name: described_class::SUGGEST_PIPELINE)
end
it 'indicates suggest pipeline has been dismissed' do
expect(subject[:is_dismissed_suggest_pipeline]).to be(true)
end
end
context 'when user is not logged in' do it 'provides a valid value for suggest pipeline feature id' do
let(:request) { double('request', current_user: nil, project: project) } expect(subject[:suggest_pipeline_feature_id]).to eq described_class::SUGGEST_PIPELINE
end
it 'returns a blank is dismissed value' do it 'provides a valid value for if it is dismissed' do
expect(subject[:is_dismissed_suggest_pipeline]).to be_nil expect(subject[:is_dismissed_suggest_pipeline]).to be(false)
end
end
end end
context 'when suggest pipeline feature is not enabled' do context 'when the suggest pipeline has been dismissed' do
before do before do
stub_feature_flags(suggest_pipeline: false) create(:user_callout, user: user, feature_name: described_class::SUGGEST_PIPELINE)
end end
it 'provides no valid value for user callout path' do it 'indicates suggest pipeline has been dismissed' do
expect(subject[:user_callouts_path]).to be_nil expect(subject[:is_dismissed_suggest_pipeline]).to be(true)
end end
end
it 'provides no valid value for suggest pipeline feature id' do context 'when user is not logged in' do
expect(subject[:suggest_pipeline_feature_id]).to be_nil let(:request) { double('request', current_user: nil, project: project) }
end
it 'provides no valid value for if it is dismissed' do it 'returns a blank is dismissed value' do
expect(subject[:is_dismissed_suggest_pipeline]).to be_nil expect(subject[:is_dismissed_suggest_pipeline]).to be_nil
end end
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