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', () => {
);
}
if (gon.features?.suggestPipeline) {
const successPipelineEl = document.querySelector('.js-success-pipeline-modal');
const successPipelineEl = document.querySelector('.js-success-pipeline-modal');
if (successPipelineEl) {
// eslint-disable-next-line no-new
new Vue({
el: successPipelineEl,
render(createElement) {
return createElement(PipelineTourSuccessModal, {
props: {
...successPipelineEl.dataset,
},
});
},
});
}
if (successPipelineEl) {
// eslint-disable-next-line no-new
new Vue({
el: successPipelineEl,
render(createElement) {
return createElement(PipelineTourSuccessModal, {
props: {
...successPipelineEl.dataset,
},
});
},
});
}
if (gon?.features?.gitlabCiYmlPreview) {
......
......@@ -155,10 +155,7 @@ export default {
},
shouldSuggestPipelines() {
return (
gon.features?.suggestPipeline &&
!this.mr.hasCI &&
this.mr.mergeRequestAddCiConfigPath &&
!this.mr.isDismissedSuggestPipeline
!this.mr.hasCI && this.mr.mergeRequestAddCiConfigPath && !this.mr.isDismissedSuggestPipeline
);
},
shouldRenderCodeQuality() {
......
......@@ -33,7 +33,6 @@ class Projects::BlobController < Projects::ApplicationController
before_action :set_last_commit_sha, only: [:edit, :update]
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)
end
......
......@@ -27,7 +27,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action :authenticate_user!, only: [:assign_related_issues]
before_action :check_user_can_push_to_source_branch!, only: [:rebase]
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(:mr_commit_neighbor_nav, @project, default_enabled: true)
push_frontend_feature_flag(:multiline_comments, @project, default_enabled: true)
......
......@@ -382,8 +382,7 @@ module BlobHelper
end
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) &&
@project.uses_default_ci_config? &&
cookies[suggest_pipeline_commit_cookie_name].present?
......
......@@ -2,8 +2,6 @@
module SuggestPipelineHelper
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
......@@ -67,15 +67,15 @@ class MergeRequestWidgetEntity < Grape::Entity
)
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
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
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)
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', () => {
});
});
describe('suggestPipeline feature flag', () => {
describe('suggestPipeline', () => {
beforeEach(() => {
mock.onAny().reply(200);
......@@ -860,8 +860,6 @@ describe('mrWidgetOptions', () => {
describe('given feature flag is enabled', () => {
beforeEach(() => {
gon.features = { suggestPipeline: true };
createComponent();
vm.mr.hasCI = false;
......@@ -891,19 +889,5 @@ describe('mrWidgetOptions', () => {
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
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) }
context 'feature enabled' do
it 'is true' do
expect(helper.show_suggest_pipeline_creation_celebration?).to be_truthy
end
it 'is true' do
expect(helper.show_suggest_pipeline_creation_celebration?).to be_truthy
end
context 'file is invalid format' do
let(:data) { 'foo' }
context 'file is invalid format' do
let(:data) { 'foo' }
it 'is false' do
expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey
end
it 'is false' do
expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey
end
end
context 'does not use the default ci config' do
before do
project.ci_config_path = 'something_bad'
end
it 'is false' do
expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey
end
context 'does not use the default ci config' do
before do
project.ci_config_path = 'something_bad'
end
context 'does not have the needed cookie' do
before do
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
it 'is false' do
expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey
end
end
context 'blob does not have auxiliary view' do
before do
allow(blob).to receive(:auxiliary_viewer).and_return(nil)
end
context 'does not have the needed cookie' do
before do
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
it 'is false' do
expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey
end
end
context 'feature disabled' do
context 'blob does not have auxiliary view' do
before do
stub_feature_flags(suggest_pipeline: false)
allow(blob).to receive(:auxiliary_viewer).and_return(nil)
end
it 'is false' do
......@@ -294,10 +282,8 @@ RSpec.describe BlobHelper do
context 'when file is not a pipeline config file' do
let(:blob) { fake_blob(path: 'LICENSE') }
context 'feature enabled' do
it 'is false' do
expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey
end
it 'is false' do
expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey
end
end
end
......
......@@ -285,54 +285,34 @@ RSpec.describe MergeRequestWidgetEntity do
end
describe 'user callouts' do
context 'when suggest pipeline feature is enabled' do
subject { described_class.new(resource, request: request, experiment_enabled: :suggest_pipeline).as_json }
subject { described_class.new(resource, request: request).as_json }
it 'provides a valid path value for user callout path' do
expect(subject[:user_callouts_path]).to eq '/-/user_callouts'
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
it 'provides a valid path value for user callout path' do
expect(subject[:user_callouts_path]).to eq '/-/user_callouts'
end
context 'when user is not logged in' do
let(:request) { double('request', current_user: nil, project: project) }
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 'returns a blank is dismissed value' do
expect(subject[:is_dismissed_suggest_pipeline]).to be_nil
end
end
it 'provides a valid value for if it is dismissed' do
expect(subject[:is_dismissed_suggest_pipeline]).to be(false)
end
context 'when suggest pipeline feature is not enabled' do
context 'when the suggest pipeline has been dismissed' do
before do
stub_feature_flags(suggest_pipeline: false)
create(:user_callout, user: user, feature_name: described_class::SUGGEST_PIPELINE)
end
it 'provides no valid value for user callout path' do
expect(subject[:user_callouts_path]).to be_nil
it 'indicates suggest pipeline has been dismissed' do
expect(subject[:is_dismissed_suggest_pipeline]).to be(true)
end
end
it 'provides no valid value for suggest pipeline feature id' do
expect(subject[:suggest_pipeline_feature_id]).to be_nil
end
context 'when user is not logged in' do
let(:request) { double('request', current_user: nil, project: project) }
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
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