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

Merge branch '298795-ci_notification_dot-experiment-successful-cleanup' into 'master'

Cleanup ci_notification_dot experiment [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!54721
parents 6401d002 e89ec19d
......@@ -7,20 +7,20 @@ module EE
BUY_PIPELINE_MINUTES_NOTIFICATION_DOT = 'buy_pipeline_minutes_notification_dot'
def show_buy_pipeline_minutes?(project, namespace)
return false unless experiment_enabled?(:ci_notification_dot)
return false unless ::Gitlab.dev_env_or_com?
show_out_of_pipeline_minutes_notification?(project, namespace)
end
def show_pipeline_minutes_notification_dot?(project, namespace)
return false unless experiment_enabled?(:ci_notification_dot)
return false unless ::Gitlab.dev_env_or_com?
return false if notification_dot_acknowledged?
show_out_of_pipeline_minutes_notification?(project, namespace)
end
def show_buy_pipeline_with_subtext?(project, namespace)
return false unless experiment_enabled?(:ci_notification_dot)
return false unless ::Gitlab.dev_env_or_com?
return false unless notification_dot_acknowledged?
show_out_of_pipeline_minutes_notification?(project, namespace)
......
---
title: Cleanup ci_notification_dot experiment
merge_request: 54721
author:
type: added
---
name: ci_notification_dot_experiment_percentage
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/27626
rollout_issue_url: https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/101
milestone: '12.10'
type: experiment
group: group::expansion
default_enabled: false
......@@ -21,13 +21,13 @@ RSpec.describe EE::Ci::RunnersHelper do
end
context 'with a project and namespace' do
context 'when experiment is disabled' do
let(:experiment_status) { false }
context 'when not on dot com' do
let(:dev_env_or_com) { false }
it { is_expected.to be_falsey }
end
context 'when experiment is enabled' do
context 'when on dot com' do
it { is_expected.to be_truthy }
context 'without a persisted project passed' do
......@@ -82,15 +82,15 @@ RSpec.describe EE::Ci::RunnersHelper do
end
context 'with notifications' do
let(:experiment_status) { true }
let(:dev_env_or_com) { true }
describe '.show_buy_pipeline_minutes?' do
subject { helper.show_buy_pipeline_minutes?(project, namespace) }
context 'when experiment is "ci_notification_dot"' do
context 'when on dot com' do
it_behaves_like 'minutes notification' do
before do
allow(helper).to receive(:experiment_enabled?).with(:ci_notification_dot).and_return(experiment_status)
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
end
end
end
......@@ -100,7 +100,7 @@ RSpec.describe EE::Ci::RunnersHelper do
subject { helper.show_pipeline_minutes_notification_dot?(project, namespace) }
before do
allow(helper).to receive(:experiment_enabled?).with(:ci_notification_dot).and_return(experiment_status)
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
end
it_behaves_like 'minutes notification'
......@@ -127,7 +127,7 @@ RSpec.describe EE::Ci::RunnersHelper do
subject { helper.show_buy_pipeline_with_subtext?(project, namespace) }
before do
allow(helper).to receive(:experiment_enabled?).with(:ci_notification_dot).and_return(experiment_status)
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
end
context 'when the notification dot has not been acknowledged' do
......
......@@ -34,10 +34,6 @@
module Gitlab
module Experimentation
EXPERIMENTS = {
ci_notification_dot: {
tracking_category: 'Growth::Expansion::Experiment::CiNotificationDot',
use_backwards_compatible_subject_index: true
},
upgrade_link_in_user_menu_a: {
tracking_category: 'Growth::Expansion::Experiment::UpgradeLinkInUserMenuA',
use_backwards_compatible_subject_index: true
......
......@@ -7,7 +7,6 @@ require 'spec_helper'
RSpec.describe Gitlab::Experimentation::EXPERIMENTS do
it 'temporarily ensures we know what experiments exist for backwards compatibility' do
expected_experiment_keys = [
:ci_notification_dot,
:upgrade_link_in_user_menu_a,
:invite_members_version_a,
:invite_members_version_b,
......
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